45

I would like to know if it is possible to merge stereo audio into mono on a GSM6.10 audio file using FFMPEG. If it is, please provide the command to achieve this.
Otherwise, is it possible to convert GSM6.10 to WAV PCM with FFMPEG? I could then merge the channels on the WAV PCM.

If there is another free tool that can do this I can try that too.

4 Answers 4

71

The way to "mixdown" from stereo to mono in any supported file in ffmpeg is like so:

ffmpeg -i file.ext -ac 1 file_mono.ext

The "-ac 1" bit instructs ffmpeg to output just 1 audio channel, i.e. mono. By default, this operation will preserve your file format but will revert your bitrate to the ffmpeg default of 64kbs. If you want a higher bitrate, you can do:

ffmpeg -i file.ext -ac 1 -ab 192k file_mono.ext

...replacing 192k with your preferred bitrate.

Note that your install of ffmpeg must support your particular GSM codec in order for this to work properly. I know some GSM encoded audio is supported in ffmpeg through libgsm but I have never dealt with GSM files myself. I have successfuly converted other types of files (MP3) to mono without a hitch, however.

5
  • 7
    Is this really mixing, or just dropping of channels?
    – Jonny
    Apr 15, 2014 at 3:05
  • From the 'pan' filter documentation: "Note that ffmpeg integrates a default down-mix (and up-mix) system that should be preferred (see "-ac" option) unless you have very specific needs."
    – OrangeDog
    Sep 12, 2014 at 8:49
  • Both input and output files must be only audio files. Input cannot be video.
    – Kevin
    Dec 29, 2014 at 7:35
  • 5
    Audio Channel Manipulation "Mix a single stereo stream down to a mono stream. Both channels of the stereo stream will be downmixed into the stream:" ffmpeg -i stereo.flac -ac 1 mono.flac
    – Joel Purra
    Feb 21, 2015 at 14:29
  • @Kevin - input can be a video file, i just verified, (with or without -vn) Feb 22, 2017 at 12:02
12

The above answer works in the case that you still want to convert between formats, but for long files that can take a long time. Or maybe you don't want to convert yet again, degrading quality, and so you might just want to stream copy. Using -codec:a and -ac 1 at the same time doesn't work, but according to the ffmpeg pan filter documentation, if certain conditions are met (like you aren't adjusting the levels of channels or mixing two channels into one), it will recognize this case and report: "Pure channel mapping detected", and do a stream copy, which is much faster.

For example: To make a stereo file mono by just using the left channel, and just copying the video stream, do this:

ffmpeg -i infile.ext -codec:v copy -af pan="mono: c0=FL" outfile.ext
6

To preserve video, I used a combination of two answers above:

ffmpeg -i infile -codec:v copy -ac 1 -ab 192k outfile

That produced a sufficient solution for me.

0

I know it's possible with sox....i use sox for channel manipulation, kdenlive and audacity for mild editing, and ffmpeg for remuxing. just letting you know what has worked out well for me in the past.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .