-
Notifications
You must be signed in to change notification settings - Fork 3k
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
video: hwdec: fallback to hw_ingmtfmt match if no hw_device matches #15586
Conversation
Download the artifacts for this pull request: |
Why is rkmpp still relevant? There is upstream support for the hardware via the v4l2request API and even though that also isn't in upstream ffmpeg, if you're prepared to use an ffmpeg fork, why not use a different one? |
v4l2 requests support is very limited, it is not making use of dual cores of h264/hevc, so speed is crippled, vp9 is non-existent, there no afbc support to make use of high bitrate decoding in neither of av1/h26x. So we want to use requests, but the thing delivered is just for playing 1080p big buck bunny. ah: also there is no 10bit hdr support as well, forgot to mention |
@Kwiboo Do you have any perspective on that? |
may be a cleaner approach would be to implement the workflow with AV_CODEC_HW_CONFIG_METHOD_INTERNAL when a decoder declares this, the client which uses the decoder actually does nothing, no hwdevice or frames context creation, everything is handled by the decoder internally. rkmpp is using this method, also cuvid decoder. I think for mpv it is the most flexible way.. |
Use of rkmpp on vendor kernel allow use of multi core and 8K decoding on newer Rockchip SoCs (RK35xx). There was only an initial attempt by Collabora at adding support for rkvdec2 (the main hw decoder used in RK35xx) in mainline a few months back. To my knowledge Collbora has intention to resume/continuing to work on upstream rkvdec2 support in 2025. Also my work on ffmpeg v4l2-request and rkvdec1 (h264 hi10 and hevc) got put on temporary hold for a few months due to my day-job, leaving very little time for hobby projects. Hoping to once again have more time early in the new year to complete all pending series.
Making use of the |
d25736a
to
d845c5c
Compare
something like this may be helpfull: d845c5c can be even prettier instead using magic |
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.
We already have a METHOD_INTERNAL
block (it's an else
block below the if
you modified) so you will need to rationalise that. Why does it not work in the first place? Seems like the fix here is to make the METHOD_INTERNAL
code path work for the rkmpp decoder.
sorry no thats just me overlooking at the code, i will send an update. happy new year btw. |
Look like it is handled in an @hbiyik does mpv (and other players/decoders/encoders) work with just the |
The addition of
|
Yeah 2 wrongs dont make 1 right, initially rkmpp was either Since hwdecs in mpv is only detected as internal when the codec is not But i am scratching my head around this line of code. It only flags the hwdec as I have checked the blame of those commits, actually it is dated back to 2017, so i am concerned that there would be an mpv workflow there. With those being said. I would propose the following.
And that above is an intrusive change. With current state, mpp will not be tagged as |
since there is no other feedback how to achieve this properly i am closing the PR. |
You have to have reasonable expectations on when anyone will have time to respond on any particular issue or PR. In principle it makes sense to have a fallback path for hwaccels that support As for what actually exists in the world, the only upstream hwaccel that uses It will be some time before I can sit down and take a detailed look at the best way to implement this kind of fallback, but I do believe it would generally look like what you outlined. |
with the introduction of looking up hwcodecs the
AV_HWDEVICE_TYPE
support forhwdec=rkmpp
is broken.Rkmpp is a downstream bsp specific acceleration mechanism for rockchip based boards, by design it is nothing different than an DRM_PRIME based ffmpeg accelerator, and it handles hw_device_context by itself without any client opeartion if not allrady hw_context is not applied.
ffmpeg-rkmpp is being used by jellyfin intensively, and has a lot of users around it but can not be merged to mainline ffmpeg at the time being, but mpv was being used together with thats to mpv's modular design.
without this commit
--hwdec=rkmpp
will fail simply due to the fact thatAV_HWDEVICE_TYPE_RKMPP
is a downstream definition and can not be a part of mpv in a maintainable way.This commit allows to fallback to matching algo to an hwdec where only hw_imgfmt matches.
I would appreciate if this commit gets merged, but i would also understand if you wouldn't like to as well.
PS: i noticed that i have made a typo in commit message, i can fix it gets ok to merge.