Docker Hardware Acceleration (VAAPI)

Hi,

I currently switched from Plex to Emby and now to Jellyfin because I don’t like the direction Emby is heading. I setup the docker container successfully but I have an issue with the hardware acceleration.
When I have hardware encoding enabled most of the movies don’t work anymore

Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (truehd (native) -> ac3 (native))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x55e745216d40] No usable encoding profile found.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

When I turn off hardware acceleration it works fine

Summary

Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (eac3 (native) -> ac3 (native))
Press [q] to stop, [?] for help
[libx264 @ 0x55e1a4f41a00] using SAR=1/1
[libx264 @ 0x55e1a4f41a00] frame MB size (240x135) > level limit (8192)
[libx264 @ 0x55e1a4f41a00] DPB size (4 frames, 129600 mbs) > level limit (1 frames, 32768 mbs)
[libx264 @ 0x55e1a4f41a00] VBV bitrate (50015) > level limit (50000)
[libx264 @ 0x55e1a4f41a00] VBV buffer (100030) > level limit (62500)
[libx264 @ 0x55e1a4f41a00] MB rate (776823) > level limit (245760)
[libx264 @ 0x55e1a4f41a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55e1a4f41a00] profile Main, level 4.1
[libx264 @ 0x55e1a4f41a00] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=4 chroma_me=0 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=50015 vbv_bufsize=100030 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00
Output #0, matroska, to ‘/config/data/transcoding-temp/bb7060be388b51e2d8c71c32896ad2a0.mkv’:
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 3840x2160 [SAR 1:1 DAR 16:9], q=-1–1, 23.98 fps, 1k tbn, 23.98 tbc (default)
Metadata:
encoder : Lavc58.54.100 libx264
Side data:
cpb: bitrate max/min/avg: 50015000/0/0 buffer size: 100030000 vbv_delay: -1
Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1, fltp, 384 kb/s (default)
Metadata:
encoder : Lavc58.54.100 ac3
frame= 9 fps=0.0 q=0.0 size= 1kB time=00:00:01.15 bitrate= 6.1kbits/s speed=2.14x
frame= 22 fps= 20 q=19.0 size= 1kB time=00:00:01.67 bitrate= 4.2kbits/s speed=1.54x
frame= 37 fps= 23 q=17.0 size= 1kB time=00:00:02.37 bitrate= 3.0kbits/s speed=1.48x

This is my docker-compose.yml

Summary

version: “2.2”
services:
jellyfin:
image: linuxserver/jellyfin
container_name: jellyfin
environment:
- PUID=993
- PGID=989
- TZ=Europe/London
- UMASK_SET=022 #optional
volumes:
- /var/lib/jellyfin/config:/config
- /var/lib/jellyfin/cache:/cache
- /var/lib/jellyfin/metadata:/metadata
- /var/lib/jellyfin/data:/data
- /var/lib/jellyfin/transcoding-temp:/transcode
ports:
- 8096:8096
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
restart: unless-stopped

Cheers!

Hello,
Does user 993:989 have read / write rights to / dev / dri / renderD128?

I advise you in ssh to execute the command:

chmod 666 /dev/dri/renderD128