📄 usage
字号:
% lame [options] inputfile [outputfile]=======================================================================Examples:=======================================================================fixed bit rate jstereo 128kbs encoding:% lame sample.wav sample.mp3 fixed bit rate jstereo 128kbs encoding, highest quality: (recommended)% lame -h sample.wav sample.mp3 To disable joint stereo encoding (slightly faster, but less quality at bitrates<=128kbs)% lame -m s sample.wav sample.mp3 Fast encode, low quality (no psycho-acoustics)% lame -f sample.wav sample.mp3 Variable Bitrate (VBR): (use -V n to adjust quality/filesize)% lame -h -v sample.wav sample.mp3Note: VBR is currently under heavy development. Right now it canoften result in too much compression. I would recommend using VBRwith a minimum bitrate of 112kbs. This will let LAME increasethe bitrate for difficult-to-encode frames, but prevent LAME frombeing too aggressive for simple frames:% lame -h -v -b 112 sample.wav sample.mp3=======================================================================LOW BITRATES=======================================================================At lower bitrates, (like 24kbs per channel), it is recommended thatyou use a 16kHz sampling rate combined with lowpass filtering. LAME,as well as commercial encoders (FhG, Xing) will do this automatically.However, if you feel there is too much (or not enough) lowpassfiltering, you may need to try different values of the lowpass cutoffand passband width (--resample, --lowpass and --lowpass-width options).=======================================================================STREAMING EXAMPLES=======================================================================% cat inputfile | lame [options] - - > output=======================================================================For more options, just type:% lame --helpScripts are included to run lame on multiple files:bach script: mlame Run "mlame -h" for instructions.sh script: auenc Run auenc for instructions=======================================================================options guide:=======================================================================These options are explained in detail below.Quality related:-m m/s/j/f mode selection-k disable all filtering-d allow block types to differ between channels--athonly ignore psy-model output, only use masking from the ATH--voice experimental voice encoding mode--noshort disable short blocksConstant Bit Rate (CBR)-b n set bitrate (8,16,24,...,320)-h higher quality but slower-f disable noise shaping. Encodes faster, but lower quality--freeformat produce a free format bitstream. User must also specify a bitrate with -b, between 8 and 320 kbs.Variable Bit Rate (VBR)-v VBR--vbr-old use old variable bitrate (VBR) routine-V n VBR quality setting (0=highest quality, 9=lowest)-b n specify a minimum allowed bitrate (8,16,24,...,320)-B n specify a maximum allowed bitrate (8,16,24,...,320)-F strictly enforce minimum bitrate-t disable Xing VBR informational tag --nohist disable display of VBR bitrate histogram--abr n specify average bitrate desiredExperimental (undocumented): may work better or worse:-X n try different quality measures (when comparing quantizations)-Y -Z Operational:-r assume input file is raw PCM--decode assume input file is an mp3 file, and decode to raw pcm. -s n input sampling frequency in kHz (for raw PCM input files)--resample n output sampling frequency--mp3input input file is an MP3 file. decode using mpglib/mpg123--ogginput input file is an Ogg Vorbis file. decode using libvorbis-x swap bytes of input file-a downmix stereo input file to mono .mp3-e n/5/c de-emphasis-p add CRC error protection-c mark the encoded file as copyrighted-o mark the encoded file as a copy-S don't print progress report, VBR histogram-g run MP3x, the graphical frame analyzer--strictly-enforce-ISO comply as much as possible to ISO MPEG spec--ogg Encode using Ogg Vorbis (.ogg) instead of mp3.id3 tagging:--tt "title" title of song (max 30 chars)--ta "artist" artist who did the song (max 30 chars)--tl "album" album where it came from (max 30 chars)--ty "year" year in which the song/album was made (max 4 chars)--tc "comment" additional info (max 30 chars)--tg "genre" genre of song (name or number)options not yet described:--nores disable bit reservoir--noath disable ATH--cwlimit <freq> specify range of tonality calculation--lowpass--lowpass-width--highpass--highpass-width=======================================================================Detailed description of all options in alphabetical order==============================================================================================================================================downmix=======================================================================-a mix the stereo input file to mono and encode as mono. 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 PCM input file as mono, use "lame -m s -a"For WAV and AIFF input files, using "-m m" will always produce amono .mp3 file from both mono and stereo input.=======================================================================average bitrate encoding (aka Safe VBR)=======================================================================--abr nturns on encoding with a targeted average bitrate of n kbits, allowingto use frames of different sizes. The allowed range of n is 4-310,you can use any integer value within that range.It can be combined with the -b and -B switches likelame --abr 123 -b 64 -B 192 a.wav a.mp3which would limit the allowed frame sizes between 64 and 192 kbits.Using -B is NOT RECOMMENDED. A 128kbs CBR bitstream, because of thebit reservoir, can actually have frames which use as many bits as a320kbs frame. VBR modes minimize the use of the bit reservoir, andthus need to allow 320kbs frames to get the same flexability as CBRstreams.=======================================================================ATH only=======================================================================--athonlyThis option causes LAME to ignore the output of the psy-model andonly use masking from the ATH. Might be useful at very high bitratesor for testing the ATH. =======================================================================bitrate=======================================================================-b nFor MPEG1 (sampling frequencies of 32, 44.1 and 48kHz)n = 32,40,48,56,64,80,96,112,128,160,192,224,256,320For MPEG2 (sampling frequencies of 16, 22.05 and 24kHz)n = 8,16,24,32,40,48,56,64,80,96,112,128,144,160The bitrate to be used. Default is 128kbs MPEG1, 80kbs MPEG2.When used with variable bitrate encodings (VBR), -b specifies theminimum bitrate to use. This is useful to prevent LAME VBR fromusing some very aggressive compression which can cause some distortiondue to small flaws in the psycho-acoustic model.=======================================================================max bitrate=======================================================================-B nFor MPEG1 (sampling frequencies of 32, 44.1 and 48kHz)n = 32,40,48,56,64,80,96,112,128,160,192,224,256,320For MPEG2 (sampling frequencies of 16, 22.05 and 24kHz)n = 8,16,24,32,40,48,56,64,80,96,112,128,144,160Maximum allowed bitrate when using VBR.=======================================================================copyright=======================================================================-c mark the encoded file as copyrighted=======================================================================block type control=======================================================================-d Allows the left and right channels to use different block types.Normally this is not allowed, only because the FhG encoder doesnot seem to allow it either. If anyone finds a sample where -dproduces better results, let me know. (mt@sulaco.org)=======================================================================mpglib decode capability=======================================================================--decode This just uses LAME's mpg123/mpglib interface to decode an MP3 file toa raw pcm file. The input file must be an MP3 file, and the raw pcmdata will be written to the output file in native endian format.Under linux, on i386, to convert the output file to a wav, use:% lame --decode input.mp3 output.pcm% sox -c 2 -t raw -r 44100 -s -w output.pcm output.wav(assuming output.pcm came from a stereo, 44.1khz mp3 file)=======================================================================de-emphasis=======================================================================-e n/5/c n = (none, default) 5 = 0/15 microseconds c = citt j.17All this does is set a flag in the bitstream. If you have a PCMinput file where one of the above types of (obsolete) emphasis hasbeen applied, you can set this flag in LAME. Then the mp3 decodershould de-emphasize the output during playback, although most decoders ignore this flag.A better solution would be to apply the de-emphasis with a standaloneutility before encoding, and then encode without -e. =======================================================================fast mode=======================================================================-f disable noise shaping. Encodes faster, but lower quality.Psycho acoustics are computed for bit allocation and pre-echo detection.=======================================================================strictly enforce VBR minimum bitrate=======================================================================-F strictly enforce VBR minimum bitrate. With out this optioni, the minimumbitrate will be ignored for passages of analog silence.=======================================================================free format bitstreams=======================================================================--freeformat LAME will produce a fixed bitrate, free format bitstream.User must specify the desired bitrate in kbs, which canbe any integer between 8 and 320.Not supported by most decoders. Decoders only required to supportup to 320kbs. Decoders which can handle free format: supports up to"lame --decode" 560kbs Freeamp: 440kbsl3dec: 310kbs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -