Jellyfin Forum
SOLVED: Jellyfin does not trancscode 4K HEVC in web player - 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: Jellyfin does not trancscode 4K HEVC in web player (/t-solved-jellyfin-does-not-trancscode-4k-hevc-in-web-player)

Pages: 1 2 3


Jellyfin does not trancscode 4K HEVC in web player - bioblatt - 2024-07-24

The video stream starts and stops again after just a fraction of a second when trying to play 4K HEVC files. 
It looks like it's not transcoding at all. Switching from QSV to VA-API makes no difference.

My server runs on Debian Bookworm (6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux)
I've attached all logs with the transcoding settings.

Here's all the output for my CPU:

Code:
lspci -nn | grep -Ei "3d|display|vga"
00:02.0 VGA compatible controller [0300]: Intel Corporation RocketLake-S GT1 [UHD Graphics 730] [8086:4c8b] (rev 04)
00:17.0 SATA controller [0106]: Intel Corporation Device [8086:43d2] (rev 11)

sudo /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 (7c1c775)
...

sudo /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  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
  libavutil      58.  2.100 / 58.  2.100
  libavcodec    60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter    9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample  4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 0x55dc631e4480] libva: VA-API version 1.21.0
[AVHWDeviceContext @ 0x55dc631e4480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55dc631e4480] libva: Found init function __vaDriverInit_1_21
[AVHWDeviceContext @ 0x55dc631e4480] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55dc631e4480] Initialised VAAPI connection: version 1.21
[AVHWDeviceContext @ 0x55dc631e4480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 (7c1c775).
[AVHWDeviceContext @ 0x55dc631e4480] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x55dc63214bc0] 0.0: Intel(R) OpenCL HD Graphics / Intel(R) UHD Graphics 730 [0x4c8b]
[AVHWDeviceContext @ 0x55dc63214bc0] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[AVHWDeviceContext @ 0x55dc63214bc0] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[AVHWDeviceContext @ 0x55dc63214bc0] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
Hyper fast Audio and Video encoder

sudo dmesg | grep i915
[    2.605534] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    2.605562] i915 0000:00:02.0: vgaarb: deactivate vga console
[    2.605627] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[    2.606098] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    2.606505] i915 0000:00:02.0: firmware: direct-loading firmware i915/rkl_dmc_ver2_03.bin
[    2.607042] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/rkl_dmc_ver2_03.bin (v2.3)
[    2.607099] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[    2.608242] i915 0000:00:02.0: firmware: direct-loading firmware i915/tgl_guc_70.1.1.bin
[    2.609593] i915 0000:00:02.0: firmware: direct-loading firmware i915/tgl_huc_7.9.3.bin
[    2.736732] i915 0000:00:02.0: [drm] GuC firmware i915/tgl_guc_70.1.1.bin version 70.1.1
[    2.736735] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9.3
[    2.739841] i915 0000:00:02.0: [drm] HuC authenticated
[    2.739843] i915 0000:00:02.0: [drm] GuC submission disabled
[    2.739844] i915 0000:00:02.0: [drm] GuC SLPC disabled
[    2.741263] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    2.742200] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    2.742830] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
[    2.742935] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
[374749.835387] i915 0000:00:02.0: [drm] Resetting vcs0 for preemption time out
[374749.835468] i915 0000:00:02.0: [drm] av:hevc:df0[3435242] context reset due to GPU hang
[374750.867290] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:28fffffd
[1222976.397565] Modules linked in: xt_nat xt_tcpudp veth xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables libcrc32c nfnetlink br_netfilter bridge stp llc cmac ctr ccm qrtr overlay binfmt_misc nls_ascii nls_cp437 vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp coretemp snd_sof snd_sof_utils snd_soc_hdac_hda kvm_intel iwlmvm snd_hda_ext_core i915 kvm snd_soc_acpi_intel_match irqbypass snd_soc_acpi mac80211 snd_soc_core ghash_clmulni_intel sha512_ssse3 sha512_generic snd_compress sha256_ssse3 soundwire_bus sha1_ssse3 snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec drm_buddy libarc4 snd_hda_core

sudo cat /sys/kernel/debug/dri/0/gt/uc/guc_info
GuC firmware: i915/tgl_guc_70.1.1.bin
        status: RUNNING
        version: found 70.1.1
        uCode: 277056 bytes
        RSA: 256 bytes

sudo cat /sys/kernel/debug/dri/0/gt/uc/huc_info
HuC firmware: i915/tgl_huc_7.9.3.bin
        status: RUNNING
        version: found 7.9.3
        uCode: 589504 bytes
        RSA: 256 bytes

Can somebody please help me? Because I have a few users are sometimes using their browsers or the phone app with the default player and they are now unable to stream 4K content.

Thank you very much for the support!


RE: Jellyfin does not trancscode 4K HEVC in web player - TheDreadPirate - 2024-07-24

You enabled AV1 encoding, but Rocket Lake does not support encoding AV1. Only decoding AV1.


RE: Jellyfin does not trancscode 4K HEVC in web player - bioblatt - 2024-07-24

Ok I disabled AV1 encoding and restarted the server once again (I tried that already yesterday that's why I just kept it enabled) but still with no success.


RE: Jellyfin does not trancscode 4K HEVC in web player - TheDreadPirate - 2024-07-24

Share the latest ffmpeg log after disabling AV1? Did you also install the Intel OpenCL package?


RE: Jellyfin does not trancscode 4K HEVC in web player - bioblatt - 2024-07-24

Please find the log attached.
Yes, intel-opencl-icd is installed.

Code:
apt policy intel-opencl-icd
intel-opencl-icd:
  Installed: 22.43.24595.41-1
  Candidate: 22.43.24595.41-1
  Version table:
*** 22.43.24595.41-1 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status



RE: Jellyfin does not trancscode 4K HEVC in web player - TheDreadPirate - 2024-07-24

I just remembered something. #3 in this doc.

https://jellyfin.org/docs/general/administration/hardware-acceleration/known-issues#intel-on-linux

Quote:The kernel range from 5.18 to 6.1.3 have an issue that locks up and resets the i915 kernel driver when using OpenCL based HDR/DV tone-mapping. Linux 5.18-, 6.0.18+, 6.1.4+ are not affected.

Ticket: https://gitlab.freedesktop.org/drm/intel/-/issues/7627

Fixed by: drm/i915: improve the catch-all evict to handle lock contention

Looking at your fix post, I see the resets.

Code:
[374749.835468] i915 0000:00:02.0: [drm] av:hevc:df0[3435242] context reset due to GPU hang
[374750.867290] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:28fffffd

Consider updating to a newer/patched kernel.


RE: Jellyfin does not trancscode 4K HEVC in web player - TheDreadPirate - 2024-07-24

I might be wrong. Looked at your first post again and saw that Debian's 6.1.0-21 is based on 6.1.90.


RE: Jellyfin does not trancscode 4K HEVC in web player - bioblatt - 2024-07-24

Thanks. I've updated to 6.5.0 using the following commands:

Code:
echo "deb http://deb.debian.org/debian/ bullseye-backports main" | sudo tee /etc/apt/sources.list.d/backports.list
sudo apt install -t bullseye-backports linux-image-6.5.0-0.deb12.1-amd64
sudo reboot

uname -a gives me now
Code:
6.5.0-0.deb12.1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1~bpo12+1 (2023-10-08) x86_64 GNU/Linux

But the issue still remains. Am I missing something?


RE: Jellyfin does not trancscode 4K HEVC in web player - bioblatt - 2024-07-24

Ok I just saw your reply and changed back to 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux


RE: Jellyfin does not trancscode 4K HEVC in web player - TheDreadPirate - 2024-07-24

What happens when you disable low power encoding in Dashboard > Playback? I was comparing your dmesg output with mine and noticed something with the HuC/GuC messages. The firmware is there, but may not be enabled/loaded. They are required for low power encoding, but Rocket Lake can still function without low power encoding enabled.