From 0e62ccfe6afbdcda774709c893cc71504370dcb7 Mon Sep 17 00:00:00 2001 From: Junle Li Date: Wed, 25 Jan 2023 01:16:24 -0800 Subject: [PATCH 1/3] The space for ffmpeg custom options are strict. --- src/common/config/private/PrivateConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config/private/PrivateConfig.ts b/src/common/config/private/PrivateConfig.ts index ed145bd7..065afcd8 100644 --- a/src/common/config/private/PrivateConfig.ts +++ b/src/common/config/private/PrivateConfig.ts @@ -768,7 +768,7 @@ export class VideoTranscodingConfig { tags: { name: $localize`Custom Output Options`, priority: ConfigPriority.underTheHood, - hint: '-pass 2; -minrate 1M; -maxrate 1M; -bufsize 2M', + hint: '-pass 2;-minrate 1M;-maxrate 1M;-bufsize 2M', uiAllowSpaces: true }, description: $localize`It will be sent to ffmpeg as it is, as custom output options.`, From 47768f820273f7d2543f9f9fa06a1b21f2839cd9 Mon Sep 17 00:00:00 2001 From: Junle Li Date: Wed, 25 Jan 2023 01:26:10 -0800 Subject: [PATCH 2/3] Redirect ffmpeg output to logger. --- src/backend/model/threading/VideoConverterWorker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/model/threading/VideoConverterWorker.ts b/src/backend/model/threading/VideoConverterWorker.ts index ab37a81c..dd278e36 100644 --- a/src/backend/model/threading/VideoConverterWorker.ts +++ b/src/backend/model/threading/VideoConverterWorker.ts @@ -52,6 +52,10 @@ export class VideoConverterWorker { }) .on('error', (e: any) => { reject('[FFmpeg] ' + e.toString() + ' executed: ' + executedCmd); + }) + .on('stderr', function (line: string) { + // Although this is under `stderr` event, all of ffmpeg output come here. + Logger.debug(line); }); // set custom input options From 7cee4135b27b6f5b1efc86cfe271e6fc61283199 Mon Sep 17 00:00:00 2001 From: Junle Li Date: Wed, 25 Jan 2023 02:53:44 -0800 Subject: [PATCH 3/3] Add FFmpeg prefix on log lines. --- src/backend/model/threading/VideoConverterWorker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/model/threading/VideoConverterWorker.ts b/src/backend/model/threading/VideoConverterWorker.ts index dd278e36..f67d1658 100644 --- a/src/backend/model/threading/VideoConverterWorker.ts +++ b/src/backend/model/threading/VideoConverterWorker.ts @@ -55,7 +55,7 @@ export class VideoConverterWorker { }) .on('stderr', function (line: string) { // Although this is under `stderr` event, all of ffmpeg output come here. - Logger.debug(line); + Logger.debug('[FFmpeg] ' + line); }); // set custom input options