From 01b4cdcc03df53ba307467692c507b76dd3b5cfc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 4 Aug 2023 20:17:16 +0200 Subject: [PATCH] fix default audio track --- src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 314f116..6b57011 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,9 +60,10 @@ app.whenReady().then(() => { `"${ffmpegPath}" -y -i "${file}" -filter_complex "[0:a]amerge=inputs=2[a]" -ac 1 -map 0:v -map "[a]" -c:v copy "${tmpFile}"` ).catch((e) => printAndDevTool(win, e)); - // Add merged audio as first position to original video + // Add merged audio as first position to original video and make it default + // About disposition: https://ffmpeg.org/ffmpeg.html#Main-options await execute( - `"${ffmpegPath}" -y -i "${tmpFile}" -i "${file}" -map 0 -map 1:a -c:v copy "${outFile}"` + `"${ffmpegPath}" -y -i "${tmpFile}" -i "${file}" -map 0 -map 1:a -c:v copy -disposition:a 0 -disposition:a:0 default "${outFile}"` ).catch((e) => printAndDevTool(win, e)); // Delete the temporary video file