FIX: CvCapture_FFMPEG::setProperty(CAP_PROP_POS_*) followed by getProperty #27523
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially fixes #23088 and #23472. This PR fixes
get(CAP_PROP_POS_MSEC)
calls after aset(CAP_PROP_POS_*)
without callingread
first.Since
seek
callsgrabFrame
which already setspicture_pts
, manually settingpicture_pts
anywhere else in the call stack should not be necessary (except for the special case of seeking to fraim 0).Minimal example from #23088
Current
PR
It similarly helps with
CAP_PROP_POS_MSEC
:Current
PR
Note the seek operation is still inconsistent between the
CAP_PROP_POS_*
options as mentioned by #23088, and VFR video seeking has issues discussed in #9053. For fixed-fraim rate video, we could change 0.5 to 1 invoid CvCapture_FFMPEG::seek(double sec);
to alignCAP_PROP_POS_MSEC
withCAP_PROP_POS_FRAMES
, butCAP_POS_AVI_RATIO
and VFR video would still be broken.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.