Info Post: Rockchip MPP with Jellyfin / FFMPEG is working and is great

The Jellyfin effort now lead to this really good implementation of mpp in ffmpeg:

The wiki of this project covers everything regarding compilation, decoding, encoding, video filters and transcoding with ffmpeg.

For a HW accelerated Jellyfin there is a docker run command:

docker run -d \
 --name jellyfin \
 --privileged \
 --net=host \
 --restart=unless-stopped \
 --volume /path/to/config:/config \
 --volume /path/to/cache:/cache \
 --volume /path/to/media:/media \
 `for dev in dri dma_heap mali0 rga mpp_service \
    iep mpp-service vpu_service vpu-service \
    hevc_service hevc-service rkvdec rkvenc vepu h265e ; do \
   [ -e "/dev/$dev" ] && echo " --device /dev/$dev"; \
  done` \
 nyanmisaka/jellyfin:latest-rockchip
2 Likes

I tested this out on my Orange Pi 5 Plus and have been very impressed so far :crossed_fingers:. Orange Pi 5 Plus and other rockchip devices might finally be a SBC worth running a small media server from :raised_hands:

It’ll hopefully make its way out in the next stable Jellyfin release (See PR) but for others looking to get this running in the interim I had success with a simple docker setup and systemd.

Simple docker jellyfin systemd setup

If you have an existing jellyfin instance, disable it with systemctl.

sudo systemctl stop jellyfin
sudo systemctl disable jellyfin

Ensure you have docker installed, if not, it can be installed with dietpi-software.

  1. Create a startup script at /usr/local/bin/start-jellyfin-docker.sh with the contents
#!/bin/bash
CONTAINER_NAME="jellyfin"

# Check if the container is already running
if [ -n "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then
    echo "Container ${CONTAINER_NAME} is already running."
    exit 0
fi

# Check if the container exists (but stopped)
if [ -n "$(docker ps -aq -f name=${CONTAINER_NAME})" ]; then
    # Start the existing container
    docker start ${CONTAINER_NAME}
else
    # Run a new container
    /usr/bin/docker run -d \
      --name ${CONTAINER_NAME} \
      --privileged \
      --net=host \
      --restart=unless-stopped \
      --volume /path/to/config:/config \
      --volume /path/to/cache:/cache \
      --volume /path/to/media:/media \
      $(for dev in dri dma_heap mali0 rga mpp_service \
         iep mpp-service vpu_service vpu-service \
         hevc_service hevc-service rkvdec rkvenc vepu h265e ; do \
        [ -e "/dev/$dev" ] && echo " --device /dev/$dev"; \
       done) \
      nyanmisaka/jellyfin:latest-rockchip
fi
  1. Make sure the startup script is executable with sudo chmod +x /usr/local/bin/start-jellyfin-docker.sh
  2. In the script update the --volume arguments to the correct paths of your config, cache and media
  3. Create a /etc/systemd/system/jellyfin-docker.service file with the contents
[Unit]
Description=Jellyfin via Docker with Rockchip HWA
Wants=network.target
After=docker.service
Requires=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/start-jellyfin-docker.sh
ExecStop=/usr/bin/docker stop jellyfin

[Install]
WantedBy=multi-user.target
  1. Then run sudo systemctl enable jellyfin-docker.service and sudo systemctl start jellyfin-docker.service and check if it’s accessible at 127.0.0.1:8096

Note: This setup will serve it at the local port of 8096 (dietpi-software’s installation sets it up at port 8097). If comfortable with docker you can change the exposed ports it’s served from.

When this is available in a stable Jellyfin release you’ll want to disable the service, remove these files above and install stable jellyfin via dietpi-software or your usual approach.

Actually the RK3588 especially is really capable as a media server. Being able to to do >real time HDR10 HW Tone mapping for 4K HDR content too (bc it has RGA3 while all other RK’s don’t) and 16x 1080p encodes/decodes at the same time.

I have tried to get the hardware acceleration get working, but I also get some error from ffmpeg.

Current System:

  • dietpi 9.4
  • official docker container from jellyfin 10.9.1
  • docker command from the jellyfin doc pages [docker command]
  • installed libmali (sudo apt install ./libmali-valhall-g610-g13p0-gbm_1.9-1_arm64.deb)
  • check the files in the device folder (dma_heap, mali0, mpp_service, rga exist)
  • check the opencl out put in the docker container (see attached file)

So in my opion everything looks good, but it crashed with different ffmpeg errors showing in the logs.

Have I something forgot or some advice what could be wrong?

Thanks and regards

FFmpeg.Transcode-2024-05-16_12-13-39_0778c9b4e3bd3ef78827524479a20808_e251d3fb.log (5.0 KB)
FFmpeg.Transcode-2024-05-16_12-15-18_a45b3429b2b3c7ca6bb0e3777fe8c3bf_c956914a.log (5.4 KB)