| Icecast Installation and Management: A Guide to Open Source Audio Streaming | ||
|---|---|---|
| <<< Previous | Encoding Raw Audio | Next >>> |
Here is a full list of options available for use on the command line. Thiese same options can be checked using the LAME man pages. The following list is provided for reference only. Consult the man pages for further clarification.
Input is raw PCM.
Force byte-swapping of input.
Sets the sampling frequency of the input file in kHz. The default is 44.1 kHz. Viable frequencies are 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, and 48. This option is required only by raw PCM input files; otherwise the setting is determined from the header of the input file. LAME automatically re-samples the input file to one of the supported MP3 samplerates, if necessary.
The input bitwidth is set at n. The default is 16. Available input bit width options are: 8, 16, 24, and 32 (with the default set at 16). This is required only for raw PCM input files. Otherwise it is be determined from the input file's header.
Input file is a MPEG Layer II or MP2 file. If the filename ends in ".mp2" LAME assumes it is a MPEG Layer II file. For stdin or Layer II files which do not end in .mp2 use this switch.
Input file is a MPEG Layer III or MP3 file. This option is useful for downsampling from one MP3 to another. For example, it is often used when streaming through an icecast server. If the filename ends in ".mp3" LAME assumes it is an MP3. For stdin or MP3 files that do not end in .mp3 use this switch.
This option provides for gapless encoding a set of contiguous files.
Output directory for gapless encoding. This option must precede the --nogap option.
Allows the use of VBR tags in gapless encoding.
Use one of the following variables where the mode = s, j, f, d, or m. Joint-stereo is the default mode for stereo files with VBR when -V is more than 4 or fixed bitrates of 160kbs or less. At higher fixed bitrates or higher VBR settings, the default is stereo.
(s)tereo - Here the encoder makes no use of potentially existing correlations between the two input channels. It can, however, negotiate the bit demand between both channels, i.e. give one channel more bits if the other contains silence or needs less bits because of a lower complexity.
(j)oint stereo - The encoder makes use of a correlation between both channels. The signal is matrixed into a sum ("mid"), computed by the L+R, and difference ("side") signal, then computed by L-R, while more bits are allocated to the mid channel. This effectively increases the bandwidth if the signal does not have too much stereo separation, thus giving a significant gain in encoding quality.
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 that described in the ISO documentation, and thus is safe to use in joint stereo mode.
(f)orced joint stereo - This mode forces MS joint stereo on all frames. It is slightly faster than joint stereo, but should be used only if you are certain every frame of the input file has very little stereo separation.
(d)ual channels - 2 channels are independently encoded. Each channel has exactly half the bitrate. This mode is designed for applications that perform dual languages encoding. For example: English in one channel and German in the other. Using this encoding mode for regular stereo files results in lower quality encoding.
(m)ono - Input is encoded as a mono signal. If it is a stereo signal, it is downsampled to mono. The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB.
Downmix from the file from stereo to mono for mono encoding. The downmix is calculated as the sum of the left and right channel, attenuated by 6 dB as mentioned in the above example. This option is only needed in the case of raw PCM stereo input. This due to the fact that LAME cannot determine the number of channels in the input file. To encode a stereo PCM input file as mono, use the command: lame -m s -a.
For WAV and AIFF input files, using -m -I m always produces a mono .mp3 file from both mono and stereo input.
This option allows the left and right channels to use different block size types.
Produces a free format bitstream. Use -b with any bitrate higher than 8 kbps. However, even if an MP3 decoder is required to support free bitrates up to 320 kbps, many players are unable to deal with it.
The following decoders support free format:
FreeAmp up to 440 kbps
in_mpg123 up to 560 kbps
l3dec up to 310 kbps
LAME up to 560 kbps
MAD up to 640 kbps
Use LAME to convert an MP3 file back to a WAV file, where input=mp3 file and output=wav file. The input file can be any input type supported by encoding, including layer II files. LAME uses a bugfixed version of mpglib for decoding.
If -t is used (which disables the wav header), LAME outputs raw pcm in native endian format. Use -x to swap bytes order. This option is not usable if the MP3 decoder is explicitly disabled during the source build of LAME.
Disables writing of the INFO Tag on encoding. This tag is embedded in frame 0 of the MP3 file (See chapter 2 for more information on the construction of MP3 files). It includes 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 the option --decode is specified (decode to WAV), this flag disables writing the WAV header. The output is then raw pcm in native endian format.
Instead of selecting the bitrate, this option allows one to choose the compression ratio.
Scales input (every channel, or only the left channel or only the right channel) by a factor of 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 this with care, since most MP3 decoders truncate data that decodes to values greater than 32,768.
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. Further information on the purpose of ReplayGain and the algorithms used is available at http://www.replaygain.org/. Only the "RadioGain" Replaygain value is computed and is stored in the LAME tag. The analysis is performed with the reference volume equal to 89dB.
Compute ReplayGain more accurately and find the peak sample. Enables decoding on the fly, computes "Radio" ReplayGain on the decoded data stream, finds the peak sample of the decoded data stream and stores it in the file.
Disable ReplayGain analysis. By default ReplayGain analysis is enabled. This switch disables it.
Clipping detection. This options requires --replaygain-accurate to be enabled and then prints 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.
Use one of the built-in presets.With the current version fast presets might result in too high a bitrate compared to regular presets. --preset help gives more info about the used options in these presets.
Set the delay in seconds between two display updates.
By default, LAME displays a bitrate histogram while producing VBR MP3 files. This option disables that feature. Histogram display might not be available on your release.
Do not print anything on the screen.
Print a whole lot of information to the screen.
Display a list of available options.
0 <= qual <= 9
Bitrate is, of course, the primary influencing factor on audio quality. The higher the bitrate, the better the quality. For a given bitrate, we have a choice of algorithms to determine the best scalefactors and huffman encoding or noise shaping.
-q 0:
Use slowest and best possible version of all algorithms. -q 0 and -q 1 are slow and may not produce significantly higher quality.
-q 2:
Recommended setting. This is the same as -h.
-q 5:
This is the default value resulting in good speed and reasonable quality.
-q 7:
Same as -f. Very fast and moderate quality. Psychoacoustics are used for pre-echo and M/S, but no noise shaping is accomplished.
-q 9:
This option disables almost all algorithms including the psy-model, resulting in poor quality.
Use quality improvements. Encoding is slower, but the result is of higher quality. The behavior is the same as the -q 2 switch. This switch is always enabled when using VBR.
This switch forces the encoder to use a faster encoding mode, but with a lower quality. The behavior is the same as the -q 7 switch. Noise shaping is disabled, but psycho acoustics are still computed for bit allocation and pre-echo detection.
For MPEG1 (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 MPEG2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
The default for MPEG1 is 128 and for MPEG2 it is 64.
This option enforces the use of constant bitrate.
Use a variable bitrate when encoding.
Invokes the oldest, most tested VBR algorithm. This setting produces very good quality files, though it is not very fast. This has, up through v3.89, been considered the "workhorse" VBR algorithm.
This option invokes the newest VBR algorithm. During the development of version 3.90, considerable tuning was done on this algorithm, and it is now considered on par with the original, --vbr-old. This setting has the added advantage of being very fast, or over twice as fast as --vbr-old.
0 <= n <= 9
Enable VBR (Variable Bit Rate) and specify the value of VBR quality The default is 4. 0 is the highest quality.
For MPEG1 (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 MPEG2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
This option specifies the minimum bitrate to be used. However, in order to avoid wasted space, the smallest frame size available is used during silences.
For MPEG1 (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 MPEG2 (sampling frequencies of 16, 22.05 and 24 kHz)
n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
Specifies the maximum allowed bitrate.
Strictly enforce the -b option. This is mainly used with hardware players that do not support low bitrate MP3. Without this option the minimum bitrate is ignored during passages of analog silence, i.e. when the music level is below the absolute threshold of human hearing (ATH).
Disable any use of the ATH (absolute threshold of hearing) for masking purposes. Normally, humans are unable to hear any sound below this threshold.
Ignore psychoacoustic model for short blocks and use ATH only.
This option causes LAME to ignore the output of the psy-model and only use masking from the ATH (absolute threshold of hearing). This option might be useful at very high bitrates or for testing the ATH.
In the past, LAME used ATH shape 0 which is the Painter and Spanias formula. Tests have shown that this formula is inaccurate in the 13-22kHz area, leading to audible artifacts in some cases.
Shape 1 was thus implemented, which is over sensitive, leading to very high bitrates.
Shape 2 formula was accurately modeled from real data in order to reach optimal quality while not wasting bitrate. In CBR and ABR modes, LAME uses ATH shape 2 by default. VBR selects one depending on the specified parameter to the -V option.
Lower the ATH (absolute threshold of hearing) by n dB. Normally, humans are unable to hear any sound below this threshold, but for music recorded at very low level this option might be useful.
ATH auto adjusts types 1-3, else there is no adjustment.
Activation offsets in -/+ dB for ATH auto-adjustment
Let LAME use short blocks when appropriate. This is the default setting.
Encode all frames using long blocks only. This could increase quality when encoding at very low bitrates, but can produce serious pre-echo artifacts.
Use only short blocks, no long ones.
Compute tonality up to this frequency in kHz. The default setting is 8.8717.
Do not make use of the temporal masking effect.
Experimental PSY tunings by Naoki Shibata.
M/S switching criterion.
M/S switching tuning, only effective in 0-3.5.
Adjust masking for sfbs 0-6 (long) and 0-5 (short).
Adjust masking for sfbs 7-13 (long) 6-10 (short).
Adjust masking for sfbs 14-21 (long) 11-12 (short).
Change ns-treble by x dB for sfb21
emp equals n, 5, or 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, set this flag in LAME. 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 the -e option.
Mark the encoded file as being copyrighted.
Mark the encoded file as being a copy.
Turn on CRC error protection. This option adds a cyclic redundancy check (CRC) code in each frame, allowing it 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 so it slightly reduces sound quality.
Disable the bit reservoir. Each frame will then become independent from previous ones, but the quality will be lower.
With this option, LAME enforces the 7680 bit limitation on total frame size. This results in many wasted bits for high bitrate encodings but ensures strict ISO compatibility. This compatibility might be important for hardware players.
This option informs the encoder to use full bandwidth and to disable all filters. By default, the encoder uses some highpass filtering at low bitrates in order to maintain a good quality by giving more bits to more important frequencies. Increasing the bandwidth from the default setting might produce ringing artifacts at low bitrates.
Set a lowpass filtering frequency in kHz. Frequencies above the specified one will be cutoff.
Set the width of the lowpass filter. The default value is 15% of the lowpass frequency.
Set an highpass filtering frequency in kHz. Frequencies below the specified one will be cutoff.
Set the width of the highpass filter in kHz. The default value is 15% of the highpass frequency.
sfreq = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48
Select the output sampling frequency. This is only supported for the encoding portion. If not specified, LAME automatically resamples the input when using high compression ratios.
Audio/song title. Max 30 characters for version 1 tags.
Audio/song artist. Max 30 characters for version 1 tags.
Audio/song album. Max 30 characters for version 1 tags.
Audio/song year of issue; 1 to 9999.
User-defined text. Max 30 characters for v1 tag, 28 for v1.1.
Audio/song track number. 1 to 255, creates v1.1 tag.
Audio/song genre, a name or number in a list.
Force the addition of version 2 tags.
Add only a version 1 tag.
Add only a version 2 tag.
Pad version 1 tag with spaces instead of nulls.
Pad a version 2 tag with an extra 128 bytes.
Print an alphabetically sorted ID3 genre list and exit.
Ignore errors in values passed for tags. Use defaults in case an error occurs.
Run a graphical analysis on the <infile>. <infile> can also be a .mp3 file. This feature is a compile time option. Your pre-built binary may have been compiled without this option enabled due to speed reasons.
Many of these variables will probably never be used by most users, but it is important that you are familiar with them in relationship to LAME. The LAME man page covers each of these settings in further detail with a varied selection of example commands. These commands demonstrate each option's use in a real-world scenario.
| <<< Previous | Home | Next >>> |
| Command Line LAME | Up | Other Encoders |