Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+36 votes
asked in CSC285_Fall2018 by (1 point)

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 (5.7k points)
selected by
...