-
Notifications
You must be signed in to change notification settings - Fork 5.8k
cudacodec::VideoReader
FORCC update with main #23540
#3488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cudacodec::VideoReader
FORCC update with main #23540
#3488
Conversation
a42b8be
to
461d672
Compare
I think this is failing because the branch containing the dependant PR (opencv/opencv#23540) has a different name (add_CAP_PROP_CODEC_FOURCC). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cudacodec::VideoReader
- update inline with opencv/23540cudacodec::VideoReader
FORCC update with main #23540
I tested both branches together locally. Ubuntu 18.04, CUDA 10.2 crashes tests:
|
looks like |
Agreed. I'm wondering if FFmpeg needs the decoder to simply parse the file or not, if so we may be able to modify |
Do you mean simply |
461d672
to
b4c6c25
Compare
I propose to use skip exception like it's done here: https://github.com/opencv/opencv/blob/726ba0210e1592606ccb8843fb092504ca787096/modules/videoio/test/test_ffmpeg.cpp#L37 |
b4c6c25
to
d6c74a1
Compare
reader = cv::cudacodec::createVideoReader(inputFile); | ||
} | ||
catch (const Exception& e) { | ||
ASSERT_TRUE(relativeFilePath == "highgui/video/sample_322x242_15frames.yuv420p.libaom-av1.mp4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose:
if (relativeFilePath == "highgui/video/sample_322x242_15frames.yuv420p.libaom-av1.mp4")
throw SkipTestException("AV1 decoding not supported in this version of FFmpeg - SKIP");
else
throw e;
It's more informative for debugging in case of real exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have paid more attention to the error
[ERROR:[email protected]] global video_decoder.cpp:127 create Video source is not supported by hardware video decoder.
FFmpeg is failing to parse the file but VideoReader
is falling back to CuvidVideoSource
which is able to parse the file. Then its failing because your GPU doesn't support AV1 decoding meaning the new error message in the test is wrong.
Because the exceptions from the decoder are caught and logged it is difficult without modification to assess what the exact cause of the failure is, hence the additional logging of the above message and the general exception which is thrown from the main thread
error: (-2:Unspecified error) Parsing/Decoding video source failed, check GPU memory is available and GPU supports hardware decoding.
Should I at the very least modify the skip test exception to output the above instead of
"AV1 decoding not supported in this version of FFmpeg - SKIP"
?
Going forward I could modify the decoder to internally log that the codec (or other parameters) are not supported by the Nvidia hardware decoder making this information available at test time, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have added (seeing opencv/opencv#23540 (comment)) that the error is also thrown after construction. This will be rectified so that the exception is thrown in by the constructor once #3486 (itself a direct result of similar discussions like this we've had in the past) is merged.
d6c74a1
to
b12dfa6
Compare
@cudawarped I merged your PR with awaiting of CUDA codec initialization and rebased the PR on top of it. The issue is still there:
System information: Ubuntu 18.04, CUDA 10.2. CMake details:
|
@asmorkalov That's a different error. The first error is now emited from the constructor and caught in the test. I'm investigating the second one now I just have to find a 10 series GPU first. |
I' working on incomming 4.8.0 release now and need to rebuild ffmpeg wrapper for Windows. I propose to disable the test case for now and merge both patches in main and contrib and then propose bug fix to contrib only. Also I'll debug it on my side too. |
b12dfa6
to
72080b8
Compare
I've disabled the following files for the
Intrestingly on my GTX 1060 in windows
|
All test cases besides libaom-av1 works on my 1080. Details on versions:
|
Cuda configuration reported by test:
|
Are you sure from the test output above, repeated below
On my GTX 1060 it returns with an empty frame instead of throwing an exception. |
@cudawarped I merged the minimal set of tests. Let's debug the remaining cases and resolve found issues one-by-one. |
Update
cudacodec::VideoReader
to use codec fourcc.Dependant on opencv/opencv#23540
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.