2024-06-28, 09:23 PM
Okay, so I was able to put together a hybrid encoding script to allow the use of nlmeans_opencl. The impact to performance is SIGNIFICANT, so I may end up looking for other solutions, but this is pretty cool and I did use suggestions from our resident ffmpeg expert earlier in the thread. Take a look!
This snippet shows the use of tonemap_opencl, scale_opencl (<3 lanczos), and nlmeans_opencl all verified working. The nlmeans_opencl variables were taken from a recommendation seen elsewhere...I'm not an expert on modifying those, but these are a good starting point.
Code:
cd "/path/to/input/SOURCE_MEDIA (1991)" && \
mkdir -p "/path/to/output/FINAL_MEDIA (1991)" && \
jffmpeg -y -hide_banner -v verbose -stats \
-init_hw_device vaapi=hw:/dev/dri/renderD129 -init_hw_device qsv=qs@hw -init_hw_device opencl=ocl@hw -filter_hw_device ocl \
-analyzeduration 200M -probesize 1G \
-i "SOURCE_MEDIA.mkv" \
-map 0 -map -0:a -map -0:s -map -0:t? -map 0:a:1 -map 0:a:0 -map 0:s:1 -map 0:s:0 \
-c copy -c:v:0 "av1_qsv" -preset "veryslow" \
-global_quality:v:0 22 -low_delay_brc 1 -extbrc 1 -look_ahead_depth 100 \
-filter:v:0 "hwupload=extra_hw_frames=64,tonemap_opencl=tonemap=bt2390:format=yuv420p,nlmeans_opencl=1.0:7:5:3:3,scale_opencl=algo=lanczos:h=1080:w=-1:format=yuv420p,hwdownload,format=yuv420p" \
-c:a libopus -b:a:0 160k -ac:a:0 2 -b:a:1 256k -ac:a:1 6 \
-metadata title="FINAL_MEDIA (1991)" \
-metadata:s:v:0 title='AV1 Encoding by bitmap' \
-metadata:s:a:0 title='Stereo' -metadata:s:a:0 language='eng' -disposition:a:0 default \
-metadata:s:a:1 title='5.1 Surround' -metadata:s:a:1 language='eng' -disposition:a:1 0 \
-metadata:s:s:0 title='English' -metadata:s:s:0 language='eng' -disposition:s:0 0 \
-metadata:s:s:1 title='English (SDH)' -metadata:s:s:1 language='eng' -disposition:s:1 0 \
"/path/to/output/FINAL_MEDIA (1991)/FINAL_MEDIA (1991).mkv"
This snippet shows the use of tonemap_opencl, scale_opencl (<3 lanczos), and nlmeans_opencl all verified working. The nlmeans_opencl variables were taken from a recommendation seen elsewhere...I'm not an expert on modifying those, but these are a good starting point.
Jellyfin 10.10.0 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage