-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Feature request: enable/integrate rockchip hwaccel support #34
Comments
We'd like to keep in line with upstream ffmpeg as much as possible. Do you know if ffmpeg 4.2 or newer has this enabled? |
It seems that support for rockchip-acceleration was added in ffmpeg-3 (and continues to be there). It is by default not enabled since it needs the mpp library:
|
Looking at their repo I don't see a license. We cannot redistribute builds without compatible licenses... please investigate the licensing of their code and report back :) |
The debian control file and the headers say Apache 2.0 (which is probably why ffmpeg requires to be built with
Just did a succesful buidl test with the MPP library from their |
I think you can try and make a PR yourself, this is probably the file you need to modify: https://github.com/jellyfin/jellyfin-ffmpeg/blob/jellyfin/docker-build.sh |
I am also interested in having rockchip hwaccel, specifically for the Helios64. I've noticed that the mpp repo Is this a problem for redistribution? |
I think it's still official. It has been moved to a personal repo of a Rockchip employee. |
Any news on this one ? I am also very insterested in having hwaccel enabled for jellyfin upstream. |
Not from me unfortunatley: I moved from a Rockchip back to Intel |
Does anyone know what actually needs to be done to enable this? If I understand correctly:
|
You are free to do it. But note that ffmpeg only has rockchip’s hardware decoder, which means transcoding speed will still bottlenecked by software scaling and software encoding. |
@nyanmisaka absolutely. That is why I personnaly moved to x86 platform whith much much better performance. |
That makes sense, I think this will have a reasonable benefit on rockchip servers. Does my todo list make sense? If so, how would I get started with packaging rockchip-mpp in the jellyfin repo? |
Sure, make sense. |
At least, the Armbian edge kernel for helios64 has hantro-vpu encoder/decoder and rockchip_vdec support. |
Another option might be the vaapi v4l2-request backend https://github.com/bootlin/libva-v4l2-request (this repository is inactive but there are newer low activity forks) |
I think this is a good idea because it moves away from the typical: "Oh you need an intel/amd processor with integrated graphics to support transcoding" statement. And its another thing which makes jellyfin different from the rest (emby, plex). |
The I mainly use the Jellyfin Docker container. Any good way that I can replace that with a self-built jellyfin-ffmpeg that has rkmpp enabled - and then actually use it in Jellyfin itself? |
The fact is that rkmpp hwaccel in ffmpeg is outdated to support rk35xx chips, and it doesn’t support encoding. Nothing would work unless someone rewrite it from scratch. |
If you just want to use HW accel in jellyfin, my project should be enough https://github.com/jjm2473/ffmpeg-rk/wiki Note: HW decodeing/encoding works, RGA scale works. No tone mapping supported. Tested on rk3568/rk3588. Update 2023-11-24: now supports HW mjpeg decoding; rga_scale filter supports setting output pix format, supports yuvj42xp/yuyv422/rgb as input . |
@jjm2473 I think mpp kernel driver is a rockchip vendor kernel only thing. My understanding is that rockchip has no plan to port mpp drivers upstream. |
@prahal No, the MPP drivers not upstreamed. But mainline linux can be patch to supports MPP. Not only MPP drivers, but also RGA drivers shoubld be supported, because some SoC has not enough performance to encoding 4K/30FPS video (for example RK3568, up to 1080p/30FPS encoding), must use RGA to scale video. I have no experience with v4l. The ffmpeg-rk project is only implemented by referring to RK's old ffmpeg and MPP/RGA development documents, so it depends on related kernel functions. |
@jjm2473 https://aur.archlinux.org/packages/rockchip-mpp?all_reqs=1 tells tells MPP only works with rockchip BSP kernel ( latest 5.10 in a develop branch). Where could I get these MPP and RGA drivers against linux 6.4-rcN? To me, the issue is not that MPP and RGA are not upstream yet. But that rockchip loos like it has no plan to devote developer time to upstream it. This looks like an internal project for their custom kernel that they develop on a public github to help their customers customize products based on their kernel. |
I hate to quote a meme but... That's the neat part, you don't! There has not been a single commit to their kernel repo in forever - let alone a new branch to support anything newer than 5.10.x In fact, here's my current one on a RK3588 (FriendlyElec NanoPi R6s)
This corresponds to https://github.com/rockchip-linux/kernel/tree/develop-5.10 |
Then should never be part of a linux distribution as not security supported. I wonder why Archlinux ships userspace mpp-git https://aur.archlinux.org/packages/mpp-git. Sadly v4lrequests development is somewhat stalled especially on the vaapi side (there is a ffmpeg v4lrequests specific patch which is more up to date but not upstreamed either). I do not know about scaling with v4lrequests. |
@prahal Check these drivers and patches: Maybe someone can port to linux 6.x? |
@jjm2473 if it was that easy I hope rockchip would have paid their developers to do the upstreaming. No definitely MPP is for a rockchip fork of the linux kernel. This is not a Linux kernel, it is only based on it. I am after an hw acceleration stack for Armbian current and edge, that is Linux per see. So MPP is of no help. Sadly v4l-request upstreaming seems to have stalled. I will try to contribute to it if it is not dead yet. I am especially fond of the v4l-request to vaapi bridge that could enable to share code with the intel vaapi support that is already in (sadly this bridge is the part that looks completely dead development-wise). |
Well Friendlyelec just updated their Rockchip branch to 6.1 |
Im kind of a novice with Linux. I was excited to see that HW accel on RK3588 boards was becoming a thing. I was referred here to check out how to run this. Im open to test things out if needed. When I run
This told me, this could be compatible with my device. I ran the docker command with sudo. and I believe this is working properly. I made sure to select "Rockchip MPP (RKMPP)" under Dashboard -> Playback -> Transcoding. I kept "h264, HEVC 10bit, vp9 10bit" enabled by default. I made sure to turn on "Enable HW encoding, allow encoding in HEVC format, allow encoding in AV1 format, and Enable Tone Mapping" I left everything else the same. after I run htop, I can see that cpu usage is lower than it was before, but other than that idk what else I should be testing to confirm it is working. |
RK3588 can only decode AV1 and encode H264 & HEVC |
Got it. So even though the options are there, some options aren't supported. What else can I do to test that HWA is working on my machine? |
As long as you can find
|
@nyanmisaka I finally got my hands on the RK3588 (Rock 5B) and I got everything working besides Tone-Mapping. For some reason I get 1-2 fps (if I even get it to play a few secs). I was using armbian legacy with this Mali OpenCL blob EDIT: This was a result of using a power supply with only 9v 2a, switching to 20v 3a fixed it. |
Just want to say this is amazing work 🚀
man. 29. jan. 2024 08.50 skrev Nyanmisaka ***@***.***>:
… Closed #34 <#34> as
completed via #318 <#318>.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA7FVLADOTB3WXDSV43OBTYQ5IFFAVCNFSM4MGPHSRKU5DIOJSWCZC7NNSXTWQAEJEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW4OZRGE3DEMZXHE3TMNZY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Good job! 👍 🥇 |
From which Jellyfin version on can we expect to use the main docker image? As far as I can tell the WebUI branch hasn’t been updated yet to have the option available but I could be wrong |
JF 10.9 Merge order: |
Transcoding HDR movies with tone mapping doesn't seem to work with the latest Rockchip 6.1.43 kernel. I have a test install of Armbian with the new kernel and transcoding with Jellyfin works with SDR movies. Everything else should be identical to my normal Armbian install with the old 5.10.160 kernel where HDR transcoding works great. I have the latest version of the libmali drivers installed (v1.9-1-b9619b9). |
@Qwertylala1 maybe attach |
Of course, attached here. |
@Qwertylala1 latest driver requires |
Yes, that did it! I tried v1.9-1-2d267b0 from November since I know that I have used that version before without any problems and now transcoding works fine with HDR movies. Thank you! |
the same issue like yours,i'm using orange pi 5 plus,rk3588 @HeyMeco @Qwertylala1 i‘ve’ research this for days,but it still didn't work. i'm using the OS: uname -a video file info: |
@jwsky Dolby Vision metadata is not properly supported by RKMPP. Please open an issue there to let them know. |
Thank you so much for your help @nyanmisaka ,i've opened the issue here in rockchip-linux/mpp/issues |
@nyanmisaka Dolby Vision Tonemapping in general isn't an issue. In this case it's the DoVi Profile 5 based source that's causing problems. It uses a proprietary color space:
@jwsky It would make more sense to use dovi_tool to convert the source file from 5 to 8.1 for maximum compatibility. |
Jellyfin actually supports DV P5 to SDR tone-mapping on platforms other than Rockchip. Just because the metadata cannot be properly imported from MPP into FFmpeg. |
@nyanmisaka Whatever Jellyfin maintainers did (or did not do) in their main repository results in RK3588 not using the VPU anymore. I had to revert to using your image. Could you share how you built it: commands, sources? I'm thinking of poking around it and pulling just the pieces relevant to VPU support from your version. |
@stevenlafl The RKMPP support has been added to Jellyfin 10.9.x, so my test image is no longer needed. I don't quite understand what you are saying. If there are any problems please provide detailed error logs. |
Testing method:
Here's with your image FFmpeg Logs: https://gist.github.com/stevenlafl/2d6380a30aa64d18c0e555b144270058 Here's the new jellyfin image FFmpeg Logs: https://gist.github.com/stevenlafl/729562c22c3c4a370afefc5ae59af3f7 Is there anything else you need me to look at? |
I see the problem now looking at the logs again. Your image seemed to use h264 as the output no matter what setting for the "Encoding format options", and in the production version it actually did try to use AV1/HEVC which were non-accelerated. Apologies, the behavior wasn't enough to indicate a problem and I missed it in the logs. |
@stevenlafl You just need to disable the AV1 encoder In the future we will make this transcoding setup automatic and eliminate these hassle. |
Is there a way to make it automatically fallback to cpu decoding instead of hw accel with profile 5 media? |
It would be really nice if the jellyfin-ffmpeg would support the rockchip hardware acceleration.
For 4.1 there's a maintained ffmpeg-fork here with additional patches it seems: https://github.com/rockchip-linux/ffmpeg/tree/rockchip/release/4.1 but basic rockchip acceleration support was already included via the RK-MPP in ffmpeg-3.
This library is needed to enable support: https://github.com/rockchip-linux/mpp
Communication with the kernel is then through a
/dev/videoN
device if I understood it correctly.The text was updated successfully, but these errors were encountered: