Ask Your Question

Revision history [back]

Duplicate frames in saved file from cv2.VideoWriter

Setup specs can be found below.

My VideoWriter writes @120fps, but the written video file has a repeated frame in it every 6 frames or so. This makes the true fps of the written video file closer to 100fps. When I use AmCap to record video there are no skipped frames.

I was wondering if anyone has any ideas as to how I could get those last 20 frames using OpenCV.

Additional notes: - Using Python - I had to set cv2.CAP_PROP_FPS to 150 to get the VideoWriter to write at 120. When I set it at 120 the file would not write. - I'm writing grayscale images and doing the conversion to gray in my main while loop. - I'm using a multithreaded approach

Windows 10, 64 bit Intel i5 3rd gen (circa 2012) $25 cheap USB webcam from Chinese manufacturer 1280*720@120fps