Fix bug when video is not first

This commit is contained in:
HaveAGitGat 2022-05-25 08:47:36 +01:00
parent f8f5172765
commit aa840354ff
2 changed files with 51 additions and 6 deletions

View file

@ -100,9 +100,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
var ffmpegCommand = ", -c copy";
if (file.ffProbeData.streams[0].codec_type.toLowerCase() == "video") {
ffmpegCommand += ` -map 0:v `;
}
ffmpegCommand += ` -map 0:v? `;
var allAudioTracks = file.ffProbeData.streams.filter(
(stream) => stream.codec_type.toLowerCase() == "audio"