Jellyfin Forum
SOLVED: hardware encoding fails - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: hardware encoding fails (/t-solved-hardware-encoding-fails)

Pages: 1 2 3


hardware encoding fails - XperiaPlay1998 - 2024-05-06

I'm Running my Jellyfin server on Truenas scale nas. 
  • Truenas version: Dragonfish-24.04.0
  • Jellyfin version: 10.8.13

Passing the gpu (Intel Arc A310) trough is working since when i enter '/usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128' i get the following back

Code:
Trying display: drm
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.4.0 (05e4d0d)
vainfo: Supported profile and entrypoints
      VAProfileNone                  : VAEntrypointVideoProc
      VAProfileNone                  : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointEncSliceLP
      VAProfileH264High              : VAEntrypointVLD
      VAProfileH264High              : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline          : VAEntrypointVLD
      VAProfileJPEGBaseline          : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileHEVCMain              : VAEntrypointVLD
      VAProfileHEVCMain              : VAEntrypointEncSliceLP
      VAProfileHEVCMain10            : VAEntrypointVLD
      VAProfileHEVCMain10            : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileHEVCMain12            : VAEntrypointVLD
      VAProfileHEVCMain422_10        : VAEntrypointVLD
      VAProfileHEVCMain422_10        : VAEntrypointEncSliceLP
      VAProfileHEVCMain422_12        : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10        : VAEntrypointVLD
      VAProfileHEVCMain444_10        : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12        : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444        : VAEntrypointVLD
      VAProfileHEVCSccMain444        : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP

and '/usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=vaConfused-facedev/dri/renderD128 -init_hw_device opencl@va' returns
Code:
ffmpeg version 5.1.4-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec    59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter    8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample  4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[AVHWDeviceContext @ 0x55d050b8f100] libva: VA-API version 1.20.0
[AVHWDeviceContext @ 0x55d050b8f100] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55d050b8f100] libva: Found init function __vaDriverInit_1_20
[AVHWDeviceContext @ 0x55d050b8f100] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55d050b8f100] Initialised VAAPI connection: version 1.20
[AVHWDeviceContext @ 0x55d050b8f100] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.4.0 (05e4d0d).
[AVHWDeviceContext @ 0x55d050b8f100] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x55d050bbe1c0] 0.0: Intel(R) OpenCL Graphics / Intel(R) Arc(TM) A310 Graphics
[AVHWDeviceContext @ 0x55d050bbe1c0] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[AVHWDeviceContext @ 0x55d050bbe1c0] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[AVHWDeviceContext @ 0x55d050bbe1c0] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

But as what the log shows the transcoding does not work both VAAPI and QSV.
All help is appreciated, Thanks in advance


RE: hardware encoding fails - TheDreadPirate - 2024-05-06

Which docker image are you using? lsio/jellyfin or jellyfin/jellyfin?


RE: hardware encoding fails - XperiaPlay1998 - 2024-05-06

in the Workloads tab shows docker.io/jellyfin/jellyfin:10.8.13-1


RE: hardware encoding fails - TheDreadPirate - 2024-05-06

Ok. Are you running Jellyfin directly on TrueNAS docker? Or docker in a VM? Docker in a LXC?


RE: hardware encoding fails - XperiaPlay1998 - 2024-05-06

I'm running Jellyfin directly as an application.


in the Resources Configuration tab I Allocate 2 gpu.intel.com/i915 GPU.


RE: hardware encoding fails - TheDreadPirate - 2024-05-07

Based on the ffmpeg command in your log, it doesn't appear that you checked both of the Low Power encoding settings. Low power encoding is required for Arc GPUs. Check both of those boxes and try again.


RE: hardware encoding fails - XperiaPlay1998 - 2024-05-07

THX for this now i get permission denied.


Code:
Opening '/config/transcodes/83fbc6aa0fa9ebae5c8779074255ec480.ts' for writing
[hls @ 0x55cd836ea780] Failed to open file '/config/transcodes/83fbc6aa0fa9ebae5c8779074255ec480.ts'
av_interleaved_write_frame(): Permission denied

I know what this means but my linux/docker knowlage does not know how to fix this.


RE: hardware encoding fails - TheDreadPirate - 2024-05-07

Is the user that is running the Jellyfin container part of the render group in the host OS?


RE: hardware encoding fails - XperiaPlay1998 - 2024-05-07

I created a user that is called Jellyfin that as Auxiliary Groups has render and video group but primary is jellyfin.

the application has the UID 3002 like the created user and the group is als UID 3002 in the application.

EDIT: just notitesed when logginh in via the truenas shell and then going in the container instead of clicking shell on the app i get the following


Code:
I have no name!@jellyfin-5dc47b58cb-tfzpn:/$ id -gn
id: cannot find name for group ID 3002
3002
I have no name!@jellyfin-5dc47b58cb-tfzpn:/$ echo $USER
I have no name!@jellyfin-5dc47b58cb-tfzpn:/$ whoami
whoami: cannot find name for user ID 3002



RE: hardware encoding fails - TheDreadPirate - 2024-05-07

In a vanilla docker setup you have to pass the render group ID into the container. Is there a setting in TrueNAS to do the same?