# The transition to the desired frame does not work cap.set(CAP\_PROP\_POS\_FRAMES, 100);

**URL:** <https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392>\
**Category:** Uncategorized\
**Tags:** videoio\
**Created:** [March 19, 2026, 3:15am UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392 "2026-03-19T03:15:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acronis](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Acronis](https://forum.opencv.org/u/Acronis)\
**Post date:** [March 19, 2026, 3:15am UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/1 "2026-03-19T03:15:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 19, 2026, 10:32am UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/2 "2026-03-19T10:32:36Z")

</div>

What version of opencv did you use?

---

<div class="post-metadata">

**Author:** ![Acronis](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Acronis](https://forum.opencv.org/u/Acronis)\
**Post date:** [March 19, 2026, 10:47am UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/3 "2026-03-19T10:47:37Z")

</div>

Hi !

OpenCV version 4.13.0

---

<div class="post-metadata">

**Author:** ![Acronis](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Acronis](https://forum.opencv.org/u/Acronis)\
**Post date:** [March 19, 2026, 2:27pm UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/4 "2026-03-19T14:27:51Z")

</div>

total\_frames = int(cap.get(CAP\_PROP\_FRAME\_COUNT));

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

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 19, 2026, 2:37pm UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/5 "2026-03-19T14:37:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Acronis](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Acronis](https://forum.opencv.org/u/Acronis)\
**Post date:** [March 20, 2026, 2:46am UTC](https://forum.opencv.org/t/the-transition-to-the-desired-frame-does-not-work-cap-set-cap-prop-pos-frames-100/24392/6 "2026-03-20T02:46:02Z")

</div>

Thanks !

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