Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+34 votes
asked in CSC285_Fall2018 by (8 points)

1 Answer

+15 votes
 
Best answer

If you mean the number of frames, then that question has already been answered here:

http://lovelace.augustana.edu/q2a/index.php/126/how-to-use-the-slider-to-change-frames

If you want the duration in seconds, then you can take the number of frames (see previous answer) and divide the number of frames by the framerate (in frames per second), which I think you can get by doing:

vidCap.get(Videoio.CV_CAP_PROP_FPS);

where vidCap is an opencv VideoCapture object.

answered by (10.4k points)
selected by
...