import cv2
camera = cv2.VideoCapture(0)
video = cv2.VideoWriter('video.avi', -1, 25, (640, 480));
while True:
f,img = camera.read()
video.write(img)
cv2.imshow("webcam",img)
if (cv2.waitKey(5) != -1):
break
video.release()
我正在尝试播放视频并将其保存在video.avi文件中,但我有此错误,我可以找到很多人询问此问题,但没有人回答