frame rate using CAP_PROP_FPS is failed (C++).

asked 2019-08-14 13:29:32 -0600

I am opening an .avi video file and trying to set the fps to 40.0, but it is not changing.

video.set(CAP_PROP_FPS, 42.0)

edit retag flag offensive close merge delete

Comments

1

I thought it worked only when grabbing from a camera (provided the camera supports it). When grabbing from a file, it is your responsibility to wait some time before retrieving (and displaying) the next frame. If you don't add any wait instructions your program will read and display the video as fast as the storage can provide it.

Witek gravatar imageWitek ( 2019-08-15 11:37:05 -0600 )edit

you simply cannot set the FPS from a video file. You can grab all the frames and make a new video with a new FPS, but your initial idea is just broken...

StevenPuttemans gravatar imageStevenPuttemans ( 2019-08-19 09:23:46 -0600 )edit