import cv2import numpy as npimport os cap = cv2.VideoCapture(1)#v4l2-ctl --list-devices 查看设备号,非正常中断时,设备号会变,?????????????后续解答fourcc=0x7634706dout = cv2.VideoWriter('1.mp4', fourcc,30, (640,480))#mp4比avi小,分辨率是frame.shape,设置成其他分辨保存的视频打不开num=0while 1:# g…