diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js index f834647..57d6fb2 100644 --- a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js @@ -96,7 +96,7 @@ var getOuputStreamTypeIndex = function (streams, stream) { }; // eslint-disable-next-line @typescript-eslint/no-unused-vars var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { - var lib, cliArgs, _a, shouldProcess, streams, inputArgs, _loop_1, i, idx, outputFilePath, cli, res; + var lib, cliArgs, _a, shouldProcess, streams, inputArgs, _loop_1, i, idx, outputFilePath, spawnArgs, cli, res; return __generator(this, function (_b) { switch (_b.label) { case 0: @@ -160,18 +160,19 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function outputFilePath = "".concat((0, fileUtils_1.getPluginWorkDir)(args), "/").concat((0, fileUtils_1.getFileName)(args.inputFileObj._id)) + ".".concat(args.variables.ffmpegCommand.container); cliArgs.push(outputFilePath); + spawnArgs = cliArgs.map(function (row) { return row.trim(); }).filter(function (row) { return row !== ''; }); args.jobLog('Processing file'); args.jobLog(JSON.stringify({ - cliArgs: cliArgs, + spawnArgs: spawnArgs, outputFilePath: outputFilePath, })); args.updateWorker({ CLIType: args.ffmpegPath, - preset: cliArgs.join(' '), + preset: spawnArgs.join(' '), }); cli = new cliUtils_1.CLI({ cli: args.ffmpegPath, - spawnArgs: cliArgs, + spawnArgs: spawnArgs, spawnOpts: {}, jobLog: args.jobLog, outputFilePath: outputFilePath, diff --git a/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js b/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js index 392e868..bebffc8 100644 --- a/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js +++ b/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js @@ -229,7 +229,8 @@ var CLI = /** @class */ (function () { return [4 /*yield*/, new Promise(function (resolve) { try { var opts = _this.config.spawnOpts || {}; - var thread = childProcess.spawn(_this.config.cli, _this.config.spawnArgs, opts); + var spawnArgs = _this.config.spawnArgs.map(function (row) { return row.trim(); }).filter(function (row) { return row !== ''; }); + var thread = childProcess.spawn(_this.config.cli, spawnArgs, opts); thread.stdout.on('data', function (data) { // eslint-disable-next-line no-console // console.log(data.toString()); diff --git a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js index c465c17..48e3d91 100644 --- a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js +++ b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js @@ -87,7 +87,7 @@ var hasEncoder = function (_a) { '/dev/null', ], false); args.jobLog("Checking for encoder ".concat(encoder, " with command:")); - args.jobLog(ffmpegPath + ' ' + commandArr_1.join(' ')); + args.jobLog("".concat(ffmpegPath, " ").concat(commandArr_1.join(' '))); return [4 /*yield*/, new Promise(function (resolve) { var error = function () { resolve(false); diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts index e5760f5..d2bf22f 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts @@ -141,20 +141,22 @@ const plugin = async (args: IpluginInputArgs): Promise => { cliArgs.push(outputFilePath); + const spawnArgs = cliArgs.map((row) => row.trim()).filter((row) => row !== ''); + args.jobLog('Processing file'); args.jobLog(JSON.stringify({ - cliArgs, + spawnArgs, outputFilePath, })); args.updateWorker({ CLIType: args.ffmpegPath, - preset: cliArgs.join(' '), + preset: spawnArgs.join(' '), }); const cli = new CLI({ cli: args.ffmpegPath, - spawnArgs: cliArgs, + spawnArgs, spawnOpts: {}, jobLog: args.jobLog, outputFilePath, diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts b/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts index 30025ff..966f75e 100644 --- a/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts +++ b/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts @@ -244,7 +244,8 @@ class CLI { const cliExitCode: number = await new Promise((resolve) => { try { const opts = this.config.spawnOpts || {}; - const thread = childProcess.spawn(this.config.cli, this.config.spawnArgs, opts); + const spawnArgs = this.config.spawnArgs.map((row) => row.trim()).filter((row) => row !== ''); + const thread = childProcess.spawn(this.config.cli, spawnArgs, opts); thread.stdout.on('data', (data: string) => { // eslint-disable-next-line no-console