Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Change FPS on video capture from file

I'm reading a video file, and it's slower than the actual FPS of the file (59 FPS @1080p) even if i'm not doing any processing to the image:

       using namespace cv;
       using namespace std;
       // Global variables
        UMat frame; //current frame
        int main(int argc, char** argv)
        {

                VideoCapture capture("myFile.MP4");
                namedWindow("Frame");
                capture.set(CAP_PROP_FPS, 120); //not changing anything
                cout>>capture.get(CAP_PROP_FPS);
                while (charCheckForEscKey != 27) {

                       capture >>frame;
                if (frame.empty())
                    break;
                imshow("Frame", frame);

                }

    }

Even if I tried to set CAP_PROP_FPS to 120 it doesn't change the fps of the file and when I get(CAP_PROP_FPS) I still get 59.9...

When I read the video the actual outcome is more or less 54 FPS (even using UMat).

Is there a way to read the file at a higher FPS rate ?

Thanks in advance

Change FPS on video capture from file

I'm reading a video file, and it's slower than the actual FPS of the file (59 FPS @1080p) even if i'm not doing any processing to the image:

       using namespace cv;
       using namespace std;
       // Global variables
        UMat frame; //current frame
        int main(int argc, char** argv)
        {

                VideoCapture capture("myFile.MP4");
                namedWindow("Frame");
                capture.set(CAP_PROP_FPS, 120); //not changing anything
                cout>>capture.get(CAP_PROP_FPS);
                while (charCheckForEscKey != 27) {

                       capture >>frame;
                if (frame.empty())
                    break;
                imshow("Frame", frame);

                }

    }

Even if I tried to set CAP_PROP_FPS to 120 it doesn't change the fps of the file and when I get(CAP_PROP_FPS) I still get 59.9...

When I read the video the actual outcome is more or less 54 FPS (even using UMat).

Is there a way to read the file at a higher FPS rate ?

Thanks in advance