LAME MP3 Encoding Tips

By Ryan Van Etten (@ryanve) |

Modes

In VBR and ABR modes, a higher bit rate is used to encode more complex parts of the track, and a lower bit rate is used to encode less complex parts—the result is higher audible audio quality and relatively lower filesize. VBR gives you the best bang (quality) for your buck (filesize).

CBR (constant bit rate)
Audio quality varies in order to maintain constant bit rate.
VBR (variable bit rate)
Bit rate varies in order to maintain constant audio quality.
ABR (average bit rate)
Audio quality and bit rate both vary. A cross between VBR and CBR.

Factors

Mp3 compression mainly affects ultra-low and ultra-high frequencies. Bit rate is the the main influence on mp3 quality. Bit rate and filesize are directly proportional. The mp3 maximum is 320kbps. Complex audio needs a higher bit rate in order to maintain quality. The more instruments and frequencies in the track, the more complex it is to encode. Beyond bit rate, LAME has an optional secondary less-relevant quality setting, called algorithm quality selection or qval. The switch for it is -q. -q 2 or -q 3 is considered optimal. I've found the default to be 3. The qval does not affect the filesize.

Usage

For optimal results, use VBR mode. Internet radio providers may require CBR. HTML5 audio streaming apps can handle any mode. MySpace (case study) heavily degrades the quality of your mp3s by re-encoding them (regardless of mode or filesize). In situations where you know it's going to be re-encoded, go --preset insane.

The VBR preset modes produce mp3's in these approximate ranges: extreme: 200–240kbps, standard: 170–210kbps, medium: 150–180kbps. Keep in mind that CBR at 256kbps+ and VBR --preset extreme both encode with a transition band near 20Hz, and are said to be studio quality. Most human ears (aside from babies) cannot hear frequencies above 20kHz.

Many programs support Lame. I prefer Exact Audio Copy (EAC) for its advanced features. Audiograbber is also solid. Both are free. In these programs, %s means source and %d means destination. (Included below for easy copy-and-pasting.)

Command Line Examples

VBR (0–9)

CBR

ABR (8–310)

References

This page was originally for my own use and is a work in progress. For questions, please hit me up @ryanve.