From a17a6d5de08967e10823b0caeaeb8f5185c03832 Mon Sep 17 00:00:00 2001 From: dexeonify <72267349+dexeonify@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:48:48 +0800 Subject: [PATCH] Use ffmpeg for thumbnailer Finally, we compile the results using the best workers/threads combination for each option from 02b6f6e and c403b41: | mpv/ffmpeg | Samples | | ------------ | H.264 | HEVC | VP9 | AV1 | | mpv (8/2) | 10s | 29s | 57s | 16s | | ffmpeg (4/2) | 10s | 29s | 47s | 71s | However, I'm not convinced with the results as there were two outliers. So, I decided to test another set, this time focusing only on VP9 and AV1 videos. | mpv/ffmpeg | Samples | | ------------ | VP9_1 | AV1_1 | AV1_2 | | mpv (8/2) | 35s | 49s | 127s | | ffmpeg (4/2) | 28s | 41s | 108s | That's more like it; ffmpeg is now consistently equal to or faster than mpv in all cases. I wonder which of my encoding settings skyrocketed mpv but crippled ffmpeg... --- script-opts/thumbnailer.conf | 4 ++-- scripts/Thumbnailer.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script-opts/thumbnailer.conf b/script-opts/thumbnailer.conf index 2ea9072..67f9db0 100644 --- a/script-opts/thumbnailer.conf +++ b/script-opts/thumbnailer.conf @@ -29,13 +29,13 @@ bitrate_delta_factor=1 #update_time=0.25 # Worker -max_workers=8 +max_workers=4 worker_remote_factor=1 #worker_bitrate_factor=1 #worker_delay=1 #worker_timeout=5 #accurate_seek=yes -#use_ffmpeg=yes +use_ffmpeg=yes #prefer_ffmpeg=yes ffmpeg_threads=2 #ffmpeg_scaler=spline diff --git a/scripts/Thumbnailer.lua b/scripts/Thumbnailer.lua index f978438..125ae58 100644 --- a/scripts/Thumbnailer.lua +++ b/scripts/Thumbnailer.lua @@ -295,7 +295,7 @@ local function worker_set_options() ffmpeg_threads = user_opts.ffmpeg_threads, ffmpeg_scaler = user_opts.ffmpeg_scaler, ffmpeg_hwaccel = user_opts.ffmpeg_hwaccel, - ffmpeg_hwaccel_device = user_opts.ffmpeg_hwaccel_device + ffmpeg_hwaccel_device = user_opts.ffmpeg_hwaccel_device } end