Ask Your Question
0

How to get fps from video in java?

asked 2015-09-18 16:17:16 -0500

shofwan gravatar image

I have some task to do video processing and I want to do it with openCV and java.

The problem is when I didn't do much process there the video runs so fast. On the other hand when there is plenty thing to do with the video, the video runs so slow on my program. I got an idea to do something with the fps and then I only get this and still wonder how to get fps from video in java with or without openCV.

any help will be appreciated, especially if you can solve my root problem :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-20 10:28:00 -0500

RolandC gravatar image

Here's a solution with OpenCV 3:

    VideoCapture videoCapture = new VideoCapture();
    videoCapture.open("c:/movies/mymovie.mp4");
    double fps = videoCapture.get(Videoio.CAP_PROP_FPS);
    System.out.println( "fps: " + fps);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-18 16:17:16 -0500

Seen: 2,588 times

Last updated: Sep 20 '15