how to set up jellyfin with podman and selinux and an intel gpu (a380) for transcoding?
I try to follow the docs but somehow it doesn’t work as expected. How does your compose file look and what to choose in the settings?
My current setup: (Not working)
<span style="color:#323232;">services:
</span><span style="color:#323232;"> # original source: https://jellyfin.org/docs/general/installation/container/
</span><span style="color:#323232;"> jellyfin:
</span><span style="color:#323232;"> image: docker.io/jellyfin/jellyfin:latest
</span><span style="color:#323232;"> container_name: jellyfin
</span><span style="color:#323232;"> environment:
</span><span style="color:#323232;"> - PUID=1000
</span><span style="color:#323232;"> - PGID=1000
</span><span style="color:#323232;"> - TZ=Europe/Berlin
</span><span style="color:#323232;"> - JELLYFIN_PublishedServerUrl=https://my.url
</span><span style="color:#323232;"> volumes:
</span><span style="color:#323232;"> - ./config:/config:Z
</span><span style="color:#323232;"> - ./cache:/cache:Z
</span><span style="color:#323232;"> - ./media:/media:rw
</span><span style="color:#323232;"> ports:
</span><span style="color:#323232;"> - 8096:8096
</span><span style="color:#323232;"># no need for https since reverse proxy and no local discovery
</span><span style="color:#323232;"> restart: always
</span><span style="color:#323232;"> device:
</span><span style="color:#323232;"> - /dev/dri/:/dev/dri/:Z
</span><span style="color:#323232;"> - /dev/dri/renderD128:/dev/dri/renderD128:Z
</span><span style="color:#323232;"> group-add:
</span><span style="color:#323232;"> - 105
</span><span style="color:#323232;"> privileged: true
</span>
I do not want a privileged container but I’m experimenting.
- VAAPI is selected
- VA-API device: is set to
/dev/dri/renderD128
- enable hardware decoding for : H264, HEVC, HEVC 10bit and VP9 10 bit
- enable hardware encoding
- allow encoding in HEVC
to get the group I ran getent group render | cut -d: -f3
on the host which returned 105
.
<span style="color:#323232;">$ podman exec -it jellyfin /usr/lib/jellyfin-ffmpeg/vainfo
</span><span style="color:#323232;">Trying display: drm
</span><span style="color:#323232;">libva info: VA-API version 1.21.0
</span><span style="color:#323232;">libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
</span><span style="color:#323232;">libva info: Found init function __vaDriverInit_1_21
</span><span style="color:#323232;">libva info: va_openDriver() returns 0
</span><span style="color:#323232;">vainfo: VA-API version: 1.21 (libva 2.21.0)
</span><span style="color:#323232;">vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864)
</span><span style="color:#323232;">vainfo: Supported profile and entrypoints
</span>
This command returns VA-API does that mean I can only (or I should) select this method? Or is QSV also possible? What’s better?
<span style="color:#323232;">podman exec -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va -init_hw_device opencl@va
</span><span style="color:#323232;">ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
</span><span style="color:#323232;"> built with gcc 12 (Debian 12.2.0-14)
</span><span style="color:#323232;"> configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
</span><span style="color:#323232;"> libavutil 58. 2.100 / 58. 2.100
</span><span style="color:#323232;"> libavcodec 60. 3.100 / 60. 3.100
</span><span style="color:#323232;"> libavformat 60. 3.100 / 60. 3.100
</span><span style="color:#323232;"> libavdevice 60. 1.100 / 60. 1.100
</span><span style="color:#323232;"> libavfilter 9. 3.100 / 9. 3.100
</span><span style="color:#323232;"> libswscale 7. 1.100 / 7. 1.100
</span><span style="color:#323232;"> libswresample 4. 10.100 / 4. 10.100
</span><span style="color:#323232;"> libpostproc 57. 1.100 / 57. 1.100
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] Trying to use DRM render node for device 0.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] libva: VA-API version 1.21.0
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] libva: Found init function __vaDriverInit_1_21
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] libva: va_openDriver() returns 0
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] Initialised VAAPI connection: version 1.21
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07507480] Driver not found in known nonstandard list, using standard behaviour.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55ef07538b40] Failed to get number of OpenCL platforms: -1001.
</span><span style="color:#323232;">Device creation failed: -19.
</span><span style="color:#323232;">Failed to set value 'opencl@va' for option 'init_hw_device': No such device
</span><span style="color:#323232;">Error parsing global options: No such device
</span>
within the container:
<span style="color:#323232;"># ls -l /dev/dri
</span><span style="color:#323232;">total 0
</span><span style="color:#323232;">crw-rw----+ 1 nobody nogroup 226, 1 May 17 13:22 card1
</span><span style="color:#323232;">crw-rw-rw-. 1 nobody nogroup 226, 128 May 17 13:22 renderD128
</span><span style="color:#323232;"># whoami
</span><span style="color:#323232;">root
</span><span style="color:#323232;">#
</span>
<span style="color:#323232;">$ getsebool container_use_dri_devices
</span><span style="color:#323232;">container_use_dri_devices --> on
</span>
<span style="color:#323232;">$ sudo lshw -c video | grep driver
</span><span style="color:#323232;"> configuration: driver=i915 latency=0
</span>
if privileged is set to false:
<span style="color:#323232;">$ podman exec -u root -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device Device creation failed: -2.
</span><span style="color:#323232;">Failed to set value 'drm=dr:/dev/dri/renderD128' for option 'init_hw_device': No such file or directory
</span><span style="color:#323232;">Error parsing global options: No such file or directory
</span>
if privileged is true.
<span style="color:#323232;">$ podman exec -u root -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device drm=dr:/dev/dri/renderD128 -init_hw_device vaapi=va@dr
</span><span style="color:#323232;">ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
</span><span style="color:#323232;"> built with gcc 12 (Debian 12.2.0-14)
</span><span style="color:#323232;"> configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
</span><span style="color:#323232;"> libavutil 58. 2.100 / 58. 2.100
</span><span style="color:#323232;"> libavcodec 60. 3.100 / 60. 3.100
</span><span style="color:#323232;"> libavformat 60. 3.100 / 60. 3.100
</span><span style="color:#323232;"> libavdevice 60. 1.100 / 60. 1.100
</span><span style="color:#323232;"> libavfilter 9. 3.100 / 9. 3.100
</span><span style="color:#323232;"> libswscale 7. 1.100 / 7. 1.100
</span><span style="color:#323232;"> libswresample 4. 10.100 / 4. 10.100
</span><span style="color:#323232;"> libpostproc 57. 1.100 / 57. 1.100
</span><span style="color:#323232;">Splitting the commandline.
</span><span style="color:#323232;">Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
</span><span style="color:#323232;">Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'drm=dr:/dev/dri/renderD128'.
</span><span style="color:#323232;">Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vaapi=va@dr'.
</span><span style="color:#323232;">Finished splitting the commandline.
</span><span style="color:#323232;">Parsing a group of options: global .
</span><span style="color:#323232;">Applying option v (set logging level) with argument debug.
</span><span style="color:#323232;">Applying option init_hw_device (initialise hardware device) with argument drm=dr:/dev/dri/renderD128.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b480] Opened DRM device /dev/dri/renderD128: driver i915 version 1.6.0.
</span><span style="color:#323232;">Applying option init_hw_device (initialise hardware device) with argument vaapi=va@dr.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] libva: VA-API version 1.21.0
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] libva: Found init function __vaDriverInit_1_21
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] libva: va_openDriver() returns 0
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Initialised VAAPI connection: version 1.21
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x41524742 -> bgra.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x42475241 -> argb.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x41424752 -> rgba.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x52474241 -> abgr.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x58524742 -> bgr0.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x42475258 -> 0rgb.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x58424752 -> rgb0.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x52474258 -> 0bgr.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30335241 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30334241 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30335258 -> x2rgb10le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30334258 -> x2bgr10le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x36314752 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x56555941 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x56555958 -> vuyx.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30303859 -> gray.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x3231564e -> nv12.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x3132564e -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x32595559 -> yuyv422.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x59565955 -> uyvy422.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x32315659 -> yuv420p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30323449 -> yuv420p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x50313134 -> yuv411p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x48323234 -> yuv422p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x56323234 -> yuv440p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x50343434 -> yuv444p.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x33434d49 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30313050 -> p010le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x32313050 -> p012le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x36313050 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30313259 -> y210le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x32313259 -> y212le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x36313259 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x30313459 -> xv30le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x32313459 -> xv36le.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x36313459 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x50424752 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Format 0x50524742 -> unknown.
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
</span><span style="color:#323232;">[AVHWDeviceContext @ 0x55e56e90b8c0] Driver not found in known nonstandard list, using standard behaviour.
</span><span style="color:#323232;">Successfully parsed a group of options.
</span><span style="color:#323232;">Hyper fast Audio and Video encoder
</span><span style="color:#323232;">usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
</span>
Add comment