diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js index 4d902ae..d88dcdb 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js @@ -4,10 +4,9 @@ exports.plugin = exports.details = void 0; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ var details = function () { return ({ name: 'Custom Arguments', - description: 'Custom Arguments', + description: 'Set FFmpeg custome input and output arguments', style: { borderColor: '#6efefc', - opacity: 0.5, }, tags: 'video', isStartPlugin: false, @@ -15,7 +14,26 @@ var details = function () { return ({ requiresVersion: '2.11.01', sidebarPosition: -1, icon: '', - inputs: [], + inputs: [ + { + name: 'inputArguments', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify input arguments', + }, + { + name: 'outputArguments', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify output arguments', + }, + ], outputs: [ { number: 1, @@ -26,9 +44,18 @@ var details = function () { return ({ exports.details = details; // eslint-disable-next-line @typescript-eslint/no-unused-vars var plugin = function (args) { + var _a, _b; var lib = require('../../../../../methods/lib')(); // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); + var inputArguments = String(args.inputs.inputArguments); + var outputArguments = String(args.inputs.outputArguments); + if (inputArguments) { + (_a = args.variables.ffmpegCommand.overallInputArguments).push.apply(_a, inputArguments.split(' ')); + } + if (outputArguments) { + (_b = args.variables.ffmpegCommand.overallOuputArguments).push.apply(_b, outputArguments.split(' ')); + } return { outputFileObj: args.inputFileObj, outputNumber: 1, diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js index 628bd27..cd9ac1f 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js @@ -107,7 +107,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function cliArgs.push('-y'); cliArgs.push('-i'); cliArgs.push(args.inputFileObj._id); - inputArgs = []; + inputArgs = __spreadArray([], args.variables.ffmpegCommand.overallInputArguments, true); _a = args.variables.ffmpegCommand, shouldProcess = _a.shouldProcess, streams = _a.streams; streams = streams.filter(function (stream) { if (stream.removed) { @@ -150,6 +150,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function } idx = cliArgs.indexOf('-i'); cliArgs.splice.apply(cliArgs, __spreadArray([idx, 0], inputArgs, false)); + cliArgs.push.apply(cliArgs, args.variables.ffmpegCommand.overallOuputArguments); outputFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id)) + ".".concat(args.variables.ffmpegCommand.container); cliArgs.push(outputFilePath); diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts index 799dda5..e5c8c99 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts @@ -7,10 +7,9 @@ import { /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ const details = () :IpluginDetails => ({ name: 'Custom Arguments', - description: 'Custom Arguments', + description: 'Set FFmpeg custome input and output arguments', style: { borderColor: '#6efefc', - opacity: 0.5, }, tags: 'video', isStartPlugin: false, @@ -18,7 +17,27 @@ const details = () :IpluginDetails => ({ requiresVersion: '2.11.01', sidebarPosition: -1, icon: '', - inputs: [], + inputs: [ + { + name: 'inputArguments', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify input arguments', + }, + + { + name: 'outputArguments', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify output arguments', + }, + ], outputs: [ { number: 1, @@ -33,6 +52,17 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign args.inputs = lib.loadDefaultValues(args.inputs, details); + const inputArguments = String(args.inputs.inputArguments); + const outputArguments = String(args.inputs.outputArguments); + + if (inputArguments) { + args.variables.ffmpegCommand.overallInputArguments.push(...inputArguments.split(' ')); + } + + if (outputArguments) { + args.variables.ffmpegCommand.overallOuputArguments.push(...outputArguments.split(' ')); + } + return { outputFileObj: args.inputFileObj, outputNumber: 1, diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts index b3a1125..4ec2b6c 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts @@ -74,7 +74,9 @@ const plugin = async (args: IpluginInputArgs): Promise => { cliArgs.push('-i'); cliArgs.push(args.inputFileObj._id); - const inputArgs: string[] = []; + const inputArgs: string[] = [ + ...args.variables.ffmpegCommand.overallInputArguments, + ]; let { shouldProcess, streams } = args.variables.ffmpegCommand; streams = streams.filter((stream) => { @@ -123,6 +125,7 @@ const plugin = async (args: IpluginInputArgs): Promise => { const idx = cliArgs.indexOf('-i'); cliArgs.splice(idx, 0, ...inputArgs); + cliArgs.push(...args.variables.ffmpegCommand.overallOuputArguments); const outputFilePath = `${getPluginWorkDir(args)}/${getFileName(args.inputFileObj._id)}` + `.${args.variables.ffmpegCommand.container}`;