From 474c660467ee1a302c0135106a109723c4090a9c Mon Sep 17 00:00:00 2001 From: Jeff Hessenflow Date: Thu, 29 Sep 2022 14:35:50 -0500 Subject: [PATCH 1/3] Set genpts to fix unknown timestamp for .ts or .avi Incorporated code included in Tdarr_Plugin_MC93_Migz1FFMPEG.js Add mpeg4 Decode Migz GPU (#289) @Fish2 Fish2 committed on Apr 10 fix unknown timestamp fix for ts and avi for migz gpu (#292) --- Community/Tdarr_Plugin_MC93_Migz1Remux.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 37eed73..994ce8c 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -6,7 +6,7 @@ const details = () => ({ Type: 'Video', Operation: 'Transcode', Description: 'Files will be remuxed into either mkv or mp4. \n\n', - Version: '1.1', + Version: '1.2', Tags: 'pre-processing,ffmpeg,video only,configurable', Inputs: [{ name: 'container', @@ -80,7 +80,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // Set up required variables. let extraArguments = ''; + let genpts = ''; let convert = false; + + // If Container .ts or .avi set genpts to fix unknown timestamp + if (inputs.container.toLowerCase() === 'ts' || inputs.container.toLowerCase() === 'avi') { + genpts = '-fflags +genpts'; + } // Check if force_conform option is checked. // If so then check streams and add any extra parameters required to make file conform with output format. @@ -136,7 +142,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (convert === true) { - response.preset += `, -map 0 -c copy -max_muxing_queue_size 9999 ${extraArguments}`; + response.preset += `${genpts}, -map 0 -c copy -max_muxing_queue_size 9999 ${extraArguments}`; response.processFile = true; return response; } From 42185644eeaf3a0051511d0de95e8c7099cbc44e Mon Sep 17 00:00:00 2001 From: Jeff Hessenflow Date: Thu, 29 Sep 2022 16:04:47 -0500 Subject: [PATCH 2/3] Swapped input.container to file.container for genpts logic Swapped input.container to file.container for genpts logic --- Community/Tdarr_Plugin_MC93_Migz1Remux.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 994ce8c..499bc9d 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -83,11 +83,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let genpts = ''; let convert = false; - // If Container .ts or .avi set genpts to fix unknown timestamp - if (inputs.container.toLowerCase() === 'ts' || inputs.container.toLowerCase() === 'avi') { - genpts = '-fflags +genpts'; - } - // Check if force_conform option is checked. // If so then check streams and add any extra parameters required to make file conform with output format. if (inputs.force_conform === true) { @@ -140,6 +135,12 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.infoLog += `☑File is already in ${inputs.container} container. \n`; return response; } + + // If Container .ts or .avi set genpts to fix unknown timestamp + if (file.container.toLowerCase() === 'ts' || file.container.toLowerCase() === 'avi') { + genpts = '-fflags +genpts'; + } + if (convert === true) { response.preset += `${genpts}, -map 0 -c copy -max_muxing_queue_size 9999 ${extraArguments}`; From 2613115e13a95e3bc95d8a08994887e3e5333bad Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:23:12 +0100 Subject: [PATCH 3/3] Run lint --- Community/Tdarr_Plugin_MC93_Migz1Remux.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 499bc9d..9ba65b7 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -82,7 +82,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let extraArguments = ''; let genpts = ''; let convert = false; - + // Check if force_conform option is checked. // If so then check streams and add any extra parameters required to make file conform with output format. if (inputs.force_conform === true) { @@ -135,13 +135,12 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.infoLog += `☑File is already in ${inputs.container} container. \n`; return response; } - + // If Container .ts or .avi set genpts to fix unknown timestamp if (file.container.toLowerCase() === 'ts' || file.container.toLowerCase() === 'avi') { genpts = '-fflags +genpts'; } - if (convert === true) { response.preset += `${genpts}, -map 0 -c copy -max_muxing_queue_size 9999 ${extraArguments}`; response.processFile = true;