Introduction
As promised in my previous post, today I will be sharing about how I set up Jellyfin with hardware acceleration on my Orange Pi 5 Plus server.
Recently I migrated Jellyfin along with couple of other services on my new Orange Pi 5 Plus server. The Orange Pi 5 Plus has a Rockchip RK3558 SoC which has with integrated ARM Mali-G610 GPU which is compatible with OpenGL ES1.1/2.0/3.2, OpenCL 2.2 and Vulkan 1.2. This helps in offloading the video decoding and encoding tasks from the CPU to the GPU which results in better performance and lower power consumption.
In addition to common codecs, the RK3558 chip from Orange Pi 5 Plus is also able to support 10-bit H.264 (High10) and AV1 decoding, and has an H.264/HEVC encoding speed of up to 1080p@480fps or 4k@120fps which is quite impressive.
With that said, let’s get started with the setup.
Prerequisites
Before we start, here is what I did as the prerequisites to enable hardware acceleration for Jellyfin.
Install Ubuntu 22.04 (Jammy)
I installed Ubuntu 22.04 (Jammy) headless on my Orange Pi 5 Plus. You can download the image from the Orange Pi 5 Plus website ↗️ and flash it on a microSD card or a NVME drive.
The reason for choosing Ubuntu 22.04 is that it has good support for Rockchip SoCs and the drivers required for hardware acceleration are available easily.
One thing to take a note of is that the Kernel version of 6.1 or 5.10 LTS is required for the Mali G610 GPU to work. You can check the kernel version by running the following command.
Note for ubuntu-rockchip users
If you are using the Ubuntu 24.04 image from Joshua Reik ubuntu-rockchip ↗️ repository, then you can skip the below steps as the image comes with the required drivers pre-installed.
Skip directly to the Setting up Jellyfin section.
Install and enable the GPU drivers
We will add two repositories to install the GPU drivers. The first repository is to download the Mali G610 firmware and the second one to get the rockchip multimedia configuration.
Next, update the package list and install the required packages.
Optionally you can then remove the repositories.
Now to support HDR tone-mapping we will install OpenCL runtime (libmali) on our system. We will find this here ↗️. Copy these commands to your terminal to start installing the OpenCL runtime.
Finally we will just verify that our devices are available which are required for hardware acceleration.
If you see an output like below, then you are good to go.
With these prerequisites done, we can now move on to setting up Jellyfin.
Setting up Jellyfin
Jellyfin have brought in support for hardware acceleration on Rockchip from version 10.9.0. So we will install the version 10.9.0 or later. At the time of writing this post, the latest version is 10.9.7.
I am using Docker to run Jellyfin and I have a docker-compose file for the same. Here is the docker-compose file I am using.
It is a standard docker-compose file but I will highlight few important parts here. First thing is that we need escalate the container’s privileges to access the GPU devices. We do this by adding the security_opt
option. This is better than using privileged: true
as it only gives access to /sys
and /proc
directories.
Next we add the GPU devices to the container using the devices
option. This will allow the container to access the GPU devices.
Additionally we adding the video
group to the container using the group_add
option. This is required to access the video devices. You can check what is the id of the video group by running the following command.
With this docker-compose file, you can now start Jellyfin by running the following command.
Once the container is up, you can access Jellyfin on http://<your-ip>:8096
and start setting up your media library.
To verify that the OpenCL runtime is working correctly inside the docker container, you can run this command.
If you see an output like this, then the OpenCL runtime is working correctly.
If you see any errors then you might have missed something in the prerequisites. Go back and check the prerequisites again. If you are still facing issues, feel free to ask in the comments.
Enable Hardware Acceleration in Jellyfin
Now this is the final but very important step (side story, I spend a good 30 minutes only to realize that I missed this step, so don’t be like me 😅).
To enable hardware acceleration in Jellyfin, go to Dashboard
-> Playback
-> Transcoding
. Under Hardware acceleration choose Rockchip MPP (RKMPP)
and enable hardware decoding for H.264
, HVEC
, HVEC 10 bit
and AV1
codecs.
If your OpenCL runtime is working correctly, then you can also select the Enable Tone mapping
option to enable HDR tone mapping.
Go below and click on Save
to save the settings and you are done.
Moment of Truth
Those were some pretty good amount of steps that we had to do right, so let’s see if it was worth it. To test it I played a 4K HVEC HDR video and here are the results.
The above image shows the Jellyfin video player showing the playback stats and the video being transcoded with ffmpeg.
Let’s look at the CPU usage when the video is being played.
As you can see the average CPU usage is around 10-11% which is quite impressive for a 4K HDR video. This is because the video decoding and encoding tasks are offloaded to the GPU. Here are the stats from the RGA engine.
Now if you are wondering if this is actually any good, then here’s the stats for the same video being played without hardware acceleration.
As you see, the CPU usage hovers around 75-80% where sometimes it even goes to 95% which is quite high given its just a single stream that is being transcoded. So yeah, hardware acceleration is definitely worth it.
With the current setup, I was comfortably able to play 2 4K HDR videos simultaneously without any issues. So I am quite happy with the performance.
Conclusion
That’s it for this post. I hope this guide helps you in setting up Jellyfin with hardware acceleration on your Orange Pi 5 Plus server. If you have any questions or need help, feel free to ask in the comments.
You can also reach out to me on Twitter ↗️ / Reddit ↗️ / Mastodon ↗️.
Until next time, happy blazingly fast streaming! 🍿🎥🎶