Unable to use hardware transcoding with Jellyfin on Hetzner EX42

titooo7

Senior Member
Original poster
Local time
6:31 AM
Jul 31, 2018
154
29
I can use hw transcoding without issues on Plex following the steps that were described on the wiki, but I can't manage to get it working on Jellyfin.
I know that Hetzner EX42 (i7-6700) is quite popular so I'm hoping someone else find out the way to do it and can share the knowledge.

On Jellyfin / Dashboard / Network I selected VAAPI, /dev/dri/renderD128, Enable hardware encoding .This is the log I get:

http://jellyfin.mydomain.com/jellyfin/videos/some-random-numbers-and-letters-here/hls1/main/0.ts?DeviceId=some-random-numbers-and-letters-here&MediaSourceId=some-random-numbers-and-letters-here&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=1&VideoBitrate=223616000&AudioBitrate=384000&PlaySessionId=some-random-numbers-and-letters-here&api_key=some-random-numbers-and-letters-here&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=some-random-numbers-and-letters-here&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51

{"Protocol":"File","Id":"5d6bc771639fd2a20aa33b1dcf71499b","Path":"/mnt/unionfs/SERIES-grupo/Line of Duty/T1/Line of Duty - S01E03 - CapÃtulo 3 1080p 4.5 Mbps AVC AC3 [es].mkv","Type":"Default","Container":"mkv,webm","Size":1988172288,"Name":"Line of Duty - S01E03 - CapÃtulo 3 1080p 4.5 Mbps AVC AC3 [es]","IsRemote":false,"ETag":"some-random-numbers-and-letters-here","RunTimeTicks":35062800384,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":true,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","TimeBase":"1/1000","CodecTimeBase":"1/50","VideoRange":"SDR","DisplayTitle":"1080P H264","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":4536254,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":25,"RealFrameRate":25,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":40},{"Codec":"ac3","Language":"spa","TimeBase":"1/1000","CodecTimeBase":"1/48000","DisplayTitle":"Spa Dolby Digital stereo Default","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":384000,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"Formats":[],"Bitrate":4920254,"RequiredHttpHeaders":{}}

/usr/local/bin/ffmpeg -fflags +genpts -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/mnt/unionfs/SERIES-grupo/Line of Duty/T1/Line of Duty - S01E03 - CapÃtulo 3 1080p 4.5 Mbps AVC AC3 [es].mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -copyts -vsync -1 -codec:a:0 aac -strict experimental -ac 2 -ab 384000 -f hls -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -hls_time 6 -individual_header_trailer 0 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/transcoding-temp/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/dbb539618decc9b515034ca373583f1f%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcoding-temp/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/transcodes/dbb539618decc9b515034ca373583f1f.m3u8"


ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-vaapi --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gnutls --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libx264 --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-postproc --enable-cuvid --enable-nvenc --enable-version3 --enable-rpath --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[AVHWDeviceContext @ 0x56491488da00] No VA display found for device /dev/dri/renderD128.
Device creation failed: -22.
Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Invalid argument
Error parsing global options: Invalid argument

Post automatically merged:

I think I fixed it doing chmod 777 "/dev/dri/renderD128" and then restarting Jelyfin docker container.
 
Last edited:
  • Like
Reactions: DeadPool

artiume

Full Member
Local time
1:31 AM
Mar 19, 2018
41
15
If permissions were the issue, the proper solution is probably to add the jellyfin user to the video group should work?

usermod -aG video jellyfin
Post automatically merged:

It was probably the chmod that fixed the permission issue lol.
 
Last edited:

titooo7

Senior Member
Original poster
Local time
6:31 AM
Jul 31, 2018
154
29
Since I use jellyfin with docker container of pgblitz the user isn't jellyfin but root. So I don't know what fixed it but probably it was one of the following commands that I executed:

chmod 777 "/dev/dri/renderD128"
usermod -aG video root
usermod -aG video my-ubuntu-username
 
  • Like
Reactions: DeadPool

mobo

Junior Member
Donor
Local time
7:31 AM
Apr 15, 2019
18
6
Enabling VAAPI in jellyfin GUI + "chmod 666 /dev/dri/renderD128" + restart docker container is the solution.
keep in mind that driver permission is reset after server restart. so you should create a cronjob for it.

This is because (maybe only in old versions of pgblitz) the user in the jellyfin docker has no permissions at all. Therefore it cannot read/write /dev/dri/renderD128 without this fix. And dont use 777, always use least needed privileges.
 
Last edited:

DeadPool

Senior Member
Moderator
Local time
6:31 AM
May 2, 2018
181
44
A TECHNICAL QUESTION IN RELATION TO RUNNING A MEDIA SERVER as opposed to a question about whether or not you have an invite to particular indexer????!!!!????!!!!

dP

PS - i know i know, sarcasm is the lowest for m of wit but F**K ME what has become of this once great forum?

PPS - sorry to butt in, it's just such a rarity to actually see this site being used for its intended purpose.
 

artiume

Full Member
Local time
1:31 AM
Mar 19, 2018
41
15
I'm one of the dev's for Jellyfin, but my stomping grounds were here on PG so I've always been a bit of a lurker, helping out where I can :). If there's any Jellyfin specific problems, don't hesitate to post on our issues board as well. P.S. 10.5 is right around the corner ;)
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.


Members online

Maintenance Donations

Recommend NewsGroups

      Up To a 58% Discount!