cap=cv2.VideoCapture(0)
#decode
fourcc=cv2.VideoWriter_fourcc('I', '4', '2', '0')
#image save
out=cv2.VideoWriter('out.avi',fourcc,20.0,(640,480))
while(cap.isOpened()):
ret,frame=cap.read()
if ret==True:
out.write(frame)
cv2.imshow('frame',frame)
if cv2.waitKey(1)& 0xFF==ord('q'):
break
else:
break
cap.release()
out.release()
cv2.destroyAllWindows()
沒有留言:
張貼留言