Use cuda filters to support 10-bit videos #853
Draft
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.
This PR is built on top of #831 which provides stand-alone implementation for FilterGraph. To review cuda specific change, navigate to the last commit as the first 2 are identical to #831. I'll keep it as a draft for initial discussion till #831 is hopefully merged.
The changes in the last commit are:
DeviceInterface::initializeFiltersContext()
API which returns device specific FilterGraph initialization settingsSingleStreamDecoder
to call FilterGraph pipeline ifDeviceInterface::initializeFiltersContext()
returned valid description.Basically idea behind this change is the following. Let device interface to perform trivial and performance optimized conversions in the
convertAVFrameToFrameOutput()
method. If device interface can not handle conversion in theconvertAVFrameToFrameOutput()
, it can setup ffmpeg filters pipeline by returning valid description ininitializeFiltersContext()
.I tested the pipeline on 10-bit videos, h264 and h265. However, this setup should be valid for 12-bit videos which I did not try.
Note that this PR does not actually contradict another attempt to add 10-bit support in #790 as using filters is more generic approach and #790 usage of NPP can be considered as optimization for specific cases.
Finally, I would like to pay attention on 2 things:
scale_cuda
does not support format conversion in this ffmpeg version (was added from n5.0)CC: @scotts @NicolasHug @eromomon