File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Requirements:
2
2
# pip install numpy
3
- # sudo apt-get install python-openCV
3
+ # pip install opencv-python
4
4
# Program:
5
- # opens your webcam, and records.
5
+ # Opens your webcam and records.
6
6
7
+ # Improve this program and make it suitable for general module like use in another programs
7
8
import cv2
8
9
9
10
cap = cv2 .VideoCapture (0 )
13
14
frames_height = int (cap .get (4 ))
14
15
15
16
# Specify the video codec
16
- # FourCC is plateform dependent, however MJPG is a safe choice.
17
+ # FourCC is platform dependent; however, MJPG is a safe choice.
17
18
fourcc = cv2 .VideoWriter_fourcc (* "MJPG" )
18
19
19
20
# Create video writer object. Save file to recording.avi
24
25
ret , frame = cap .read ()
25
26
26
27
if ret == True :
27
-
28
28
# Write frame to recording.avi
29
29
out .write (frame )
30
30
36
36
if cv2 .waitKey (1 ) & 0xFF == ord ("q" ):
37
37
break
38
38
39
- # When everything done, release the capture and video writer
39
+ # When everything is done, release the capture and video writer
40
40
cap .release ()
41
41
out .release ()
42
42
cv2 .destroyAllWindows ()
You can’t perform that action at this time.
0 commit comments