Input options:
-r Assume the input file is raw pcm. Sampling rate and mono/stereo/jstereo must be specified on the
command line. For each stereo sample, LAME expects the input data to be ordered left channel
first, then right channel. By default, LAME expects them to be signed integers with a bitwidth of
16 and stored in little-endian. Without -r, LAME will perform several fseek()'s on the input file
looking for WAV and AIFF headers.
Might not be available on your release.
-x Swap bytes in the input file (or output file when using --decode).
For sorting out little endian/big endian type problems. If your encodings sounds like static, try
this first.
Without using -x, LAME will treat input file as native endian.
-ssfreqsfreq = 8/11.025/12/16/22.05/24/32/44.1/48
Required only for raw PCM input files. Otherwise it will be determined from the header of the
input file.
LAME will automatically resample the input file to one of the supported MP3 samplerates if
necessary.
--bitwidthn
Input bit width per sample.
n = 8, 16, 24, 32 (default 16)
Required only for raw PCM input files. Otherwise it will be determined from the header of the
input file.
--signed
Instructs LAME that the samples from the input are signed (the default for 16, 24 and 32 bits raw
pcm data).
Required only for raw PCM input files.
--unsigned
Instructs LAME that the samples from the input are unsigned (the default for 8 bits raw pcm data,
where 0x80 is zero).
Required only for raw PCM input files and only available at bitwidth 8.
--little-endian
Instructs LAME that the samples from the input are in little-endian form.
Required only for raw PCM input files.
--big-endian
Instructs LAME that the samples from the input are in big-endian form.
Required only for raw PCM input files.
--mp1input
Assume the input file is a MPEG Layer I (ie MP1) file.
If the filename ends in ".mp1" LAME will assume it is a MPEG Layer I file. For stdin or Layer I
files which do not end in .mp1 you need to use this switch.
--mp2input
Assume the input file is a MPEG Layer II (ie MP2) file.
If the filename ends in ".mp2" LAME will assume it is a MPEG Layer II file. For stdin or Layer II
files which do not end in .mp2 you need to use this switch.
--mp3input
Assume the input file is a MP3 file.
Useful for downsampling from one mp3 to another. As an example, it can be useful for streaming
through an IceCast server.
If the filename ends in ".mp3" LAME will assume it is an MP3. For stdin or MP3 files which do not
end in .mp3 you need to use this switch.
--nogapfile1file2...
gapless encoding for a set of contiguous files
--nogapoutdir
output dir for gapless encoding (must precede --nogap)
--out-dirdir
If no explicit output file is specified, a file will be written at given path. Ignored when using
piped/streamed input
Operational options:
-mmodemode = s, j, f, d, m, l, r
Joint-stereo is the default mode for stereo files.
(s)implestereo(ForcedLR)
In this mode, the encoder makes no use of potentially existing correlations between the two input
channels. It can, however, negotiate the bit demand between both channel, i.e. give one channel
more bits if the other contains silence or needs less bits because of a lower complexity.
(j)ointstereo
In this mode, the encoder can use (on a frame by frame basis) either L/R stereo or mid/side
stereo. In mid/side stereo, the mid (L+R) and side (L-R) channels are encoded, and more bits are
allocated to the mid channel than the side channel. When there isn't too much stereo separation,
this effectively increases the bandwidth, so having higher quality with the same amount of bits.
Using mid/side stereo inappropriately can result in audible compression artifacts. Too much
switching between mid/side and regular stereo can also sound bad. To determine when to switch to
mid/side stereo, LAME uses a much more sophisticated algorithm than the one described in the ISO
documentation.
(f)orcedMSstereo
Forces all frames to be encoded with mid/side stereo. It should be used only if you are sure that
every frame of the input file has very little stereo separation.
(d)ualchannel
In this mode, the 2 channels will be totally independently encoded. Each channel will have
exactly half of the bitrate. This mode is designed for applications like dual languages encoding
(for example: English in one channel and French in the other). Using this encoding mode for
regular stereo files will result in a lower quality encoding.
(m)ono
The input will be encoded as a mono signal. If it was a stereo signal, it will be downsampled to
mono. The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB.
Also note that, if using a stereo RAW PCM stream, you need to use the -a parameter.
(l)eftchannelonly
The input will be encoded as a mono signal. If it was a stereo signal, the left channel will be
encoded only.
(r)ightchannelonly
The input will be encoded as a mono signal. If it was a stereo signal, the right channel will be
encoded only.
-a Mix the stereo input file to mono and encode as mono.
The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB.
This option is only needed in the case of raw PCM stereo input (because LAME cannot determine the
number of channels in the input file). To encode a stereo RAW PCM input file as mono, use lame-a-mm
For WAV and AIFF input files, using -mm will always produce a mono .mp3 file from both mono and
stereo input.
--freeformat
Produces a free format bitstream. With this option, you can use -b with any bitrate higher than 8
kbps.
However, even if an mp3 decoder is required to support free bitrates at least up to 320 kbps, many
players are unable to deal with it.
Tests have shown that the following decoders support free format:
in_mpg123 up to 560 kbps
l3dec up to 310 kbps
LAME up to 640 kbps
MAD up to 640 kbps
--decode
Uses LAME for decoding to a wav file. The input file can be any input type supported by encoding,
including layer II files. LAME uses a fork of mpglib known as HIP for decoding.
If -t is used (disable wav header), LAME will output raw pcm in native endian format. You can use
-x to swap bytes order.
This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME.
-t Disable writing of the INFO Tag on encoding.
This tag is embedded in frame 0 of the MP3 file. It includes some information about the encoding
options of the file, and in VBR it lets VBR aware players correctly seek and compute playing times
of VBR files.
When --decode is specified (decode to WAV), this flag will disable writing of the WAV header. The
output will be raw pcm, native endian format. Use -x to swap bytes.
--comparg
Instead of choosing bitrate, using this option, user can choose compression ratio to achieve.
--scalen--scale-ln--scale-rn
Scales input (every channel, only left channel or only right channel) by n. This just multiplies
the PCM data (after it has been converted to floating point) by n.n > 1: increase volume
n = 1: no effect
n < 1: reduce volume
Use with care, since most MP3 decoders will truncate data which decodes to values greater than
32768.
--replaygain-fast
Compute ReplayGain fast but slightly inaccurately.
This computes "Radio" ReplayGain on the input data stream after user‐specified volume‐scaling
and/or resampling.
The ReplayGain analysis does not affect the content of a compressed data stream itself, it is a
value stored in the header of a sound file. Information on the purpose of ReplayGain and the
algorithms used is available from http://www.replaygain.org/.
Only the "RadioGain" Replaygain value is computed, it is stored in the LAME tag. The analysis is
performed with the reference volume equal to 89dB. Note: the reference volume has been changed
from 83dB on transition from version 3.95 to 3.95.1.
This switch is enabled by default.
See also: --replaygain-accurate,--noreplaygain--replaygain-accurate
Compute ReplayGain more accurately and find the peak sample.
This computes "Radio" ReplayGain on the decoded data stream, finds the peak sample by decoding on
the fly the encoded data stream and stores it in the file.
The ReplayGain analysis does not affect the content of a compressed data stream itself, it is a
value stored in the header of a sound file. Information on the purpose of ReplayGain and the
algorithms used is available from http://www.replaygain.org/.
By default, LAME performs ReplayGain analysis on the input data (after the user‐specified volume
scaling). This behavior might give slightly inaccurate results because the data on the output of
a lossy compression/decompression sequence differs from the initial input data. When
--replaygain-accurate is specified the mp3 stream gets decoded on the fly and the analysis is
performed on the decoded data stream. Although theoretically this method gives more accurate
results, it has several disadvantages:
* tests have shown that the difference between the ReplayGain values computed on the input data
and decoded data is usually not greater than 0.5dB, although the minimum volume difference
the human ear can perceive is about 1.0dB
* decoding on the fly significantly slows down the encoding process
The apparent advantage is that:
* with --replaygain-accurate the real peak sample is determined and stored in the file. The
knowledge of the peak sample can be useful to decoders (players) to prevent a negative effect
called 'clipping' that introduces distortion into the sound.
Only the "RadioGain" ReplayGain value is computed, it is stored in the LAME tag. The analysis is
performed with the reference volume equal to 89dB. Note: the reference volume has been changed
from 83dB on transition from version 3.95 to 3.95.1.
This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME. (Note:
if LAME is compiled without the MP3 decoder, ReplayGain analysis is performed on the input data
after user-specified volume scaling).
See also: --replaygain-fast,--noreplaygain--clipdetect--noreplaygain
Disable ReplayGain analysis.
By default ReplayGain analysis is enabled. This switch disables it.
See also: --replaygain-fast,--replaygain-accurate--clipdetect
Clipping detection.
Enable --replaygain-accurate and print a message whether clipping occurs and how far in dB the
waveform is from full scale.
This option is not usable if the MP3 decoder was explicitly disabled in the build of LAME.
See also: --replaygain-accurate--presettype|[cbr]kbps
Use one of the built-in presets.
Have a look at the PRESETS section below.
--presethelp gives more infos about the the used options in these presets.
--noasmtype
Disable specific assembly optimizations ( mmx / 3dnow / sse ). Quality will not increase, only
speed will be reduced. If you have problems running Lame on a Cyrix/Via processor, disabling mmx
optimizations might solve your problem.
Verbosity:
--disptimen
Set the delay in seconds between two display updates.
--nohist
By default, LAME will display a bitrate histogram while producing VBR mp3 files. This will
disable that feature.
Histogram display might not be available on your release.
-S--silent--quiet
Do not print anything on the screen.
--verbose
Print a lot of information on the screen.
--help Display a list of available options.
Noise shaping & psycho acoustic algorithms:
-qqual
0 <= qual <= 9
Bitrate is of course the main influence on quality. The higher the bitrate, the higher the
quality. But for a given bitrate, we have a choice of algorithms to determine the best
scalefactors and Huffman encoding (noise shaping).
For CBR and ABR, the following table applies:
-q0:
Use the best algorithms (Best Huffman coding search, full outer loop, and the highest precision of
several parameters).
-q1toq4:
Similar to -q 0 without the full outer loop and decreasing precision of parameters the further
from q0. -q 3 is the default.
-q5and-q6:
Same as -q 7, but enables noise shaping and increases subblock gain
-q7to-q9:
Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but
no noise-shaping is done.
For the default VBR mode since LAME 3.98, the following table applies :
-q0to-q4:
include all features of the other modes and additionally use the best search when applying Huffman
coding.
-q5and-q6:
include all features of -q7, calculate and consider actual quantisation noise, and additionally
enable subblock gain.
-q7to-q9
This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a
quick guess.
-h Alias of -q2-f Alias of -q7
CBR (constant bitrate, the default) options:
-bn For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)
n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64
Default is 128 for MPEG1 and 64 for MPEG2 and 32 for MPEG2.5
(64, 32 and 16 respectively in case of mono).
--cbr enforce use of constant bitrate. Used to disable VBR or ABR encoding even if their settings are
enabled.
ABR (average bitrate) options:
--abrn
Turns on encoding with a targeted average bitrate of n kbits, allowing to use frames of different
sizes. The allowed range of n is 8 - 310, you can use any integer value within that range.
It can be combined with the -b and -B switches like: lame--abr123-b64-B192a.wava.mp3 which
would limit the allowed frame sizes between 64 and 192 kbits.
The use of -B is NOT RECOMMENDED. A 128 kbps CBR bitstream, because of the bit reservoir, can
actually have frames which use as many bits as a 320 kbps frame. VBR modes minimize the use of
the bit reservoir, and thus need to allow 320 kbps frames to get the same flexibility as CBR
streams.
VBR (variable bitrate) options:
-v use variable bitrate (--vbr-new)--vbr-old
Invokes the oldest, most tested VBR algorithm. It produces very good quality files, though is not
very fast. This has, up through v3.89, been considered the "workhorse" VBR algorithm.
--vbr-new
Invokes the newest VBR algorithm. During the development of version 3.90, considerable tuning was
done on this algorithm, and it is now considered to be on par with the original --vbr-old. It has
the added advantage of being very fast (over twice as fast as --vbr-old ). This is the default
since 3.98.
-Vn 0 <= n <= 9.999
Enable VBR (Variable BitRate) and specifies the value of VBR quality (default = 4). Decimal values
can be specified, like 4.51.
0 = highest quality.
ABR and VBR options:
-bbitrate
For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)
n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64
Specifies the minimum bitrate to be used. However, in order to avoid wasted space, the smallest
frame size available will be used during silences.
-Bbitrate
For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)
n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64
Specifies the maximum allowed bitrate.
Note: If you own an mp3 hardware player build upon a MAS 3503 chip, you must set maximum bitrate
to no more than 224 kpbs.
-F Strictly enforce the -b option.
This is mainly for use with hardware players that do not support low bitrate mp3.
Without this option, the minimum bitrate will be ignored for passages of analog silence, i.e. when
the music level is below the absolute threshold of human hearing (ATH).
Experimental options:
-Xn 0 <= n <= 7
When LAME searches for a "good" quantization, it has to compare the actual one with the best one
found so far. The comparison says which one is better, the best so far or the actual. The -X
parameter selects between different approaches to make this decision, -X0 being the default mode:
-X0
The criteria are (in order of importance):
* less distorted scalefactor bands
* the sum of noise over the thresholds is lower
* the total noise is lower
-X1
The actual is better if the maximum noise over all scalefactor bands is less than the best so far.
-X2
The actual is better if the total sum of noise is lower than the best so far.
-X3
The actual is better if the total sum of noise is lower than the best so far and the maximum noise
over all scalefactor bands is less than the best so far plus 2dB.
-X4
Not yet documented.
-X5
The criteria are (in order of importance):
* the sum of noise over the thresholds is lower
* the total sum of noise is lower
-X6
The criteria are (in order of importance):
* the sum of noise over the thresholds is lower
* the maximum noise over all scalefactor bands is lower
* the total sum of noise is lower
-X7
The criteria are:
* less distorted scalefactor bands
or
* the sum of noise over the thresholds is lower
-Y lets LAME ignore noise in sfb21, like in CBR
MP3 header/stream options:
-eempemp = n, 5, c
n = (none, default)
5 = 0/15 microseconds
c = citt j.17
All this does is set a flag in the bitstream. If you have a PCM input file where one of the above
types of (obsolete) emphasis has been applied, you can set this flag in LAME. Then the mp3
decoder should de-emphasize the output during playback, although most decoders ignore this flag.
A better solution would be to apply the de-emphasis with a standalone utility before encoding, and
then encode without -e.-c Mark the encoded file as being copyrighted.
-o Mark the encoded file as being a copy.
-p Turn on CRC error protection.
It will add a cyclic redundancy check (CRC) code in each frame, allowing to detect transmission
errors that could occur on the MP3 stream. However, it takes 16 bits per frame that would
otherwise be used for encoding, and then will slightly reduce the sound quality.
--nores
Disable the bit reservoir. Each frame will then become independent from previous ones, but the
quality will be lower.
--strictly-enforce-ISO
With this option, LAME will enforce the 7680 bit limitation on total frame size.
This results in many wasted bits for high bitrate encodings but will ensure strict ISO
compatibility. This compatibility might be important for hardware players.
Filter options:
--lowpassfreq
Set a lowpass filtering frequency in kHz. Frequencies above the specified one will be cutoff.
--lowpass-widthfreq
Set the width of the lowpass filter. The default value is 15% of the lowpass frequency.
--highpassfreq
Set an highpass filtering frequency in kHz. Frequencies below the specified one will be cutoff.
--highpass-widthfreq
Set the width of the highpass filter in kHz. The default value is 15% of the highpass frequency.
--resamplesfreqsfreq = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48
Select output sampling frequency (only supported for encoding).
If not specified, LAME will automatically resample the input when using high compression ratios.
ID3 tag options:
--tttitle
audio/song title (max 30 chars for version 1 tag)
--taartist
audio/song artist (max 30 chars for version 1 tag)
--tlalbum
audio/song album (max 30 chars for version 1 tag)
--tyyear
audio/song year of issue (1 to 9999)
--tccomment
user-defined text (max 30 chars for v1 tag, 28 for v1.1)
--tntrack[/total]
audio/song track number and (optionally) the total number of tracks on the original recording.
(track and total each 1 to 255. Providing just the track number creates v1.1 tag, providing a
total forces v2.0).
--tggenre
audio/song genre (name or number in list)
--tvid=value
Text or URL frame specified by id and value (v2.3 tag). User defined frame. Syntax: --tv
"TXXX=description=content"
--add-id3v2
force addition of version 2 tag
--id3v1-only
add only a version 1 tag
--id3v2-only
add only a version 2 tag
--id3v2-latin1
add following options in ISO-8859-1 text encoding.
--id3v2-utf16
add following options in unicode text encoding.
--space-id3v1
pad version 1 tag with spaces instead of nulls
--pad-id3v2
same as --pad-id3v2-size 128
--pad-id3v2-sizenum
adds version 2 tag, pad with extra "num" bytes
--genre-list
print alphabetically sorted ID3 genre list and exit
--ignore-tag-errors
ignore errors in values passed for tags, use defaults in case an error occurs
Analysis options:
-g run graphical analysis on <infile>. <infile> can also be a .mp3 file. (This feature is a compile
time option. Your binary may for speed reasons be compiled without this.)