Video frames problem

asked 2020-05-10 10:30:21 -0500

trsh gravatar image

updated 2020-05-10 11:53:28 -0500

I'm going trough frames like this:

cap = cv2.VideoCapture(instance.video_file.path)
        # Capture frame-by-frame
        ret, frame =
        if ret == True:
            # some logic

what gives me 168 frames. But the when inspecting the video in players it has 173 frames (06.933 sec, 25 FPS). Where could this difference come from? Its messing up my work :(


Even more stranger - video.get(cv2.CAP_PROP_FRAME_COUNT) shows 172 frames. So it shows 172 frames, but can read further then 168. Why?

Edit 2

I reported a bug. Any workarounds greatly appreciated!!!

edit retag flag offensive close merge delete