From fbb0e935a2775363f95f3fc32cdd97f51338732b Mon Sep 17 00:00:00 2001 From: seepine Date: Fri, 17 May 2024 12:24:35 +0000 Subject: [PATCH] fix: add quotation marks if there is space in file name --- src/ffmpeg.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ffmpeg.ts b/src/ffmpeg.ts index 24164b6..317ebed 100644 --- a/src/ffmpeg.ts +++ b/src/ffmpeg.ts @@ -258,7 +258,7 @@ function build(opt: IFFmpegOptions): string { const flags = [ 'ffmpeg', - '-i', `${input}`, + '-i', `${input.includes(' ') ? `"${input}"` : input}`, ]; // Set format flags if clip options are set. @@ -332,7 +332,7 @@ function build(opt: IFFmpegOptions): string { } // Set output. - extra.push(output); + extra.push(output.includes(' ') ? `"${output}"` : output); // Push all flags and join them as a space separated string. flags.push(...extra);