There’s a small handy tool called “avimerge” for that.

If you want to merge several audio files into one, just take

avimerge -o out.avi -i in1.avi in2.avi [inX.avi]

If you want to replace an audio track (e.g. mp3 by ac3), add -p for adding a new audio track an -A to replace it in original avi container. This is also possible for more audio tracks (needs 2 steps!).

avimerge -o out.avi -i in.avi -p audio.ac3 -A 0
%d bloggers like this: