User Tools

Site Tools


ffmpeg:audio:audio_channels:change_audio_channels_-_5.1_to_stereo

This is an old revision of the document!


ffmpeg - Audio - Audio Channels - Change Audio Channels - 5.1 to Stereo


WARNING: Tthe resulting stereo mix will often have a much weaker volume than playing the 5.1 track natively.

  • This is because of how audio mixing works.
  • You cannot expect six sources of audio to sound as loud as two sources because there is simply not enough dynamic headroom.
  • Just turn up the volume.

Use ffmpeg built-in downmix

ffmpeg -i input.mp4 -c:v copy -ac 2 stereo_output.mp4

NOTE: The -ac 2 switch works by mixing proportions of the first 5 channels from the sources 6-channel stream - Back Left, Back Right, Front Left, Front Right and Front Center - into the Front Left and Front Right channels of the output stereo stream:

  • -ac 2 tells ffmpeg to downmix the audio to stereo.
    • It will then choose a reasonable default audio codec for a .mp4 file.

WARNING: When using this option, audio from the LFE channel (the .1 in 5.1, reserved for the subwoofer and used for deep, low-frequency effects) is discarded completely when using this option.


Using a custom mix algorithm for the stereo mix

This example takes a combination of various channels for the stereo mix.

ffmpeg -i "input.mkv" -c:v copy -af '-af "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR"' -ac 2 -c:s: copy stereo_output2.mp4
 
# Downmix a 5.1 track to stereo and increase its volume level to 425 (where 256 is 100% of the original source volume level).
ffmpeg -i "input.mkv" -c dca -vol 425 -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" "outputstereo.dts"

NOTE: Maybe mix left/center/right into stereo, and throw out the back end subwoofer channels.


Specify two channels for the stereo mix

This example takes only the front left and front right channel for the stereo mix.

ffmpeg -i "input.mkv" -c:v copy -af 'pan=stereo|c0=FL|c1=FR' -ac 2 -c:s: copy stereo_output2.mp4

NOTE: This is probably a very bad way to downmix multi channel audio.

  • It completely discards all channels except for the first 2.
  • For most 5.1 audio source, most dialogue will be on the 3rd channel, FC.
  • This discards that.
ffmpeg/audio/audio_channels/change_audio_channels_-_5.1_to_stereo.1742945776.txt.gz · Last modified: 2025/03/25 23:36 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki