Jellyfin is extremely useful software providing home streaming system. I am using it since a while for streaming my old ripped DVD, which I love to watch again and again. Jellyfin is opensource, cross platform as a server and as a client, including client for android and iOS. It is optimising network (in compression to media player using shared network disk), providing very good image quality and not less important – playlist organisation within your library.
If you are interested in more details check out: https://en.wikipedia.org/wiki/Jellyfin
I am using jellyfin inside lxc container, which is very convenient (in case of keeping clean state of my computer) but usage in it comes with few challenges with graphic card hardware acceleration.
Good description on how to deal with such scenarios can be found: https://forum.jellyfin.org/t-unable-to-configure-transcoding-on-jellyfin-running-on-a-proxmox-lxc-container
In summary few steps
Check the device you can use in your /dev/dri directory main operating system. In my example it is /dev/dri/renderD128 (old i915 intel graphics card)
In case of using cgroup2, to your lxc container config file add the following
lxc.cgroup2.devices.allow = c 226:0 rwm
lxc.cgroup2.devices.allow = c 226:128 rwm
lxc.mount.entry = /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=fileIn case of using cgrop (ver1), use the add the following:
lxc.cgroup.devices.allow = c 226:0 rwm
lxc.cgroup.devices.allow = c 226:128 rwm
lxc.mount.entry = /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=fileAlternatively, the last line can be replaced by:
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dirCheck if render group has the same gid on main system and inside the lxc container. 
Now, install in the container needed software, in my case of intel graphics card and debian12 it was:
- curl
- gnupg
- id3v2
- intel-opencl-icd
- intel-media-va-driver
- i965-va-driver
- vainfo
- xvfb
- i915
- xserver-xorg-video-intel
- firmware-linux-free
- firmware-linux-nonfree
Follow the steps to install jellyfin: https://jellyfin.org/docs/general/installation/linux/, with script “curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash” or using extrepo “sudo apt install extrepo
sudo extrepo enable jellyfin” or in debian:
- mkdir -p /etc/apt/keyrings
- curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
- apt update && apt install jellyfin
Add group video and render to your jellyfin user. Also make sure the video belongs to jellyfin user (for simplification, jellyfin can manage those video like deleting it when not needed from GUI).
Check the configuration
/usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva error: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.0.pre1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
also check output of
/usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va: /dev/dri/renderD128 -init_hw_device opencl@va
 
                                                
No Comments