VAAPI hardware transcoding function is abnormal

#1

I enabled the vaapi hardware transcoding function, and then I tried to play a movie through the Chrome 73 browser.
original_info
When I choose 720P-4Mbps quality playback the browser can not play the video.
tr720P4Mbps

But dashboard displays transcoding tasks.Is there a bit rate limit?

My server configuration:
Cpu:Intel G3900T
Memory:4G
System :Ubuntu Server18.04.2

Vainfo information:

error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointStats
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointStats
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointStats
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice

This is the transcoding log:

http://192.168.0.58:8096/emby/videos/444ef2d7-adb9-6a8e-20eb-37e63cd57939/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBXT1c2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzY5LjAuMzQ5Ny4xMDAgU2FmYXJpLzUzNy4zNnwxNTU0NjM0NDA4NTk4&MediaSourceId=444ef2d7adb96a8e20eb37e63cd57939&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&VideoBitrate=3744433&AudioBitrate=255567&PlaySessionId=13c1738f19994136b308fa4c955b056b&api_key=f5271e7a3c3a4dd0b5ee7dfa05158410&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=54647a7139f8726efa11a8507261db4e&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false&allowAudioStreamCopy=false

{"Protocol":"File","Id":"444ef2d7adb96a8e20eb37e63cd57939","Path":"/mnt/share/Movie/疾速追杀 (2014)/[疾速追杀].John.Wick.2014.mp4","Type":"Default","Container":"mov,mp4,m4a,3gp,3g2,mj2","Size":4529829888,"Name":"[疾速追杀].John.Wick.2014","IsRemote":false,"ETag":"54647a7139f8726efa11a8507261db4e","RunTimeTicks":60729798656,"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","CodecTag":"avc1","Language":"und","TimeBase":"1/24000","CodecTimeBase":"1001/48000","VideoRange":"SDR","DisplayTitle":"1080P H264","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":5707565,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":23.9760246,"RealFrameRate":23.9760246,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":41},{"Codec":"aac","CodecTag":"mp4a","Language":"und","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"Und AAC stereo Default","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":255567,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"Formats":[],"Bitrate":5967191,"RequiredHttpHeaders":{}}

/usr/share/jellyfin-ffmpeg/ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/mnt/share/Movie/疾速追杀 (2014)/[疾速追杀].John.Wick.2014.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi  -b:v 3744433 -maxrate 3744433 -bufsize 7488866 -profile:v high -level 41 -force_key_frames "expr:gte(t,n_forced*3)" -vf "format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720" -copyts -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 255567  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/a68e71eadf4aaeff31e2461ae0222bd2.m3u8" -y "/var/lib/jellyfin/transcoding-temp/a68e71eadf4aaeff31e2461ae0222bd2%d.ts"


ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers
#2

Please try that ffmpeg command in a shell, it seems like ffmpeg just hangs. Normally you would see transcode progress in the dashboard.

#3

@ EraYaN If I use sudo-u jellyfin/usr/share/jellyfin-ffmpeg/ffmpeg to execute a command, I will report an error. Is it a permission issue?


[ sudo /usr/share/jellyfin-ffmpeg/ffmpeg ] or “root” user execution [ /usr/share/jellyfin-ffmpeg/ffmpeg ] can be successfully executed, but there is no transcoding progress in dashboard of jellyfin.

Is this GPU transcoding or CPU transcoding? CPU usage is still high.

#4

Has been resolved, use the following command and reboot Ubuntu Server.
[ sudo usermod -aG video jellyfin ]