Frames per second

I want to get the property FPS from a video that is recorded by a camera.

I use:

CvCapture* flujo_video = cvCreateFileCapture(argv[1]);
double parametro= cvGetCaptureProperty( flujo_video, CV_CAP_PROP_FPS);

The result of this is -nan and if I use an int format the result is -2147483648.

Upvotes: 0

Views: 308

Answers (2)

GPPK
GPPK

Reputation: 6666

Try it without using the deprecated C api:

VideoCapture cap(0); // open the video file for reading
double fps = cap.get(CV_CAP_PROP_FPS); //get the frames per seconds of the video

Upvotes: 1

Ander Biguri
Ander Biguri

Reputation: 35525

If you look around in the web, you can see lots of people having problem with this parameter. It turns out that being thousands of cameras/codecs/formats openCV cant handle them all, so often you get 0, NaN (not a number) or other illogical parameter. This generally means that you can not get the FPS for your camera.

Upvotes: 0

Related Questions