Skip to content

Conversation

@cudawarped
Copy link
Contributor

@cudawarped cudawarped commented Aug 2, 2023

Allow seeking of video source on initialization of cudacodec::VideoReader when new variable VideoReaderInitParams::iFirstFrame != 0.

Dependant on opencv/opencv#24012

Fixes #3541.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@cudawarped
Copy link
Contributor Author

cudawarped commented Aug 4, 2023

[ RUN      ] CUDA_Codec/Seek.Reader/0, where GetParam() = Quadro P2000
unknown file: Failure
C++ exception with description "OpenCV(4.8.0-dev) /home/ci/opencv_contrib/modules/cudacodec/src/video_reader.cpp:198: error: (-215:Assertion failed) skipFrame() in function 'VideoReaderImpl'
" thrown in the test body.
[  FAILED  ] CUDA_Codec/Seek.Reader/0, where GetParam() = Quadro P2000 (217 ms)

@asmorkalov Sorry I forgot to mention that this is dependant on opencv/opencv#24012. In addition I've just realized it won't work on windows so I've added build guards to remove the test until the FFmpeg windows wrapper is updated.

@cudawarped cudawarped force-pushed the cudacodec_videoreader_seek branch from 51085ba to 38e17af Compare August 11, 2023 12:09
@cudawarped cudawarped requested a review from asmorkalov August 11, 2023 13:41
@cudawarped cudawarped force-pushed the cudacodec_videoreader_seek branch 2 times, most recently from ebd474f to 012a920 Compare November 10, 2023 09:25
@cudawarped cudawarped force-pushed the cudacodec_videoreader_seek branch from 012a920 to 08172eb Compare November 10, 2023 09:26
@cudawarped
Copy link
Contributor Author

[----------] 1 test from CUDA_Codec/Seek
[ RUN ] CUDA_Codec/Seek.Reader/0, where GetParam() = Quadro P2000
/home/ci/opencv_contrib/modules/cudacodec/test/test_video.cpp:638: Failure
Expected equality of these values:
iFrame
Which is: 19
static_cast(firstFrameIdx)
Which is: 18
[ FAILED ] CUDA_Codec/Seek.Reader/0, where GetParam() = Quadro P2000 (98 ms)
[----------] 1 test from CUDA_Codec/Seek (98 ms total)

@asmorkalov Fixed.

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov merged commit 7b97851 into opencv:4.x Nov 16, 2023
@asmorkalov asmorkalov self-assigned this Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cudacodec::VideoReader::get returns incorect frame index for CAP_PROP_POS_FRAMES

2 participants