Jellyfin Forum
SOLVED: Codec issues on Sony Bravia using hardware acceleration - 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: Codec issues on Sony Bravia using hardware acceleration (/t-solved-codec-issues-on-sony-bravia-using-hardware-acceleration)



Codec issues on Sony Bravia using hardware acceleration - Mehdi_FR - 2024-07-05

Hello,

Here are my specs:
Jellyfin version : 10.9.7
Docker on sinology NAS DS423+ with DSM 7.2.1 (Docker compose) using Intel Celeron J4125

Hardware acceleration is activated with options specified in the attached PNG files.

My findings:
- I have 2 videos : one with codec V_MPEGH/ISO/HEVC and one with V_MPEG4/ISO/AVC
- on my laptop and on my iPhone, I can watch both files with Jellyfin application
- on my Sony Bravia x90L, files with codec V_MPEG4/ISO/AVC cannot be read neither .mp4 files.

I have also attached 3 logs : Log1 is Okay; Logs 2 and 3 are not Okay.

and here is my docker compose file
version: '3.5'
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    network_mode: 'host'
    volumes:
      - /volume1/docker/jellyfin/configConfused-faceconfig
      - /volume1/docker/jellyfin/cacheConfused-facecache
      - /volume1/Archive/Video/movies
      - /volume1/Archive/Video/tv-series
      - /volume1/Archive/Video/tv-shows
      - /volume1/Archive/Video/vhs
    restart: 'unless-stopped'
    environment:
      - TZ='Asia/Singapore'
    devices:
      - /dev/dri/renderD128Confused-facedev/dri/renderD128
      - /dev/dri/card0Confused-facedev/dri/card0

Thank you in advance for your help.

BR


RE: Codec issues on Sony Bravia using hardware acceleration - TheDreadPirate - 2024-07-05

Try unchecking low power encoding. That feature requires additional configuration in the OS that I'm pretty sure Synology makes difficult or impossible to perform. And it isn't required for your iGPU.

Also try passing in /dev/dri in its entirety instead of the specific renderD128 device or card0. The Intel driver will automatically select the first available Intel device in that path.


RE: Codec issues on Sony Bravia using hardware acceleration - Mehdi_FR - 2024-07-05

I've applied the recommended changes and restarted the Jellyfin server but the issue remains the same.
Here is the last log :

{"Protocol":0,"Id":"946f6bd6789409d32778eee06876596e","Path":"/movies/Terreur sur le Britannic/Terreur sur le Britannic.avi","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"avi","Size":2095824896,"Name":"Terreur sur le Britannic","IsRemote":false,"ETag":"ea38ea11d7aaa469bd8116417dc6f951","RunTimeTicks":63545600000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"subrip","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":"Undefined","LocalizedDefault":"Default","LocalizedForced":"Forced","LocalizedExternal":"External","LocalizedHearingImpaired":"Hearing Impaired","DisplayTitle":"Undefined - SUBRIP - External","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":0,"Width":0,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":0,"Score":null,"IsExternal":true,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":"/movies/Terreur sur le Britannic/Terreur sur le Britannic.srt","PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/100","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":"Undefined","LocalizedDefault":"Default","LocalizedForced":"Forced","LocalizedExternal":"External","LocalizedHearingImpaired":"Hearing Impaired","DisplayTitle":"Undefined - ASS - External","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":0,"Width":0,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":true,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":"/movies/Terreur sur le Britannic/Terreur sur le Britannic.ssa","PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"mpeg4","CodecTag":"XVID","Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/25","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"480p MPEG4 SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":null,"BitRate":2240011,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":426,"Width":720,"AverageFrameRate":25,"RealFrameRate":25,"Profile":"Advanced Simple Profile","Type":1,"AspectRatio":"120:71","Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":5,"IsAnamorphic":false},{"Codec":"ac3","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/24000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"Dolby Digital - Stereo","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"stereo","BitRate":192000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/24000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"Dolby Digital - Stereo","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"stereo","BitRate":192000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":2638514,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -noautorotate -i file:"/movies/Terreur sur le Britannic/Terreur sur le Britannic.avi" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 hevc_qsv -tag:v:0 hvc1 -preset veryfast -b:v 4480022 -maxrate 4480022 -bufsize 8960044 -g:v:0 75 -keyint_min:v:0 75 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(720\,426*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(720/a\,426))/2)*2,format=yuv420p" -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/cache/transcodes/dc957ae7ba6f9930cdecd83246cb3397%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/dc957ae7ba6f9930cdecd83246cb3397.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright © 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 @ 0x555c85575a00] No VA display found for any default device.
Device creation failed: -22.
Failed to set value 'vaapi=va:,kernel_driver=i915,driver=iHD' for option 'init_hw_device': Invalid argument
Error parsing global options: Invalid argument


RE: Codec issues on Sony Bravia using hardware acceleration - TheDreadPirate - 2024-07-05

I forgot to mention this in my first reply. You also need to pass in the render group into the container.

https://jellyfin.org/docs/general/administration/hardware-acceleration/intel/#official-docker

Code:
group_add:
      - "122" # Change this to match your "render" host group id and remove this comment



RE: Codec issues on Sony Bravia using hardware acceleration - Mehdi_FR - 2024-07-05

Same issue remains

I've opened ssh in DSM and used Terminal on my MacOS to find the render group.
It was not existing.
I've created with command sudo synogroup --add render
And then I got
Group Name: [render]
Group Type: [AUTH_LOCAL]
Group ID: [65538]

I've update the docker compose file as followed

version: '3.5'
services:
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
network_mode: 'host'
volumes:
- /volume1/docker/jellyfin/configConfused-faceconfig
- /volume1/docker/jellyfin/cacheConfused-facecache
- /volume1/Archive/Video/movies
- /volume1/Archive/Video/tv-series
- /volume1/Archive/Video/tv-shows
- /volume1/Archive/Video/vhs
restart: 'unless-stopped'
environment:
- TZ='Asia/Singapore'
devices:
- /dev/driConfused-facedev/dri
group_add:
- "65538"

Then I restarted Jellyfin on DSM and tried to read the fMPEG4 file again.
it is not working on any device : Sony Bravia, Mac and iPhone.


RE: Codec issues on Sony Bravia using hardware acceleration - TheDreadPirate - 2024-07-05

You shouldn't be creating a group. The render group should already exist and the GPU should already be a member of it.

Code:
chris@rat-trap:~$ getent group render | cut -d: -f3
993
chris@rat-trap:~$ ll /dev/dri
total 0
drwxr-xr-x  3 root root        100 Jun 26 12:51 ./
drwxr-xr-x 22 root root       4920 Jun 26 12:51 ../
drwxr-xr-x  2 root root         80 Jun 26 12:51 by-path/
crw-rw----  1 root video  226,   1 Jun 26 12:51 card1
crw-rw----  1 root render 226, 128 Jun 26 12:51 renderD128

The relevant part of my docker compose for reference.

Code:
services:
  jellyfin-testing:
    image: jellyfin/jellyfin:10.9.7
    container_name: jellyfin-stable-testing
    user: 105:104
    group_add:
      - "993" # Intel render group
    networks:
      blackmoon:
        ipv4_address: 172.16.100.2
    expose:
      - 8096
    volumes:
      - ./jellyfin-stable-data/config:/config
      - ./jellyfin-stable-data/cache:/cache
      - /media/library:/media/library:ro
      - /media/storage2:/media/storage2:ro
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
    restart: 'unless-stopped



RE: Codec issues on Sony Bravia using hardware acceleration - Mehdi_FR - 2024-07-06

I see. But, the getent command does not work on my terminal (I use MacOS Terminal).
So I asked ChatGPT for an alternative.

Please see the history of commands :

-------

XXXXX@Serveur_MehdiConfused-face$ getent group render
-sh: getent: command not found
XXXXX@Serveur_MehdiConfused-face$ cat /etc/group | grep render
XXXXX@Serveur_MehdiConfused-face$ cat /etc/group | grep render
XXXXX@Serveur_MehdiConfused-face$ cat /etc/group
...
Python2:x:236506:
QuickConnect:x:177017:
root:x:0:root
rpc:x:32:
...
StorageManager:x:112790:
SynoFinder:x:195341:
SynologyApplicationService:x:130369:
SynologyDrive:x:153742:
SynoOnlinePack_v2:x:225936:
synopkgs:x:999Woozy-facetorageManager,Python2,QuickConnect,FileStation,SynoOnlinePack_v2,OAuthService,SynoFinder,SecureSignIn,PlexMediaServer,SynologyApplicationService,SynologyDrive,USBCopy
synoplugind:x:941:
SynoRsyncd:x:873:
synotss:x:942:
system:x:1:system
taskmgr:x:939:
tokenmgr:x:938:
USBCopy:x:123545:
users:xHundred-points
videodriver:x:937:PlexMediaServer
vmcomm:x:936:
wheel:x:10:
XXXXX@Serveur_MehdiConfused-face$ cat /etc/group | grep render
XXXXX@Serveur_MehdiConfused-face$ sudo synogroup --add render

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Password:
Group Name: [render]
Group Type: [AUTH_LOCAL]
Group ID: [65538]
Group Members:
XXXXX@Serveur_MehdiConfused-face$ cat /etc/group | grep render
render:x:65538:

-------

you can see there was no render group initially before I create one.

Why do you recommend ?
thank you for your time and reactivity. I really appreciate


RE: Codec issues on Sony Bravia using hardware acceleration - TheDreadPirate - 2024-07-06

Unfortunately, I'm at my limit of knowledge regarding Synology (I don't have any of their NASes).

I found this reddit post that looks like what we need.

https://www.reddit.com/r/jellyfin/comments/exepia/synology_users_how_to_enable_hardware/


RE: Codec issues on Sony Bravia using hardware acceleration - Mehdi_FR - 2024-07-06

It works !
Thank you very much.

as a summary in Synology NAS, DSM 7.2.1
1) stopped my jellyfish container in Docker
2) allowed container execution with high privileges
3) added environment variable 'DEVICES' with value '/dev/dri/renderD128'
4) restarted the container

Now all MPEG4 codecs can be read from my Google TV on Sony Bravia