User Tools

Site Tools


ubuntu:sound:lame

Ubuntu - Sound - lame

Encode as mp3 or re-encode an mp3 file to a different bit rate.

Lame is a well known open source mp3 encoder.

For example to encode from WAV format to mp3 or to re-encode an mp3 to a different bit rate.

Minimal example of converting a wave file to mp3.

lame input.wav output.mp3

Re-encode existing MP3 to 64 kbps mp3.

lame -b 64 original.mp3 new.mp3

More interesting options.

 -m m: save as mono
 -m s: save as stereo
 -m j: save as joint stereo (exploits inter-channel correlation
       more than regular stereo)
 -q 2: quality tweaking: the lower the value, the better the 
       quality, but the slower the algorithm. Default is 5.

By default, lame uses constant bit rate (CBR) encoding. You can also use average bit rate (ABR) encoding, e.g. for an average bit rate of 123 kbps:

lame --abr 123 input.wav output.mp3

or variable (VBR) encoding, e.g. between 32 kbps and 192 kbps:

lame -v -b 32 -B 192 input.wav output.mp3

For top quality. Very high quality: HiFi, home, or quiet listening, with maximum file size.

lame -b 320 -h

meaning 320 kbps constant bitrate, high-quality, true-stereo. The highest quality mp3 possible.

or

lame -V 1 -b 128 -m j

meaning bitrate level 1, minimum bitrate of 128 kbps, joint stereo, high quality. Nearly identical sounding as the previous option, but an average bitrate usually between 160 and 200. Encoding will be slower.


LAME Bitrate Overview

OptionAverage kbit/sBitrate range kbit/sDescription
-b 320320320 CBR (non VBR) exampleGenerally considered wasteful because mp3 is lossy anyway, so if you really want the highest quality use a lossless format such as FLAC.
-V 0245220-260Very high quality: HiFi, home, or quiet listening, with best file size. These VBR settings will normally produce transparent results. Audible differences between these presets may exist, but are rare.
-V 1225190-250
-V 2190170-210
-V 3175150-195
-V 4165140-185Portable: listening in noisy conditions, lower bitrate, smaller file size. Close to perceptual transparency.
-V 5130120-150
-V 6115100-130“Acceptable” quality.
-V 710080-120Very low bitrate, small sizes: eg. for voice, radio, mono encoding etc.
-V 88570-105
-V 96545-85

For very low bitrates, up to 100kbps, ABR is most often the best solution. Use –abr <bitrate> (e.g. –abr 80).

–preset voice is only available in the command line front-end, and is there for compatibility. It is currently mapped to –abr 56 -mm, so that means that the recommendation would be to encode in mono, and use ABR.

ubuntu/sound/lame.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki