File size: 343 Bytes
15bc41b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import cv2

camera = cv2.VideoCapture(0)
fps = cv2.CAP_PROP_FPS

video = cv2.VideoWriter('video.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 30, (640, 480))

while True:
    _, frame = camera.read()

    video.write(frame)

    cv2.imshow("Frame", frame)
    c = cv2.waitKey(1)

    if c == ord('q'):
        break

video.release()
camera.release()