2024-05-20, 06:22 PM
Here is the ffmpeg command from a tone mapped stream. Perhaps something can be adapted for your purposes?
In the filter complex it calls out both VAAPI and QSV. And since earlier in the command it configures "-init_hw_device opencl=ocl@va", could you do something similar for your command? Instead of "scale_opencl" it would be "scale_vaapi"? Etc.
Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -canvas_size 1920x1080 -i file:"/media/library/Movies/Dune (2021)/Dune.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:0 -codec:v:0 h264_qsv -low_power 1 -preset veryfast -look_ahead 0 -b:v 13305202 -maxrate 13305202 -bufsize 26610404 -g:v:0 72 -keyint_min:v:0 72 -filter_complex "[0:6]scale=-1:1080:fast_bilinear,scale,crop,pad=max(2592\,iw):max(1080\,ih):(ow-iw)/2:(oh-ih)/2:black@0,crop=2592:1080,format=bgra,hwupload=derive_device=qsv:extra_hw_frames=64[sub];[0:0]setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,procamp_vaapi=b=16:c=1,tonemap_vaapi=format=nv12:p=bt709:t=bt709:m=bt709:extra_hw_frames=32,hwmap=derive_device=qsv,format=qsv[main];[main][sub]overlay_qsv=eof_action=pass:repeatlast=0:w=3840:h=1600" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 256000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "2a73e6555e0f365751b7712a4297833f-1.mp4" -start_number 0 -hls_segment_filename "/config/transcodes/2a73e6555e0f365751b7712a4297833f%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/2a73e6555e0f365751b7712a4297833f.m3u8"
In the filter complex it calls out both VAAPI and QSV. And since earlier in the command it configures "-init_hw_device opencl=ocl@va", could you do something similar for your command? Instead of "scale_opencl" it would be "scale_vaapi"? Etc.