Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

My saved video run in very fast for higher resolution?

I saved video with 640x480 resolution and played with windows media player successfully. But when I save video with 1280x720 using opencv-python, it plays in very fast. my code sample

fourcc = cv2.VideoWriter_fourcc(*'XVID')
outVid=cv2.VideoWriter('outputMovie.mp4', fourcc, 30.0, (640, 480))

while(vid.isOpened()):
    check, frame=vid.read()
    if check:
      #print(check)
      #print(frame.shape)
      outVid.write(frame)      
      #cv2.namedWindow("Capture Video", cv2.WINDOW_NORMAL)
      cv2.imshow("Capture Video", frame)
      if cv2.waitKey(1) & 0xFF == ord('q'):
         break
    else:
         break

outVid.release()  
vid.release()
cv2.destroyAllWindows()