Open jmgomezpoveda opened 11 years ago
http://code.google.com/p/javacv/issues/detail?id=292#c4
Action: Check what the ffmpeg program does, and if that does what you need, then to implement something similar in FFmpegFrameGrabber.getFrameRate()...
Workaround implemented as a recalculateFps method, which retrieves a few seconds of images, and calculates the average fps. However, sometimes it returns a slightly lower number. The higher the number of seconds, the more precise, but the longer the user will have to wait for initialization.
Detail in http://code.google.com/p/javacv/issues/detail?id=292
Calling getFrameRate() on a FFmpegFrameGrabber object, returns just the number that was previously set sith setFrameRate(), so, the requested framerate. If the video input does not support that framerate, getFrameRate() still returns the default value. Calling getFrameRate() on an OpenCVFrameGrabber object returns -1.
For example, we request 30 fps with setFrameRate, but a given webcam only supports 15 fps. getFrameRate returns 30 with FFmpegFG, and -1 with OpenCVFG.
I would expect this method to return the actual framerate set in the source (15 in the example).