Jellyfin Forum
SOLVED: Help with Tone Mapping - 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: Help with Tone Mapping (/t-solved-help-with-tone-mapping)



Help with Tone Mapping - shotblocker - 2025-01-25

Please let me know what information I need to get this troubleshoot started. I am a bit of a noob in this aspect.

Here is my latest transcode log for example.

https://pastebin.com/83J4g3CB

I enabled VPP tone mapping and left values at default. I also tried normal tone mapping and got the same issue. Disabling tone mapping allows me to transcode as normal.

Using iGPU for transcoding, CPU is Intel Celeron N3450.

Code:
docker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/vainfo
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 info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 25.1.0 (aa5ca48)
vainfo: Supported profile and entrypoints
      VAProfileNone                  : VAEntrypointVideoProc
      VAProfileNone                  : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointEncSlice
      VAProfileH264Main              : VAEntrypointFEI
      VAProfileH264Main              : VAEntrypointEncSliceLP
      VAProfileH264High              : VAEntrypointVLD
      VAProfileH264High              : VAEntrypointEncSlice
      VAProfileH264High              : VAEntrypointFEI
      VAProfileH264High              : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline          : VAEntrypointVLD
      VAProfileJPEGBaseline          : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain              : VAEntrypointVLD
      VAProfileHEVCMain              : VAEntrypointEncSlice
      VAProfileHEVCMain              : VAEntrypointFEI
      VAProfileHEVCMain10            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD

Code:
docker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va -init_hw_device opencl@va
ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  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=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --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      59.  8.100 / 59.  8.100
  libavcodec    61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample  5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[AVHWDeviceContext @ 0x65018793b480] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x65018793b480] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x65018793b480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x65018793b480] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x65018793b480] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x65018793b480] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x65018793b480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 25.1.0 (aa5ca48).
[AVHWDeviceContext @ 0x65018793b480] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x650187971400] Failed to get number of OpenCL platforms: -1001.
Device creation failed: -19.
Failed to set value 'opencl@va' for option 'init_hw_device': No such device
Error parsing global options: No such device

Jellyfin is running in docker, within a Proxmox LXC container (call that weird but its my setup).


RE: Help with Tone Mapping - TheDreadPirate - 2025-01-26

Did you install the openCL mod in your docker compose?


RE: Help with Tone Mapping - shotblocker - 2025-01-28

Sorry for the late reply, I thought I had email notifications on. I do not have openCL in my compose.

Code:
version: "3.8"
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    group_add:
      - "106"
    devices:
      - /dev/dri:/dev/dri
    ports:
      - 8096:8096
    environment:
      - TZ=Etc/UTC
      - PUID=1000
      - PGID=1000
    volumes:
      - /appdata/jellyfin:/config
      - /mnt/media/data/media:/data/media
      - /mnt/media/data/media/tv:/data/media/tv
      - /mnt/media/data/media/movies:/data/media/movies
    restart: unless-stopped

Would you be able to assist me in what I need to add?


RE: Help with Tone Mapping - TheDreadPirate - 2025-01-28

Add this to the environment section.

Code:
- DOCKER_MODS=linuxserver/mods:jellyfin-opencl-intel



RE: Help with Tone Mapping - shotblocker - 2025-01-29

Installed opencl, yet all of my transcodes are logging conversion failed. I don't know a lot about codecs but all the 4k, UltraHD media I have is either H265, HEVC, or x265. Guessing the description of: "Tone-mapping can transform the dynamic range of a video from HDR to SDR while maintaining image details and colors, which are very important information for representing the original scene. Currently works only with 10bit HDR10, HLG and DoVi videos. This requires the corresponding GPGPU runtime," is relevant there.

So for example if I'm watching a 4k movie that needs to transcode, the picture is washed-out (versus directly playing on i.e. Jellyfin Media Player). If all my media is in a non-supported codec, does that mean I just can't enable tone-mapping and have to just live with the washed-out colors? Or am I missing something.

Code:
Stream mapping:
  Stream #0:0 (hevc) -> setparams:default
  Stream #0:15 (pgssub) -> scale:default
  overlay_qsv:default -> Stream #0:0 (h264_qsv)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[Parsed_tonemap_vaapi_6 @ 0x7030bc021540] VAAPI driver doesn't support HDR
[Parsed_tonemap_vaapi_6 @ 0x7030bc021540] Failed to configure output pad on Parsed_tonemap_vaapi_6
[fc#0 @ 0x588f45b52c00] Error reinitializing filters!
[fc#0 @ 0x588f45b52c00] Task finished with error code: -22 (Invalid argument)
[fc#0 @ 0x588f45b52c00] Terminating thread with return code -22 (Invalid argument)
[vost#0:0/h264_qsv @ 0x588f478c0d80] Could not open encoder before EOF
[vost#0:0/h264_qsv @ 0x588f478c0d80] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_qsv @ 0x588f478c0d80] Terminating thread with return code -22 (Invalid argument)
[out#0/hls @ 0x588f477b6e80] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=      0KiB time=N/A bitrate=N/A speed=N/A   
Conversion failed!



RE: Help with Tone Mapping - TheDreadPirate - 2025-01-29

If I'm reading Intel's docs correctly, ApolloLake CPUs do not support HEVC 10-bit.  Which is needed for tone mapping.

I thought ApolloLake had Gen 9.5 graphics, which does support HEVC 10-bit, but it appears it has Gen 9 graphics.

Check if you have intel-gpu-tools installed.  If you do run intel_gpu_top and tell me what generation it reports.

Code:
sudo apt list --installed | grep intel-gpu-tools
sudo apt install intel-gpu-tools  #If it isn't already installed
sudo intel_gpu_top

   

If it does report "Gen9" instead of "Gen9.5" you are out of luck for HDR tone mapping.


RE: Help with Tone Mapping - shotblocker - 2025-01-29

I do I have intel-gpu-tools installed, and yes, sadly it reports Gen9. Looks like I'll eventually find a new host for my media server. For the time being I'll just have to deal with washed-out 4k videos on transcoding clients.