Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel GPU support #12

Open
energywave opened this issue Dec 31, 2023 · 7 comments
Open

Intel GPU support #12

energywave opened this issue Dec 31, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@energywave
Copy link

Hello, thank you for this snap. I'm using it on Ubuntu 23.10 and I want to use my Intel GPU (Gen9) to HW accelerate transcoding.
I could not manage to do it, however, by setting QSV in JellyFin settings.
I suspect that it has something to do with the snap environment but it's the first times that I'm using them so I'm not sure.
If I run the following command in the host:
ffmpeg -hwaccel qsv -c:v h264_qsv -i SampleVideo_1280x720_30mb.mp4 -c:v h264_qsv -global_quality 25 -maxrate 2M test.mp4 -v verbose
the result is a correct encoding using Intel QSV, with the following output:

ffmpeg version 6.0-6ubuntu1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.2.0-2ubuntu1)
  configuration: --prefix=/usr --extra-version=6ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  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
[h264 @ 0x561ce88c7300] Reinit context to 1280x720, pix_fmt: yuv420p
WARNING: defaulting hwaccel_output_format to qsv for compatibility with old commandlines. This behaviour is DEPRECATED and will be removed in the future. Please explicitly set "-hwaccel_output_format qsv".
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SampleVideo_1280x720_30mb.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf53.24.2
  Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
File 'test.mp4' already exists. Overwrite? [y/N] y
[AVHWDeviceContext @ 0x561ce89c2580] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x561ce89c2580] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x561ce89c2580] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x561ce89c2580] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x561ce89c2580] libva: Found init function __vaDriverInit_1_18
[AVHWDeviceContext @ 0x561ce89c2580] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x561ce89c2580] Initialised VAAPI connection: version 1.19
[AVHWDeviceContext @ 0x561ce89c2580] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.2.3 ().
[AVHWDeviceContext @ 0x561ce89c2580] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x561ce897eac0] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3
[AVHWDeviceContext @ 0x561ce897eac0] Initialize MFX session: implementation version is 1.35
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_qsv) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[graph_1_in_0_1 @ 0x561ce8ce3e80] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:5.1
[AVHWDeviceContext @ 0x561ce8ce5100] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.2.3 ().
[AVHWDeviceContext @ 0x561ce8ce5100] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x561ce89c2b40] Decoder: output is video memory surface
[h264_qsv @ 0x561ce89c2b40] Use Intel(R) oneVPL to create MFX session with the specified MFX loader
[AVHWDeviceContext @ 0x561ce8d328c0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.2.3 ().
[AVHWDeviceContext @ 0x561ce8d328c0] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x561ce89c2b40] Decoder: output is video memory surface
[h264_qsv @ 0x561ce89c2b40] Use Intel(R) oneVPL to create MFX session with the specified MFX loader
[graph 0 input from stream 0:0 @ 0x561ce897b100] w:1280 h:720 pixfmt:qsv tb:1/12800 fr:25/1 sar:1/1
[h264_qsv @ 0x561ce88f2b00] Using input frames context (format qsv) with h264_qsv encoder.
[h264_qsv @ 0x561ce88f2b00] Encoder: input is video memory surface
[h264_qsv @ 0x561ce88f2b00] Use Intel(R) oneVPL to create MFX session with the specified MFX loader
[h264_qsv @ 0x561ce88f2b00] Using the constant quality with VBR algorithm (QVBR) ratecontrol method
[h264_qsv @ 0x561ce88f2b00] profile: avc high; level: 32
[h264_qsv @ 0x561ce88f2b00] GopPicSize: 256; GopRefDist: 3; GopOptFlag: closed; IdrInterval: 0
[h264_qsv @ 0x561ce88f2b00] TargetUsage: 4; RateControlMethod: QVBR
[h264_qsv @ 0x561ce88f2b00] NumSlice: 1; NumRefFrame: 2
[h264_qsv @ 0x561ce88f2b00] RateDistortionOpt: OFF
[h264_qsv @ 0x561ce88f2b00] RecoveryPointSEI: OFF
[h264_qsv @ 0x561ce88f2b00] VDENC: OFF
[h264_qsv @ 0x561ce88f2b00] Entropy coding: CABAC; MaxDecFrameBuffering: 2
[h264_qsv @ 0x561ce88f2b00] NalHrdConformance: ON; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: ON
[h264_qsv @ 0x561ce88f2b00] FrameRateExtD: 1; FrameRateExtN: 25
[h264_qsv @ 0x561ce88f2b00] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x561ce88f2b00] MaxFrameSize: 353280; MaxSliceSize: 0
[h264_qsv @ 0x561ce88f2b00] BitrateLimit: ON; MBBRC: OFF; ExtBRC: OFF
[h264_qsv @ 0x561ce88f2b00] Trellis: auto
[h264_qsv @ 0x561ce88f2b00] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: 2x
[h264_qsv @ 0x561ce88f2b00] AdaptiveI: OFF; AdaptiveB: OFF; BRefType:off
[h264_qsv @ 0x561ce88f2b00] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x561ce88f2b00] DisableDeblockingIdc: 0
[h264_qsv @ 0x561ce88f2b00] SkipFrame: no_skip
[h264_qsv @ 0x561ce88f2b00] QVBRQuality: 25
[h264_qsv @ 0x561ce88f2b00] PRefType: default
[h264_qsv @ 0x561ce88f2b00] TransformSkip: unknown
[h264_qsv @ 0x561ce88f2b00] IntRefCycleDist: 0
[h264_qsv @ 0x561ce88f2b00] LowDelayBRC: OFF
[h264_qsv @ 0x561ce88f2b00] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[h264_qsv @ 0x561ce88f2b00] ScenarioInfo: 0
Output #0, mp4, to 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Stream #0:0(und): Video: h264, 1 reference frame (avc1 / 0x31637661), qsv(tv, progressive, left), 1280x720 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 1000 kb/s, 25 fps, 12800 tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 2000000/0/1000000 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, delay 1024, 341 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 aac
EOF in input file 0 q=30.0 size=   24064kB time=00:02:50.32 bitrate=1157.4kbits/s speed=6.16x
Terminating demuxer thread 0
[h264_qsv @ 0x561ce89c2b40] A decode call did not consume any data: expect more data at input (-10)
    Last message repeated 2 times
No more output streams to write to, finishing.
[out#0/mp4 @ 0x561ce88cb700] All streams finished
[out#0/mp4 @ 0x561ce88cb700] Terminating muxer thread
[AVIOContext @ 0x561ce88fb140] Statistics: 25038641 bytes written, 2 seeks, 99 writeouts
frame= 4271 fps=154 q=30.0 Lsize=   24452kB time=00:02:50.83 bitrate=1172.5kbits/s speed=6.14x
video:17199kB audio:7131kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.500543%
Input file #0 (SampleVideo_1280x720_30mb.mp4):
  Input stream #0:0 (video): 4271 packets read (23193765 bytes); 4271 frames decoded;
  Input stream #0:1 (audio): 8009 packets read (8199788 bytes); 8009 frames decoded (8201216 samples);
  Total: 12280 packets (31393553 bytes) demuxed
Output file #0 (test.mp4):
  Output stream #0:0 (video): 4271 frames encoded; 4271 packets muxed (17612024 bytes);
  Output stream #0:1 (audio): 8009 frames encoded (8201216 samples); 8010 packets muxed (7301908 bytes);
  Total: 12281 packets (24913932 bytes) muxed
[aac @ 0x561ce88f9d00] Qavg: 181.207
[AVIOContext @ 0x561ce88cebc0] Statistics: 31544589 bytes read, 2 seeks

However, when setting QSV in the JellyFin settings, I find this in logs folder's FFmpeg.Transcode-xxx.log:

/videos/5daa7d17-0be4-c10f-5fcf-fd52e03e040f/hls1/main/0.ts

{"Protocol":0,"Id":"5daa7d170be4c10f5fcffd52e03e040f","Path":"/media/mediacenter/Video/Balla coi lupi.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":5920864768,"Name":"Balla coi lupi","IsRemote":false,"ETag":"0b12470508e02267ac745b4a4a3bac6a","RunTimeTicks":140293111808,"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":"hevc","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":"Video H.265 (Encoded by ZMachine)","VideoRange":"SDR","VideoRangeType":"SDR","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Video H.265 (Encoded by ZMachine) - 1080p - HEVC - SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":3376282,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":true,"Height":812,"Width":1920,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main","Type":1,"AspectRatio":"2.35:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":120,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":"ita","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":"Audio AC3","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Audio AC3 - Italian - Dolby Digital - 5.1 - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"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":"eng","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":"Audio AC3","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Audio AC3 - English - Dolby Digital - 5.1","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"ita","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":"Sub Forced","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Forced - Italian - Predefinito - Forzato - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":true,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"eng","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":"Sub Forced","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Forced - English - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"ita","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":"Sub","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub - Italian - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":5,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"eng","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":"Sub","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub - English - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":6,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":4272282,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/snap/itrue-jellyfin/89/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"/media/mediacenter/Video/Balla coi lupi.mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 5627137 -maxrate 5627137 -bufsize 11254274 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -codec:a:0 libfdk_aac -ac 6 -ab 640000 -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 "/var/snap/itrue-jellyfin/common/data/transcodes/1a25c2a09bf4c105998ab823590359f8%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/snap/itrue-jellyfin/common/data/transcodes/1a25c2a09bf4c105998ab823590359f8.m3u8"


ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --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-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --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 @ 0x5638540f8940] libva: Failed to get device id from the driver. Please consider to upgrade the driver to support VA-API 1.15.0
Device creation failed: -1313558101.
Failed to set value 'qsv=qs@va' for option 'init_hw_device': Unknown error occurred
Error parsing global options: Unknown error occurred

The error is this: [AVHWDeviceContext @ 0x5638540f8940] libva: Failed to get device id from the driver. Please consider to upgrade the driver to support VA-API 1.15.0
and that error doesn't arise on the host itself.
Do you have some clue? Maybe it should be better to install JellyFin directly on the host?

Furthermore I wanted to know on what base you'll consider updating JellyFin as there is a newer version with important security fix but the snap isn't updated yet.

Thank you in advance for the time you'll give on this and happy new year!

@IsaacJT
Copy link
Owner

IsaacJT commented Jan 2, 2024

Hi @energywave, thanks for the bug report. I'm guessing this is something to do with the snap confinement restricting access to hardware. I don't have any Intel-based systems that I can test with, but I'll look into it - maybe it's an easy fix

@IsaacJT IsaacJT self-assigned this Jan 2, 2024
@IsaacJT IsaacJT added the bug Something isn't working label Jan 2, 2024
@IsaacJT
Copy link
Owner

IsaacJT commented Jan 2, 2024

Can you please try the version in the latest/edge channel? I've added intel-opencl-icd as per https://jellyfin.org/docs/general/administration/hardware-acceleration/intel/

@IsaacJT
Copy link
Owner

IsaacJT commented Jan 2, 2024

You can also now call itrue-jellyfin.ffmpeg to directly call the ffmpeg binary inside the snap, which might help with debugging.

@energywave
Copy link
Author

Hey @IsaacJT, thank you so much for having worked on this and taken it so seriously! That would be great if the snap will support GPU acceleration (at least Intel one, as I believe it's the most used as it's in all MiniPCs...)

I've updated the snap to the latest/edge.
However the result is the same as before.

I've tried with QSV, this is the result:
QSV:

/videos/cd71db1c-ecc1-396f-8a36-6f0b92ff378f/hls1/main/0.ts

{"Protocol":0,"Id":"cd71db1cecc1396f8a366f0b92ff378f","Path":"/media/mediacenter/Video/Test2.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":2577501440,"Name":"Test2","IsRemote":false,"ETag":"c35119c481be770fda51b4f8d001310a","RunTimeTicks":81191362560,"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":"h264","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt709","ColorTransfer":"bt709","ColorPrimaries":"bt709","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":"SDR","VideoRangeType":"SDR","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"720p H264 SDR","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"ChannelLayout":null,"BitRate":2539680,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":688,"Width":1280,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"High","Type":1,"AspectRatio":"1.85:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":"ita","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":"AC3 @ 384 kbps 5.1 Italian","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"AC3 @ 384 kbps 5.1 Italian - Dolby Digital - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":384000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":44100,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"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":"eng","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":"AC3 @ 448 kbps 5.1 English","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"AC3 @ 448 kbps 5.1 English - Dolby Digital","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"ita","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":"Sub Ita","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Ita - Italian - SUBRIP","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"eng","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":"Sub Eng","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Eng - English - SUBRIP","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":3371680,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/snap/itrue-jellyfin/103/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:/dev/dri/renderD128 -filter_hw_device va -autorotate 0 -i file:"/media/mediacenter/Video/Test2.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 292000 -maxrate 292000 -bufsize 584000 -profile:v:0 high -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,426)/2)*2:trunc(ow/a/2)*2,format=nv12,hwupload_vaapi" -codec:a:0 libfdk_aac -ac 6 -ab 128000 -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 "/var/snap/itrue-jellyfin/common/data/transcodes/c516096aab504c759a6774fd36f303e6%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/snap/itrue-jellyfin/common/data/transcodes/c516096aab504c759a6774fd36f303e6.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --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-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --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
Input #0, matroska,webm, from 'file:/media/mediacenter/Video/Test2.mkv':
  Metadata:
    encoder         : libebml v1.3.1 + libmatroska v1.4.2
    creation_time   : 2015-08-20T20:01:04.000000Z
  Duration: 02:15:19.14, start: 0.000000, bitrate: 2539 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x688 [SAR 1:1 DAR 80:43], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      BPS             : 1705146
      BPS-eng         : 1705146
      DURATION        : 02:15:19.028000000
      DURATION-eng    : 02:15:19.028000000
      NUMBER_OF_FRAMES: 194662
      NUMBER_OF_FRAMES-eng: 194662
      NUMBER_OF_BYTES : 1730516819
      NUMBER_OF_BYTES-eng: 1730516819
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(ita): Audio: ac3, 44100 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : AC3 @ 384 kbps 5.1 Italian
      BPS             : 383999
      BPS-eng         : 383999
      DURATION        : 02:15:19.136000000
      DURATION-eng    : 02:15:19.136000000
      NUMBER_OF_FRAMES: 233108
      NUMBER_OF_FRAMES-eng: 233108
      NUMBER_OF_BYTES : 389718516
      NUMBER_OF_BYTES-eng: 389718516
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Metadata:
      title           : AC3 @ 448 kbps 5.1 English
      BPS             : 448000
      BPS-eng         : 448000
      DURATION        : 02:15:19.072000000
      DURATION-eng    : 02:15:19.072000000
      NUMBER_OF_FRAMES: 253721
      NUMBER_OF_FRAMES-eng: 253721
      NUMBER_OF_BYTES : 454668032
      NUMBER_OF_BYTES-eng: 454668032
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:3(ita): Subtitle: subrip
    Metadata:
      title           : Sub Ita
      BPS             : 48
      BPS-eng         : 48
      DURATION        : 02:07:14.683000000
      DURATION-eng    : 02:07:14.683000000
      NUMBER_OF_FRAMES: 1400
      NUMBER_OF_FRAMES-eng: 1400
      NUMBER_OF_BYTES : 46588
      NUMBER_OF_BYTES-eng: 46588
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:4(eng): Subtitle: subrip
    Metadata:
      title           : Sub Eng
      BPS             : 51
      BPS-eng         : 51
      DURATION        : 02:06:56.441000000
      DURATION-eng    : 02:06:56.441000000
      NUMBER_OF_FRAMES: 1564
      NUMBER_OF_FRAMES-eng: 1564
      NUMBER_OF_BYTES : 49166
      NUMBER_OF_BYTES-eng: 49166
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x55cbb7b38580] Driver does not support VBR RC mode (supported modes: CQP).
[vost#0:0/h264_vaapi @ 0x55cbb7b38080] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libfdk_aac @ 0x55cbb7b3dfc0] 2 frames left in the queue on closing
Conversion failed!

I also tried with VAAPI and this is the result (I've seen two different kind of errors):
VAAPI-1:

/videos/cd71db1c-ecc1-396f-8a36-6f0b92ff378f/hls1/main/0.ts

{"Protocol":0,"Id":"cd71db1cecc1396f8a366f0b92ff378f","Path":"/media/mediacenter/Video/Test2.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":2577501440,"Name":"Test2","IsRemote":false,"ETag":"c35119c481be770fda51b4f8d001310a","RunTimeTicks":81191362560,"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":"h264","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":"bt709","ColorTransfer":"bt709","ColorPrimaries":"bt709","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":"SDR","VideoRangeType":"SDR","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"720p H264 SDR","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"ChannelLayout":null,"BitRate":2539680,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"Height":688,"Width":1280,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"High","Type":1,"AspectRatio":"1.85:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":"ita","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":"AC3 @ 384 kbps 5.1 Italian","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"AC3 @ 384 kbps 5.1 Italian - Dolby Digital - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":384000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":44100,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"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":"eng","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":"AC3 @ 448 kbps 5.1 English","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"AC3 @ 448 kbps 5.1 English - Dolby Digital","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"ita","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":"Sub Ita","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Ita - Italian - SUBRIP","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"subrip","CodecTag":null,"Language":"eng","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":"Sub Eng","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Eng - English - SUBRIP","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":3371680,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/snap/itrue-jellyfin/103/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:/dev/dri/renderD128 -filter_hw_device va -autorotate 0 -i file:"/media/mediacenter/Video/Test2.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 292000 -maxrate 292000 -bufsize 584000 -profile:v:0 high -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,426)/2)*2:trunc(ow/a/2)*2,format=nv12,hwupload_vaapi" -codec:a:0 libfdk_aac -ac 6 -ab 128000 -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 "/var/snap/itrue-jellyfin/common/data/transcodes/c516096aab504c759a6774fd36f303e6%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/snap/itrue-jellyfin/common/data/transcodes/c516096aab504c759a6774fd36f303e6.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --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-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --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
Input #0, matroska,webm, from 'file:/media/mediacenter/Video/Test2.mkv':
  Metadata:
    encoder         : libebml v1.3.1 + libmatroska v1.4.2
    creation_time   : 2015-08-20T20:01:04.000000Z
  Duration: 02:15:19.14, start: 0.000000, bitrate: 2539 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x688 [SAR 1:1 DAR 80:43], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      BPS             : 1705146
      BPS-eng         : 1705146
      DURATION        : 02:15:19.028000000
      DURATION-eng    : 02:15:19.028000000
      NUMBER_OF_FRAMES: 194662
      NUMBER_OF_FRAMES-eng: 194662
      NUMBER_OF_BYTES : 1730516819
      NUMBER_OF_BYTES-eng: 1730516819
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(ita): Audio: ac3, 44100 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : AC3 @ 384 kbps 5.1 Italian
      BPS             : 383999
      BPS-eng         : 383999
      DURATION        : 02:15:19.136000000
      DURATION-eng    : 02:15:19.136000000
      NUMBER_OF_FRAMES: 233108
      NUMBER_OF_FRAMES-eng: 233108
      NUMBER_OF_BYTES : 389718516
      NUMBER_OF_BYTES-eng: 389718516
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Metadata:
      title           : AC3 @ 448 kbps 5.1 English
      BPS             : 448000
      BPS-eng         : 448000
      DURATION        : 02:15:19.072000000
      DURATION-eng    : 02:15:19.072000000
      NUMBER_OF_FRAMES: 253721
      NUMBER_OF_FRAMES-eng: 253721
      NUMBER_OF_BYTES : 454668032
      NUMBER_OF_BYTES-eng: 454668032
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:3(ita): Subtitle: subrip
    Metadata:
      title           : Sub Ita
      BPS             : 48
      BPS-eng         : 48
      DURATION        : 02:07:14.683000000
      DURATION-eng    : 02:07:14.683000000
      NUMBER_OF_FRAMES: 1400
      NUMBER_OF_FRAMES-eng: 1400
      NUMBER_OF_BYTES : 46588
      NUMBER_OF_BYTES-eng: 46588
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:4(eng): Subtitle: subrip
    Metadata:
      title           : Sub Eng
      BPS             : 51
      BPS-eng         : 51
      DURATION        : 02:06:56.441000000
      DURATION-eng    : 02:06:56.441000000
      NUMBER_OF_FRAMES: 1564
      NUMBER_OF_FRAMES-eng: 1564
      NUMBER_OF_BYTES : 49166
      NUMBER_OF_BYTES-eng: 49166
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2015-08-20 20:01:04
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-08-20 20:01:04
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[h264_vaapi @ 0x55cbb7b38580] Driver does not support VBR RC mode (supported modes: CQP).
[vost#0:0/h264_vaapi @ 0x55cbb7b38080] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libfdk_aac @ 0x55cbb7b3dfc0] 2 frames left in the queue on closing
Conversion failed!

VAAPI-2:

/videos/5daa7d17-0be4-c10f-5fcf-fd52e03e040f/hls1/main/0.ts

{"Protocol":0,"Id":"5daa7d170be4c10f5fcffd52e03e040f","Path":"/media/mediacenter/Video/test.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv,webm","Size":5920864768,"Name":"Test","IsRemote":false,"ETag":"0b12470508e02267ac745b4a4a3bac6a","RunTimeTicks":140293111808,"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":"hevc","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":"Video H.265 (Encoded by ZMachine)","VideoRange":"SDR","VideoRangeType":"SDR","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Video H.265 (Encoded by ZMachine) - 1080p - HEVC - SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":3376282,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":true,"Height":812,"Width":1920,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main","Type":1,"AspectRatio":"2.35:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":120,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":"ita","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":"Audio AC3","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Audio AC3 - Italian - Dolby Digital - 5.1 - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":1,"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":"eng","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":"Audio AC3","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Audio AC3 - English - Dolby Digital - 5.1","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":448000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"ita","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":"Sub Forced","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Forced - Italian - Predefinito - Forzato - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":true,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"eng","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":"Sub Forced","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub Forced - English - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"ita","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":"Sub","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub - Italian - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":5,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ass","CodecTag":null,"Language":"eng","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":"Sub","VideoRange":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":"Non Definito","LocalizedDefault":"Predefinito","LocalizedForced":"Forzato","LocalizedExternal":"External","DisplayTitle":"Sub - English - ASS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":6,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":4272282,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/snap/itrue-jellyfin/103/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:/dev/dri/renderD128 -filter_hw_device va -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"/media/mediacenter/Video/test.mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 292000 -maxrate 292000 -bufsize 584000 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=w=426:h=180:format=nv12:extra_hw_frames=24" -codec:a:0 libfdk_aac -ac 6 -ab 128000 -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 "/var/snap/itrue-jellyfin/common/data/transcodes/f7f42b8b06eb6b7976ac44fdb4b843d3%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/snap/itrue-jellyfin/common/data/transcodes/f7f42b8b06eb6b7976ac44fdb4b843d3.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --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-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --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
Input #0, matroska,webm, from 'file:/media/mediacenter/Video/test.mkv':
  Metadata:
    title           : Test - Special Edition <ZMachine>
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-05-15T18:20:43.000000Z
  Duration: 03:53:49.31, start: 0.000000, bitrate: 3376 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 301.050733
      Metadata:
        title           : Main Title; a Wounded Man
    Chapter #0:1: start 301.050733, end 706.664289
      Metadata:
        title           : St. David's Field, Tennessee
    Chapter #0:2: start 706.664289, end 1219.760200
      Metadata:
        title           : Fort Hayes
    Chapter #0:3: start 1219.760200, end 1601.349733
      Metadata:
        title           : Journey to the Furthermost Outpost
    Chapter #0:4: start 1601.349733, end 2170.168000
      Metadata:
        title           : Clean-Up Duty
    Chapter #0:5: start 2170.168000, end 2539.620400
      Metadata:
        title           : The Ruthless Pawnee
    Chapter #0:6: start 2539.620400, end 2842.381200
      Metadata:
        title           : Contact with the Sioux
    Chapter #0:7: start 2842.381200, end 3170.625778
      Metadata:
        title           : Riding Out to the Indians
    Chapter #0:8: start 3170.625778, end 3414.035622
      Metadata:
        title           : Meeting with the White Man
    Chapter #0:9: start 3414.035622, end 3837.208356
      Metadata:
        title           : Stands with a Fist (Christine)
    Chapter #0:10: start 3837.208356, end 4189.351822
      Metadata:
        title           : Invited to the Village
    Chapter #0:11: start 4189.351822, end 4307.594956
      Metadata:
        title           : The Buffalo Return
    Chapter #0:12: start 4307.594956, end 4798.960822
      Metadata:
        title           : The Hunt
    Chapter #0:13: start 4798.960822, end 5133.753622
      Metadata:
        title           : A Good Trade
    Chapter #0:14: start 5133.753622, end 5552.922356
      Metadata:
        title           : Dances with Wolves
    Chapter #0:15: start 5552.922356, end 6113.065289
      Metadata:
        title           : Bestowed a Great Honor
    Chapter #0:16: start 6113.065289, end 6824.234067
      Metadata:
        title           : Falling in Love
    Chapter #0:17: start 6824.234067, end 6977.261956
      Metadata:
        title           : Attack of the Pawnee
    Chapter #0:18: start 6977.261956, end 7472.047911
      Metadata:
        title           : Told to Mourn No More
    Chapter #0:19: start 7472.047911, end 7984.226244
      Metadata:
        title           : Like the Stars
    Chapter #0:20: start 7984.226244, end 8334.117444
      Metadata:
        title           : Retrieving the Journal
    Chapter #0:21: start 8334.117444, end 8854.846000
      Metadata:
        title           : Do You Salute Him or Shoot Him?
    Chapter #0:22: start 8854.846000, end 9489.104622
      Metadata:
        title           : A Little Help From Friends
    Chapter #0:23: start 9489.104622, end 9740.814400
      Metadata:
        title           : Leaving for the Good of the Tribe
    Chapter #0:24: start 9740.814400, end 10382.330289
      Metadata:
        title           : End Credits
    Chapter #0:25: start 10382.330289, end 11039.695333
      Metadata:
        title           : Permission to Love
    Chapter #0:26: start 11039.695333, end 11595.709111
      Metadata:
        title           : The Most Important Trail
    Chapter #0:27: start 11595.709111, end 12056.044000
      Metadata:
        title           : "Turned Injun, Didn'cha?"
    Chapter #0:28: start 12056.044000, end 12454.066622
      Metadata:
        title           : Traitor Status
    Chapter #0:29: start 12454.066622, end 12937.341067
      Metadata:
        title           : Wolves and Other Animals
    Chapter #0:30: start 12937.341067, end 13705.316622
      Metadata:
        title           : Parting Gifts
    Chapter #0:31: start 13705.316622, end 14029.015000
      Metadata:
        title           : Epilogue/Credits
    Chapter #0:32: start 14029.015000, end 14029.312000
      Metadata:
        title           : 
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x812, SAR 1:1 DAR 480:203, 23.98 fps, 23.98 tbr, 1k tbn (default) (forced)
    Metadata:
      title           : Video H.265 (Encoded by ZMachine)
  Stream #0:1(ita): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : Audio AC3
  Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Metadata:
      title           : Audio AC3
  Stream #0:3(ita): Subtitle: ass (default) (forced)
    Metadata:
      title           : Sub Forced
  Stream #0:4(eng): Subtitle: ass
    Metadata:
      title           : Sub Forced
  Stream #0:5(ita): Subtitle: ass
    Metadata:
      title           : Sub
  Stream #0:6(eng): Subtitle: ass
    Metadata:
      title           : Sub
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[Parsed_scale_vaapi_1 @ 0x555699845f00] Failed to create processing pipeline config: 12 (the requested VAProfile is not supported).
[Parsed_scale_vaapi_1 @ 0x555699845f00] Failed to configure output pad on Parsed_scale_vaapi_1
Error reinitializing filters!
Failed to inject frame into filter network: Input/output error
Error while processing the decoded data for stream #0:0
[libfdk_aac @ 0x555698d8ed80] 2 frames left in the queue on closing
Conversion failed!

I can correctly transcode both files if I set the Hardware acceleration to none (but with a huge CPU effort).

I can think that maybe you used old repository related to Ubuntu 22.04, but there it seems there are old drivers and va-api drivers. This is why I updated to Ubuntu 23.10.

So here the result of the vainfo:
**vainfo --display drm**

libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.2.3 ()
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
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

And here the result of itrue-jellyfin.vainfo:
**itrue-jellyfin.vainfo --display drm**

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

Could be the problem be there?

@energywave
Copy link
Author

Some more info. I was trying to encode using ffmpeg a sample file on the machine and it correctly use QSV.
In Ubuntu 23.10, ffmpeg 6.0-6ubuntu1.
This is the command I'm using to test:
ffmpeg -hwaccel qsv -c:v h264_qsv -i SampleVideo_1280x720_30mb.mp4 -c:v h264_qsv -global_quality 25 -maxrate 2M test.mp4 -v verbose
With intel_gpu_top I can see the Video component of the GPU going close to 100% while transcoding, furthermore I get more than 150fps while I get no more than 23 fps without specifying hwaccel.

So I know my hardware/drivers is ok (wanted to exclude that).

I could not encode, however, using itrue-jellyfin.ffmpeg as I get a permission denied error with my user as well as with sudo by loading the input file in my /home/user

Here some more output, if could be useful:

itrue-jellyfin.ffmpeg -hwaccels

ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --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-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --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
Hardware acceleration methods:
cuda
vaapi
qsv
drm
opencl
vulkan

itrue-jellyfin.clinfo
Number of platforms 0

@energywave
Copy link
Author

Tested again after the refresh, no luck.
By using QSV or VA-API and watching the intel_gpu_top on the console I can see a ffmpeg process and some GPU usage for a fraction when starting to play something with reduced bandwidth but then it stops and I get the error on the client.
So, no luck again with hardware transcoding. I know it works on the host, but not in the snap. I'm tempted to try an install on the host directly to see if it works correctly there.
Same result posted above with itrue-jellyfin.vainfo --display drm and itrue-jellyfin.ffmpeg -hwaccels.

@jmgiaever
Copy link

Hi,

Could it be the package intel-media-va-driver-non-free is missing? ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants