Converting a bunch of MP3s to mono

audio conversionbatchmonomp3stereo

I have a bunch of stereo MP3s I'd like to convert to mono. What is the best way to do this? I would prefer something that would let be batch process them. I want to keep the quality as close to the original as possible. My files are also in different bitrates, so I don't want to make all files 320kpbs when some are only 128.

Also, is there any quick way to see which files are stereo out of my entire library?

Best Answer

Converting from stereo to mono will mean re-encoding, so keeping the same bit rate would be meaningless. In fact, converting a 128 kbit/s MP3 -> a new 128 kbit/s MP3 will net you godawfully terrible quality, even if the second one is mono (and therefore requires a lower bit rate for the same subjective quality).

Generally, I would use a Variable Bit Rate (VBR) setting for MP3, which targets a specific quality and lets the encoder set whatever bit rate is required (completely silent audio needs a lower bit rate than whalesong, which needs a lower bit rate than dubstep). From the command-line, ffmpeg can convert audio to mono with the option -ac 1, like so:

ffmpeg -i input.mp3 -c:a libmp3lame -q:a 2 -ac 1 output.mp3

See this page for a guide to using -q:a. Note that the table on that page is aimed at stereo audio; the actual bit rates you'll see will be somewhat lower. Normally, I recommend 3-4, but since you're encoding from MP3s rather than an original CD, you should aim a bit higher.

This can, of course, be automated very easily. On Linux/OSX/other UNIX-like, to convert a directory of MP3s:

for f in *.mp3; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 -ac 1 mono-"$f"; done

To do so recursively:

find . -type f -name "*.mp3" -exec ffmpeg -i '{}' -c:a libmp3lame -q:a 2 -ac 1 mono-'{}' \;

If you have GNU Parallel and a multi-core machine, you may find this useful:

find . -type f -name "*.mp3" | parallel ffmpeg -i {} -c:a libmp3lame -q:a 2 -ac 1 mono-{}
Related Question