I am running a code to extract optical flow on a movie and I want to run it on all the frames of the movie. However, when i use
number_of_frames = (int) cvGetCaptureProperty( input_video, CV_CAP_PROP_POS_FRAMES );
the number_of_frames comes out to be 0; My code snippet is as follows:
CvCapture *input_video = cvCaptureFromFile("C:\\Movies\\WESTWARD_HO.avi");
long number_of_frames;
cvSetCaptureProperty( input_video, CV_CAP_PROP_POS_AVI_RATIO, 1. );
number_of_frames = (int) cvGetCaptureProperty( input_video, CV_CAP_PROP_POS_FRAMES );
I am using visual studio 2008 with OpenCv 2.1. I know its old but i have to use it for backward compatibility with some other part of project. Thanks in advance !!