Split Stereo Audio into Two Mono Tracks Using FFmpeg
This article provides a quick, step-by-step guide on how to use the command-line tool FFmpeg to split a stereo audio file into two separate, independent mono audio streams representing the left and right channels. You will learn the exact commands needed to perform this extraction efficiently without losing audio quality.
To split a stereo audio file into two independent mono files, the
most efficient method is to use FFmpeg’s channelsplit
filter. This filter splits each channel of the input stream into a
separate output stream.
Run the following command in your terminal or command prompt:
ffmpeg -i input.wav -filter_complex "[0:a]channelsplit=channel_layout=stereo[left][right]" -map "[left]" left.wav -map "[right]" right.wavCommand Breakdown
-i input.wav: Specifies the input stereo audio file. You can replace this with other formats like.mp3,.m4a, or.flac.-filter_complex: Directs FFmpeg to use a complex filtergraph, which is required when dealing with multiple inputs or outputs."[0:a]channelsplit=channel_layout=stereo[left][right]":[0:a]selects the audio stream of the first input file.channelsplitis the filter name.channel_layout=stereotells FFmpeg to expect a stereo input.[left][right]labels the two resulting mono streams.
-map "[left]" left.wav: Maps the stream labeledleftto the output fileleft.wav.-map "[right]" right.wav: Maps the stream labeledrightto the output fileright.wav.
Extracting Only One Channel to Mono
If you only need to extract a single channel (either Left or Right)
into a mono file, you can use the pan audio filter.
To extract only the Left channel:
ffmpeg -i input.wav -af "pan=mono|c0=c0" left_only.wavTo extract only the Right channel:
ffmpeg -i input.wav -af "pan=mono|c0=c1" right_only.wavIn these commands, c0 represents the first channel of
the output (mono), while c0 and c1 on the
right side of the equation represent the left and right channels of the
input file, respectively.