From 95ec657cfd12847927b8b5c1d32ffe6449979cb2 Mon Sep 17 00:00:00 2001 From: Boosh1 <45874141+Boosh1@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:55:45 +0100 Subject: [PATCH 1/3] Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js Fixed up an issue with HW decoding. If the -hwaccel qsv is set then ffmpeg seems to automatically enable hw decoding even when we don't want it. There's been several reports of issues with certain files & I think this is the cause. I've tested and that appears to resolve the transcode error --- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 4d462242d..affed14f3 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -731,20 +731,23 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // HW ACCEL FLAGS // Account for different OS - switch (os.platform()) { - case 'darwin': // Mac OS - Enable videotoolbox instead of QSV - response.preset += '-hwaccel videotoolbox'; - break; - case 'linux': // Linux - Full device, should fix child_device_type warnings - response.preset += `-hwaccel qsv -hwaccel_output_format qsv + if (main10 === false) { + // On testing it seems the below will automatically enable hardware decoding which causes issues... + switch (os.platform()) { + case 'darwin': // Mac OS - Enable videotoolbox instead of QSV + response.preset += '-hwaccel videotoolbox'; + break; + case 'linux': // Linux - Full device, should fix child_device_type warnings + response.preset += `-hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=vaapi `; - break; - case 'win32': // Windows - Full device, should fix child_device_type warnings - response.preset += `-hwaccel qsv -hwaccel_output_format qsv + break; + case 'win32': // Windows - Full device, should fix child_device_type warnings + response.preset += `-hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=d3d11va `; - break; - default: - response.preset += '-hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any '; + break; + default: + response.preset += '-hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any '; + } } // DECODE FLAGS From 80827b96602c4ac99ff27ea108bab869c17625bf Mon Sep 17 00:00:00 2001 From: Boosh1 <45874141+Boosh1@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:31:37 +0100 Subject: [PATCH 2/3] Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js Think that'll sort the tests. --- .../Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index e3f134cb3..d6bf1a218 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -79,8 +79,7 @@ const tests = [ output: { linux: { processFile: true, - preset: '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n' - + ' -init_hw_device qsv:hw_any,child_device_type=vaapi -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, @@ -97,8 +96,7 @@ const tests = [ }, win32: { processFile: true, - preset: '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n' - + ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, @@ -115,7 +113,7 @@ const tests = [ }, darwin: { processFile: true, - preset: '-fflags +genpts -hwaccel videotoolbox -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, From 97358bb51db3b2b47276ba92b305e5323c04e5c4 Mon Sep 17 00:00:00 2001 From: Boosh1 <45874141+Boosh1@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:39:38 +0100 Subject: [PATCH 3/3] Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js Another test fix --- tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index d6bf1a218..4ce99d26e 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -79,7 +79,7 @@ const tests = [ output: { linux: { processFile: true, - preset: '-fflags +genpts -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, @@ -96,7 +96,7 @@ const tests = [ }, win32: { processFile: true, - preset: '-fflags +genpts -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, @@ -113,7 +113,7 @@ const tests = [ }, darwin: { processFile: true, - preset: '-fflags +genpts -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', + preset: '-fflags +genpts -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true,