ffmpeg merge audio tracks in video

Terminal window
ffmpeg -i ".mp4" -filter_complex "[0:a:0][0:a:1]amix=inputs=2[aout]" -map 0:v -map "[aout]" -c:v copy -c:a libmp3lame -b:a 192k -shortest "output_.mp4"
  • -i ".mp4" - filename of the source file
  • [0:a:0][0:a:1] - based on the number of tracks. For 3 tracks, [0:a:0][0:a:1][0:a:2] and so on.
  • inputs=2 - also update the number here based on the number of tracks. For 3 tracks, inputs=3.
  • "output_.mp4" - filename for output file. I like to append output_ for mine.