File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11# Requirements:
22# pip install numpy
3- # sudo apt-get install python-openCV
3+ # pip install opencv-python
44# Program:
5- # opens your webcam, and records.
5+ # Opens your webcam and records.
66
7+ # Improve this program and make it suitable for general module like use in another programs
78import cv2
89
910cap = cv2 .VideoCapture (0 )
1314frames_height = int (cap .get (4 ))
1415
1516# 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.
1718fourcc = cv2 .VideoWriter_fourcc (* "MJPG" )
1819
1920# Create video writer object. Save file to recording.avi
2425 ret , frame = cap .read ()
2526
2627 if ret == True :
27-
2828 # Write frame to recording.avi
2929 out .write (frame )
3030
3636 if cv2 .waitKey (1 ) & 0xFF == ord ("q" ):
3737 break
3838
39- # When everything done, release the capture and video writer
39+ # When everything is done, release the capture and video writer
4040cap .release ()
4141out .release ()
4242cv2 .destroyAllWindows ()
You can’t perform that action at this time.
0 commit comments