Search code examples
audioffmpegsox

Use FFmpeg (or sox) to reduce stereo


The ffmpeg wiki has this method to mix stereo to stereo:

enter image description here

ffmpeg -i input.mp3 -af "pan=stereo|c0<c0+c1|c1<c0+c1" output.ogg

How could I do this but reduce the volume of the right part mixed into the left and the left part mixed into the right (diagonal arrows) by 60%, while leaving the volume of both channels as is (downward arrows)?

(If this could be done with sox, it be great too.)


Solution

  • ffmpeg -i input -af "pan=stereo|c0<c0+0.6*c1|c1<0.6*c0+c1" output
    

    or

    ffmpeg -i input -af "pan=stereo|FL<FL+0.6*FR|FR<0.6*FL+FR" output
    

    Replace < with = if you don't want pan to normalize the combined gain to 1 for clipping avoidance.

    See pan filter documentation.