1
votes

I have an AVI video which I need to process in C++ using OpenCV. The problem is that OpenCV detects a FrameRate of 30, while in Matlab the VideoReader detects a FrameRate of 60 for the same video file. As a result, I can only extract half the frames in C++ compared to Matlab.

I tried setting the FPS to 60 in C++ with cv::VideoCapture::set(cv::CAP_PROP_FPS) but it does not affect it. I read that it also has to do with VideoCapture Backends (mine uses FFMPEG).

Is there a way to increase the FPS rate in OpenCV, since the video file supports it according to MATLAB?

1

1 Answers

0
votes

Is it like the "read" and "processing" of frames both from a single/main thread of your program? consider separating the read and processing of frames to different threads to increase FPS, as suggested in: https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/