Skip to content

Problems with correctly reading video frames #17257

@trsh

Description

@trsh
  • OpenCV => 4.2
  • Operating System / Platform => Windows 64 Bit
  • opencv-contrib-python 4.2.0.34
  • opencv-python 4.2.0.34
Detailed description

Video is 06.933 sec long with 25 FPS, what makes 173 frames (observed in video player)

However :

cap = cv2.VideoCapture(video_path)
cap.get(cv2.CAP_PROP_FRAME_COUNT)

gives 172 frames. And while counting manual:

while(cap.isOpened()):
        ret, frame = cap.read()
        if ret == True:
            frame_index += 1
        else: 
            break

it can't go any further than 168 frame

Sadly I can't share the video file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions