I am trying to add a additional set of audio tracks into some video files, as part of a automated process. I would like to keep all the original audio tracks and have a second re-coded copy.
What I have been using is:
ffmpeg -i file
-map 0:v -codec:v copy
-map 0:a -codec:a copy
-map 0:a:0 -codec:a:0 aac -strict experimental ...(Bitrate, filters etc all with :a:0)
-map 0:s -codec:s copy
output file
However I can't work out how to change this to handle input files that have multiple audio tracks as it will only convert the first.
If I change the :a:0 to :a on the codec line it produces the extra copy I need but overrides the copy codec for the original copy.
Any ideas anyone?