Swap Audio Channels with FFmpeg Pan Filter

This article provides a quick, practical guide on how to swap the left and right audio channels in a stereo file using FFmpeg’s powerful pan audio filter. You will learn the exact command-line syntax required to redirect your audio streams and see a concrete example of how to apply this filter without re-encoding your video.

To swap the left and right channels of a stereo audio track, you use the pan audio filter (-af) to map the input channels to different output channels.

The Swap Command

In a standard stereo configuration, channel 0 (c0) is the left channel and channel 1 (c1) is the right channel. To swap them, you tell FFmpeg to output a stereo stream where the new left channel takes the old right channel, and the new right channel takes the old left channel.

Run the following command in your terminal:

ffmpeg -i input.mp4 -af "pan=stereo|c0=c1|c1=c0" -c:v copy output.mp4

How It Works