Docker Jellyfin HW accelarated transcoding in Raspberry pi

  • Hi...

    I'm trying to deploy jellyfin docker container to support gpu hw transcoding in Raspberry. Following jellyfin/linuxserver.io guidelines it's necessary to mount OpenMax libraries (/opt/vc/lib) inside the container to make it working and here it's where it's failing due to a linking error. When I execute the following command to create the container:


    Code
    1. docker run -d --name jellyfin --volume /storage/docker/jellyfin:/config --volume /opt/vc/lib:/opt/vc/lib -p 8096:8096 --device=/dev/vchiq:/dev/vchiq --restart=unless-stopped linuxserver/jellyfin


    Jellyfin container logs report the following error not being able to start the app web server:

    Code
    1. [cont-init.d] 40-gid-video: executing...
    2. [jellyfin-init] Pi Libs detected loading
    3. /sbin/ldconfig.real: Can't link /opt/vc/lib/libfdt.so.1 to libfdt.so
    4. [cont-init.d] 40-gid-video: exited 0.
    5. [cont-init.d] 99-custom-scripts: executing...
    6. [cont-init.d] 99-custom-scripts: exited 267.
    7. [cont-init.d] done.
    8. [services.d] starting services
    9. [services.d] done.

    Does anybody know how to fix it?.


    Regards,

  • Rpi 4 hw transcode support was just added to that image and since none of the team members have an rpi 4 available for that purpose, we worked with an end user who did testing and troubleshooting for us (developing blind is not an easy task).


    Do you mind posting an issue on our github so we can properly track it?


    GitHub - linuxserver/docker-jellyfin

  • wondering if it is enough to just compile ffmpeg with the needed options ?

    same problem like at tvheadend (not sure this was fixed for the LS.io dockers)

  • After taking a look at docker-jellyfin project, it seems that the libraries appearing in /opt/vc/lib, mounted as volumen inside the container, are preloaded:

    Code
    1. # openmax lib loading
    2. if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
    3. echo "[jellyfin-init] Pi Libs detected loading"
    4. echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
    5. ldconfig
    6. fi


    The problem is that this folder in Libreelec is a symlink to /usr/lib, so these openmax libraries are mixed with usual OS staff ones, which maybe is making things go wrong.

    Do you know how any other docker apps solve this in LIbreelec?.

    Regards,

  • Curiously if I mount as volume inside the container exclusively libfdt.so and try to link only this library using ldconfig -l libfdt.so, this works:


    Code
    1. [email protected]:/opt/vc/lib# ldconfig -l libfdt.so
    2. [email protected]:/opt/vc/lib# ls -la
    3. total 29
    4. drwxr-xr-x 2 root root 1024 Jan 20 20:35 .
    5. drwxr-xr-x 3 root root 1024 Jan 20 20:31 ..
    6. -rwxr-xr-x 1 root root 26328 Nov 23 00:46 libfdt.so
    7. lrwxrwxrwx 1 root root 9 Jan 20 20:35 libfdt.so.1 -> libfdt.so

    It's a privilege issue. Container tries to create the simlink libfdt.so.1 -> libfdt.so in host /usr/lib (/opt/vc/lib) without writing privileges for that folder. What would be the correct way of doing in similar docker images in Libreelec? Installing OpenMax libraries directly in the container?.

    Regards,

  • Just to provide an update here, we updated both jellyfin and emby addons in the linuxserver repo. They now both support omx hw transcode.


    Go into the addon settings and toggle openmax. When the container is recreated, necessary devices and drivers will be mapped in.


    One gotcha though, neither supports hw decode. They only do hw encode. According to jellyfin documentation, that is an upstream limitation: Hardware Acceleration | Documentation - Jellyfin Project


    I also tested v4l2 (everyone says it's the future). It is detected and used by both emby and jellyfin (again, only for encode) but unfortunately the image has a green filter over it. No idea why, so we didn't enable that in the addon yet. Let me know if you have any idea what causes it and/or how to fix it.