Ask Your Question

Revision history [back]

How many frames is it when I call videoWriter.write?

In constructor function of VideoWriter, I set the fps is 10. But I call videoWriter.write(frame) function more than 10 times per second. So my question is what is the real fps in my saved video and which frames are saved?
Input 100 fps when set fps as 10, what is the result? Will it save 10 fps? which 10 fps in input 100 fps will be saved? videoWriter = cv2.VideoWriter('video_demo.avi', cv2.cv.CV_FOURCC('M', 'J', 'P', 'G'), 10, size)

success, frame = videoCapture.read()  

while success :  
    cv2.imshow("Video demo", frame) 
    videoWriter.write(frame) 
    success, frame = videoCapture.read()  
    if cv2.waitKey(1) == 27: 
        break  # esc to quit
click to hide/show revision 2
retagged

updated 2017-12-21 11:37:27 -0600

berak gravatar image

How many frames is it when I call videoWriter.write?

In constructor function of VideoWriter, I set the fps is 10. But I call videoWriter.write(frame) function more than 10 times per second. So my question is what is the real fps in my saved video and which frames are saved?
Input 100 fps when set fps as 10, what is the result? Will it save 10 fps? which 10 fps in input 100 fps will be saved? videoWriter = cv2.VideoWriter('video_demo.avi', cv2.cv.CV_FOURCC('M', 'J', 'P', 'G'), 10, size)

success, frame = videoCapture.read()  

while success :  
    cv2.imshow("Video demo", frame) 
    videoWriter.write(frame) 
    success, frame = videoCapture.read()  
    if cv2.waitKey(1) == 27: 
        break  # esc to quit