fix default audio track

This commit is contained in:
Mylloon 2023-08-04 20:17:16 +02:00
parent 542136dc46
commit 01b4cdcc03
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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