Merge Two Mono Audio Files into Stereo with FFmpeg

Combining two separate mono audio tracks into a single stereo file is a common task in audio post-production. This guide provides a straightforward, step-by-step tutorial on how to use FFmpeg, a powerful command-line tool, to merge left and right mono channels into a cohesive stereo audio file using the amerge filter.

The Standard FFmpeg Command

To merge a left-channel mono file and a right-channel mono file into one stereo file, use the following command in your terminal or command prompt:

ffmpeg -i left.wav -i right.wav -filter_complex amerge=inputs=2 -ac 2 stereo.wav

How the Command Works

Alternative Method: Using the Join Filter

If you want to explicitly map which input file goes to which specific channel (Left or Right), you can use the join filter instead:

ffmpeg -i left.wav -i right.wav -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo:map=0.0-FL|1.0-FR[a]" -map "[a]" stereo.wav

Handling Different Audio Lengths

By default, the amerge filter will stop encoding when the shortest input file ends. If your mono files are of different lengths and you want the output to keep playing until the longer file finishes, add the -shortest option or pad the audio. However, for most standard mono-to-stereo conversions where the files are identical in length, the standard command above will work perfectly.