Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Video frames problem

I'm going trough frames like this:

cap = cv2.VideoCapture(instance.video_file.path)
while(cap.isOpened()):
        # Capture frame-by-frame
        ret, frame = cap.read()
        if ret == True:
            result.append(frame_result)
        else: 
            break

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 :(

Video frames problem

I'm going trough frames like this:

cap = cv2.VideoCapture(instance.video_file.path)
while(cap.isOpened()):
        # Capture frame-by-frame
        ret, frame = cap.read()
        if ret == True:
            result.append(frame_result)
# some logic
        else: 
            break

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 :(

Video frames problem

I'm going trough frames like this:

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

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 :(

Edit:

Even more stranger - video.get(cv2.CAP_PROP_FRAME_COUNT) shows 172 frames

Video frames problem

I'm going trough frames like this:

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

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 :(

Edit:

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

Video frames problem

I'm going trough frames like this:

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

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 :(

Edit:

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!!!

Video frames problem

I'm going trough frames like this:

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

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 :(

Edit:

Even more stranger - video.get(cv2.CAP_PROP_FRAME_COUNT) 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!!!