Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First, note that when you open cv::VideoCapture it could open the target video device not in the same mode as VLC player. So, if you have got different fps values in this case - it is normal.

Secondly, why you can not use the simplest one solution:

...
VideoCapture capture;
if(capture.open(argv[1])) {
   cv::Mat _framemat;
   double _frequency = cv::getTickFrequency(), _tick = cv::getTickCount();
   while(true) {
      if(capture.read(_framemat)) {

         // DO WHAT YOU NEED WITH THE IMAGE

         cout << "FPS: " << cv::getTickFrequency() / (cv::getTickCount() - _tick) << endl;
         _tick = cv::getTickCount(); 
      }
   }
}
...