From 09b89babf97ad08166765aa9284c3ca43884d054 Mon Sep 17 00:00:00 2001 From: tws101 Date: Thu, 23 May 2024 14:38:16 -0500 Subject: [PATCH] Add files via upload --- .../1.0.0/index.ts | 11 ++++++++--- .../ffmpegCommandSetContainer/1.0.0/index.ts | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveStreamByProperty/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveStreamByProperty/1.0.0/index.ts index 5a9c987..5569344 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveStreamByProperty/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveStreamByProperty/1.0.0/index.ts @@ -88,6 +88,12 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { const valuesToRemove = String(args.inputs.valuesToRemove).trim().split(','); const condition = String(args.inputs.condition); + const valuesToRemoveTrimed: Array = []; + valuesToRemove.forEach((element) => { + const trimedElement = element.trim(); + valuesToRemoveTrimed.push(trimedElement); + }); + args.variables.ffmpegCommand.streams.forEach((stream) => { let target = ''; if (propertyToCheck.includes('.')) { @@ -99,9 +105,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { if (target) { const prop = String(target).toLowerCase(); - for (let i = 0; i < valuesToRemove.length; i += 1) { - const val = valuesToRemove[i].toLowerCase(); - + for (let i = 0; i < valuesToRemoveTrimed.length; i += 1) { + const val = valuesToRemoveTrimed[i].toLowerCase(); const prefix = `Removing stream index ${stream.index} because ${propertyToCheck} of ${prop}`; if (condition === 'includes' && prop.includes(val)) { args.jobLog(`${prefix} includes ${val}\n`); diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts index 2ed84f9..79dfc9a 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts @@ -93,11 +93,14 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { if (newContainer === 'mp4') { if ( - [ + codecType === 'attachment' + || [ 'hdmv_pgs_subtitle', 'eia_608', 'timed_id3', 'subrip', + 'ass', + 'ssa', ].includes(codecName) ) { stream.removed = true; @@ -108,6 +111,18 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { } } } + // handle gents if coming from odd container + const container = args.inputFileObj.container.toLowerCase(); + if ( + [ + 'ts', + 'avi', + 'mpg', + 'mpeg', + ].includes(container) + ) { + args.variables.ffmpegCommand.overallOuputArguments.push('-fflags', '+genpts'); + } } return {