0

I wanted to write a small script to extract a frame from a video file. OpenCV seems great library for it. But, there is one point that was not clear. After capturing the video file with 'VideoCapture()', every read() function capture the next frame every time. But, It starts from the 0th frame. It creates unknownth frame from the 5th second If I put 5 second of sleep.

My question is this. Should I wait 60 seconds to reach the frame that time, or is there any way to start the video capturing from a certain time?

agenel
  • 155
  • 1
  • 4
  • 13
  • 1
    Should be even simpler with `ffmpeg`. – Mark Setchell Apr 04 '21 at 08:35
  • 1
    It's just like reading from a regular file -- it reads the frames one by another, unless you explicitly seek to a different position (and the backend supports it). I.e. if you want for an hour, you'll get the same the same thing as if you wanted for a minute, or second, or not at all. – Dan Mašek Apr 04 '21 at 15:03

0 Answers0