Downmixing surround audio with FFmpeg is super easy. Forget about all other super complicated ways to do this. This is the right way to do it in FFMpeg:
Convert an audio file with surround sound to stereo:
ffmpeg -i input.ext -ac 2 output.ext
Convert a video file with surround sound to stereo:
ffmpeg -i "your_movie_file.mkv" -c:v copy -ac 2 -c:a aac -b:a 320k -ar 48000 output.mkv
This will downmix the audio to stereo (-ac 2
) and encode the audio to a stereo AAC track, if you want that. You are free to choose the codec you want.
Some people have suggested to use: ffmpeg -i input.ext -c:v copy -ac 2 -af "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR" output.ext
. This method manipulates the sound and to me, this method sounds “flat” and lacks spatial balance. Since the first method produces exactly the same result as for example VLC Player or any music editing software, it seems more likely that this is the “correct way” to do it.
Sources:
https://trac.ffmpeg.org/wiki/AudioChannelManipulation#a5.1stereo