Ask Your Question

Reading a Video File at "Real Time" fps

asked 2013-04-03 15:11:28 -0600

jdturnage gravatar image

I know how to read a video file with OpenCV, but I am wondering if there is example code on how to read a video file at 30fps, or 40fps, or anything specific. What I have noticed is that OpenCV will read and playback the file as fast as it possibly can. I want to be able to throttle the speed at which it is read. Any assistance in this matter is greatly appreciated. Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-03 15:28:33 -0600

You can read the frame rate achieved with ' double rate=capture.get(CV_CAP_PROP_FPS); '. Then you can add an internal delay in your loop to match the speed you want (as long as it is slower, of course). Hope this helps.

edit flag offensive delete link more


I do not agree. This function will still be limited by the speed of your system, even if you set the FPS higher. Basically this is due to the time needed for your hardware to capture a frame and sent a frame captured event to your system.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-04 02:30:07 -0600 )edit

I said "as long as it is slower, of course." My system reading at 10 fps with medium hi res 1280. If you need speed, you need fast hardware or reduce you window size etc.

Bob Root gravatar imageBob Root ( 2013-04-04 12:29:01 -0600 )edit

Ok excuse me, you are correct then. Indeed for speedup, lower window size or better hardware is only way to go.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-04 15:28:02 -0600 )edit

Thanks for the response. I will definitely give this a go. And my hardware is quite fast, so window size shouldn't matter too much.

jdturnage gravatar imagejdturnage ( 2013-04-05 10:02:53 -0600 )edit

Question Tools


Asked: 2013-04-03 15:11:28 -0600

Seen: 6,446 times

Last updated: Apr 03 '13