The transition to the desired frame does not work cap.set(CAP_PROP_POS_FRAMES, 100);

cap.set(CAP_PROP_POS_FRAMES, 100);Returns the true flag but does not skip to the desired frame.

cap.set(CAP_PROP_POS_MSEC, 10); This also returns True, but does not jump to the desired location in the video file.

To record the video, I used VideoWriter::fourcc(‘X’, ‘V’, ‘I’, ‘D’) or VideoWriter::fourcc(‘M’, ‘J’, ‘P’, ‘G’)

cap.get(CAP_PROP_FPS); This works fine, returns the frame rate correctly.

What could be the problem, or what other way can I go to the desired frame?

What version of opencv did you use?

Hi !

OpenCV version 4.13.0

total_frames = int(cap.get(CAP_PROP_FRAME_COUNT));

The video shows, but returns total_frames 0 frames. Why doesn’t it work?

That could have many reasons. Issues in OpenCV. Issues in ffmpeg. Issues with your video file, …

If you want to submit this as a bug to OpenCV’s github, then you will need to provide a sample video file, not too large, on which the example code fails.

Thanks !

I made a small test video and opened a topic on github.