Extract the center channel from stereo
Karaoke tracks, vocal-removed versions, and isolation mixes all use the same trick: the lead vocal is usually panned to the center of the stereo image, so subtracting the left channel from the right cancels it. The `pan` filter lets you build a custom channel map; for the center extraction, the `pan=mono|c0=c0` form gives you a single channel from the left input.
The command
ffmpeg -i stereo.wav -af "pan=mono|c0=c0" left_only.wav
ffmpeg -i stereo.wav -af "pan=mono|c0=0.5*c0+0.5*c1" center.wavWhat it does
The first command outputs the left channel only. The second command averages the left and right channels, which approximates the center-panned content. Subtracting the second from the first gives you a rough 'sides only' version with the center removed. The math is rough because real stereo mixes are not perfectly correlated, but for a typical pop mix it works well enough for karaoke.
Requirements
A stereo input. The filter is in libavfilter. CPU-only, single-pass. The output is a single channel; for a stereo output, pass `pan=stereo|c0=c0|c1=c1` to remap without changing the channel count.
Things to avoid
- Expecting a perfect vocal removal. Real mixes use reverb, doubling, and stereo width, so the vocal is rarely at exactly 0.5 in both channels. The 'karaoke' trick is an approximation.
- Forgetting that the pan filter's input is the audio stream, not the filename. The syntax is `pan=output_channel_count|channel_def`.
- Using the center-only output as a replacement for a true stem. For a high-quality vocal removal, get the original multitrack or use a service like Moises.ai or spectral extraction.
- Re-encoding a stereo file to mono and back to stereo. That loses the channel separation, but it does not extract the center.