• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2% lame [options] inputfile [outputfile]
3    inputfile and/or outputfile can be "-", which means stdin/stdout.
4
5For more options, just type:
6% lame --help  or lame --longhelp
7
8Note: The HTML documentation is more complete than this text file.
9
10
11=======================================================================
12Constant Bitrate Examples:
13=======================================================================
14fixed bit rate jstereo 128 kbps encoding:
15% lame -b128 sample.wav  sample.mp3
16
17Use highest quality mode, slowest:
18% lame -q0 -b128 sample.wav  sample.mp3
19
20Use fast encode, low quality  (no noise shaping)
21% lame -f -b128 sample.wav  sample.mp3
22
23
24=======================================================================
25Variable Bitrate Examples:
26=======================================================================
27LAME has two types of variable bitrate: ABR and VBR.
28
29ABR is the type of variable bitrate encoding usually found in other
30MP3 encoders, Vorbis and AAC.  The number of bits is determined by
31some metric (like perceptual entropy, or just the number of bits
32needed for a certain set of encoding tables), and it is not based on
33computing the actual encoding/quantization error.  ABR should always
34give results equal or better than CBR:
35
36ABR:   (--abr <x> means encode with an average bitrate of around x kbps)
37% lame --abr 128  sample.wav sample.mp3
38
39Another way to enable abr is:
40% lame --preset 128 sample.wav sample.mp3
41
42
43VBR is a true variable bitrate mode which bases the number of bits for
44each frame on the measured quantization error relative to the
45estimated allowed masking. The value 0 is the highest quality, which
46creates bigger files, and the lowest is 9.999, which creates the smallest
47files. Decimal values can be specified, like: 4.51.
48The resulting filesizes depend on the input material. On typical music
49you can expect -V5 resulting in files averaging 132 kbps, -V2 averaging
50200 kbps.
51
52Variable Bitrate (VBR): (use -V n to adjust quality/filesize)
53% lame -V2 sample.wav sample.mp3
54
55
56=======================================================================
57Low Bitrates
58=======================================================================
59At lower bitrates, (like 24 kbps per channel), it is recommended that
60you use a 16 kHz sampling rate combined with lowpass filtering.  LAME,
61as well as commercial encoders (FhG, Xing) will do this automatically.
62However, if you feel there is too much (or not enough) lowpass
63filtering, you may need to try different values of the lowpass cutoff
64and passband width (--resample, --lowpass and --lowpass-width options).
65
66
67=======================================================================
68Streaming Example
69=======================================================================
70
71% cat inputfile | lame [options] - - > output
72
73
74=======================================================================
75Scripts are included (in the 'misc' subdirectory)
76to run lame on multiple files:
77
78bash script:  mlame      Run "mlame -?" for instructions.
79sh script:    auenc      Run auenc for instructions
80sh script:    mugeco.sh
81
82Perl script which will re-encode mp3 files and preserve id3 tags:
83lameid3.pl
84
85Windows scripts:
86lame4dos.bat
87Lame.vbs   (and an HTML frontend: LameGUI.html)
88
89
90=======================================================================
91options guide:
92=======================================================================
93These options are explained in detail below.
94
95By default, LAME accepts a PCM audio sample inside a .WAV container as the
96input file, in 8, 16, 24 and 32 bits integer and in IEEE FLOAT.
97If it is compiled with libsndfile, then it also supports the extra formats
98that the library supports.
99There is also support for raw PCM data and piped input
100
101
102Input options:
103--scale <arg>   multiply PCM input by <arg>
104--scale-l <arg> scale channel 0 (left) input (multiply PCM data) by <arg>
105--scale-r <arg> scale channel 1 (right) input (multiply PCM data) by <arg>
106--gain number   apply Gain adjustment in decibels, range -20.0 to +12.0.
107--swap-channel	Swap Left and Right input channels
108--mp1input      input file is an MPEG 1 Layer I file.  decode on the fly
109--mp2input      input file is an MPEG 1 Layer II file.  decode on the fly
110--mp3input      input file is an MPEG 1 Layer III file.  decode on the fly
111--nogap <file1> <file2> <...>
112                gapless encoding for a set of contiguous files
113--nogapout <dir>
114                output dir for gapless encoding (must precede --nogap)
115--nogaptags     allow the use of VBR tags in gapless encoding
116--out-dir path	If no explicit output file is specified, a file will be
117                written at given path. Ignored when using piped/streamed input
118
119
120Input options for raw PCM:
121-r              read the input file as a raw (headerless) PCM stream
122-s  n           input sampling frequency in kHz (Default 44.1Khz)
123--signed        input is signed (default)
124--unsigned      input is unsigned
125--bitwidth w    input bit width is w (default 16)
126-x              swap bytes of input file
127--little-endian input is little-endian (default)
128--big-endian    input is big-endian
129-a              downmix stereo file to mono file for mono encoding.
130                Needed with raw input for the -mm mode to do the downmix.
131
132Resampling and filtering:
133--lowpass      Frequency(kHz), lowpass filter cutoff above freq.
134               Range [0.001..50]kHz or [50..50000]Hz
135--lowpass-width
136               Frequency(kHz), lowpass window width.
137			   Range [0.001..16]kHz or [16..50000]Hz
138			   (See further restriction in the detailed explanation)
139--highpass     Frequency(kHz), highpass filter cutoff below freq.
140               Range [0.001..16]kHz or [16..50000]Hz
141               (See further restriction in the detailed explanation)
142--highpass-width
143               Frequency(kHz), highpass window width
144               (See further restriction in the detailed explanation)
145--resample n   Sampling frequency of output file(kHz)
146               Default=automatic depending on settings like bitrate.
147
148Operational:
149--preset type	Enables some preconfigured settings. Check below for each
150                of the valid values
151--decode        assume input file is an mp3 file, and decode to wav.
152--decode-mp3delay samples
153                Set the encoder delay to use to decode the input .mp3 file
154-t              disable writing of WAV header when using --decode
155                (decode to raw pcm, native endian format (use -x to swap))
156
157-m m/s/j/f/a   mode selection
158-q n           Internal algorithm quality setting 0..9.
159               0 = slowest algorithms, but potentially highest quality
160               9 = faster algorithms, very poor quality
161			   Default is 3. Read the differences between VBR and CBR below.
162-h             same as -q2
163-f             same as -q7
164
165--priority <type>
166               sets the process priority (Windows and OS/2-specific):
167                     0,1 = Low priority (IDLE_PRIORITY_CLASS)
168                     2 = normal priority (NORMAL_PRIORITY_CLASS, defaul
169                     3,4 = High priority (HIGH_PRIORITY_CLASS))
170               Note: Calling '--priority' without a parameter will set it to 0.
171
172
173
174Constant Bit Rate (CBR)
175-b  n          set bitrate (8, 16, 24, ..., 320)
176--freeformat   produce a free format bitstream.  User must also specify
177               a bitrate with -b, between 8 and 640 kbps.
178
179Variable Bit Rate (VBR)
180-v             VBR  ( alias of -V 4 )
181--vbr-old      use old variable bitrate (VBR) routine
182--vbr-new      use new variable bitrate (VBR) routine (default)
183-V n           VBR quality setting  (0=highest quality, 9.999=lowest)
184-b  n          specify a minimum allowed bitrate (8,16,24,...,320)
185-B  n          specify a maximum allowed bitrate (8,16,24,...,320)
186-F             strictly enforce minimum bitrate
187-t             disable VBR informational tag
188--nohist       disable display of VBR bitrate histogram
189
190--abr n        specify average bitrate desired
191
192
193
194MP3 header/stream options:
195-e  n/5/c       de-emphasis
196-p              add CRC error protection
197-c              mark the encoded file as copyrighted
198-o              mark the encoded file as a copy
199-S              don't print progress report, VBR histogram
200--strictly-enforce-ISO   comply as much as possible to ISO MPEG spec
201--replaygain-fast   compute RG fast but slightly inaccurately (default)
202--replaygain-accurate   compute RG more accurately and find the peak sample
203--noreplaygain  disable ReplayGain analysis
204--clipdetect    enable --replaygain-accurate and print a message whether
205                clipping occurs and how far the waveform is from full scale
206
207
208ID3 tagging:
209
210--tt <title>    audio/song title (max 30 chars for version 1 tag)
211--ta <artist>   audio/song artist (max 30 chars for version 1 tag)
212--tl <album>    audio/song album (max 30 chars for version 1 tag)
213--ty <year>     audio/song year of issue (1 to 9999)
214--tc <comment>  user-defined text (max 30 chars for v1 tag, 28 for v1.1)
215--tn <track[/total]>
216                audio/song track number (1 to 255, creates v1.1 tag.
217                adding a total force a version 2 tag)
218--tg <genre>    audio/song genre (name or number in list)
219--ti <file>     audio/song albumArt (jpeg/png/gif file, v2.3 tag)
220--tv <id=value> user-defined frame specified by id and value (v2.3 tag)
221--add-id3v2     force addition of version 2 tag
222--id3v1-only    add only a version 1 tag
223--id3v2-only    add only a version 2 tag
224--id3v2-utf16   add following options in unicode text encoding
225--id3v2-latin1  add following options in latin-1 text encoding
226--space-id3v1   pad version 1 tag with spaces instead of nulls
227--pad-id3v2     same as '--pad-id3v2-size 128'
228--pad-id3v2-size <num>
229                adds version 2 tag, pad with extra <num> bytes
230--genre-list    print alphabetically sorted ID3 genre list and exit
231--ignore-tag-errors
232                ignore errors in values passed for tags
233
234Note: A version 2 tag will NOT be added unless one of the input fields
235won't fit in a version 1 tag (e.g. the title string is longer than 30
236characters), or the '--add-id3v2' or '--id3v2-only' options are used,
237or output is redirected to stdout.
238
239
240Verbosity:
241--disptime     secs	Print progress report every secs seconds
242--nohist	   Disable VBR histogram display
243--silent       Don't print anything on screen
244--quiet        Don't print anything on screen
245--verbose	   Print a lot of useful information
246--version      Print License information
247--license	   Print License information
248--help         Shows the common list of switches.
249               Add id3 or dev to get help for a specified topic
250--usage        Shows the common list of switches.
251               Add id3 or dev to get help for a specified topic
252--longhelp     Shows the complete list of switches
253
254
255
256=======================================================================
257Detailed description of all options in alphabetical order
258=======================================================================
259
260
261=======================================================================
262Downmix
263=======================================================================
264-a
265
266mix the stereo input file to mono and encode as mono.
267
268This option is only needed in the case of raw PCM stereo input
269(because LAME cannot determine the number of channels in the input file).
270To encode a stereo (RAW) PCM input file as mono, use "lame -m m -a"
271
272For WAV and AIFF input files, using "-m m" will always produce a
273mono .mp3 file from both mono and stereo input.
274
275
276=======================================================================
277Average bitrate encoding (aka Safe VBR)
278=======================================================================
279--abr n
280
281turns on encoding with a targeted average bitrate of n kbps, allowing
282to use frames of different sizes.  The allowed range of n is 8...320
283kbps, you can use any integer value within that range.
284
285
286=======================================================================
287Use version 2 of the ID3 tag standard
288=======================================================================
289 --add-id3v2 Force addition of version 2 tag
290
291Tells LAME to add the tag information as id3v2. This implies adding both,
292a version 1 and a version 2 tag, if the values fit on a version 1 tag.
293See --id3v1-only and --id3v2-only if you want a more fine-grained control.
294
295
296=======================================================================
297Bitrate
298=======================================================================
299-b  n
300
301MPEG-1   layer III sample frequencies (kHz):  32  48  44.1
302bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320
303
304MPEG-2   layer III sample frequencies (kHz):  16  24  22.05
305bitrates (kbps):  8 16 24 32 40 48 56 64 80 96 112 128 144 160
306
307MPEG-2.5 layer III sample frequencies (kHz):   8  12  11.025
308bitrates (kbps):  8 16 24 32 40 48 56 64
309
310The bitrate to be used.  Default is 128kbps in MPEG1 (64 for mono),
31164kbps in MPEG2 (32 for mono) and 32kbps in MPEG2.5 (16 for mono).
312
313When used with variable bitrate encodings (VBR), -b specifies the
314minimum bitrate to use.  This is useful only if you need to circumvent
315a buggy hardware device with strange bitrate constrains.
316
317
318=======================================================================
319Max bitrate
320=======================================================================
321-B  n
322
323see also option "-b" for allowed bitrates.
324
325Maximum allowed bitrate when using VBR/ABR.
326
327Using -B is NOT RECOMMENDED.  A 128 kbps CBR bitstream, because of the
328bit reservoir, can actually have frames which use as many bits as a
329320 kbps frame.  ABR/VBR modes minimize the use of the bit reservoir, and
330thus need to allow 320 kbps frames to get the same flexability as CBR
331streams.  This is useful only if you need to circumvent a buggy hardware
332device with strange bitrate constrains.
333
334
335=======================================================================
336Endianess, big.
337=======================================================================
338 --big-endian Set the byte order to big-endian.
339
340This switch tells LAME that the RAW pcm input is encoded in big-endian
341instead of little-endian.
342
343
344=======================================================================
345Sample bit with
346=======================================================================
347--bitwidth Sets the bitwidth value
348
349With RAW pcm input, this switch lets you specify the bitwidth of the same
350(8 bits, 16 bits...)
351
352
353=======================================================================
354Copyright
355=======================================================================
356-c
357
358flag the encoded file as copyrighted
359
360
361=======================================================================
362Clipping detection
363=======================================================================
364--clipdetect
365
366Enable --replaygain-accurate and print a message whether clipping
367occurs and how far in dB the waveform is from full scale.
368
369This option is not usable if the MP3 decoder was _explicitly_ disabled
370in the build of LAME.
371
372See also: --replaygain-accurate
373
374
375=======================================================================
376MPEG audio decode capability
377=======================================================================
378--decode
379
380This uses LAME's HIP decoder to decode an MP3 file (layers 1, 2 and 3) to
381a wav file.
382
383If -t is used (disable wav header), LAME will output
384raw pcm in native endian format (use -x to swap bytes).
385
386This option is not usable if the MP3 decoder was _explicitly_ disabled
387in the build of LAME.
388
389HIP stands for Hip Isn't a Player and is based off of Michael Hipp's mpglib 0.2a
390
391
392=======================================================================
393MPEG audio decode capability
394=======================================================================
395--decode-mp3delay x Indicate a different encoder delay for decoding
396
397When decoding an mp3 file, LAME automatically corrects for the start delay
398that the encoder had to put into it. This setting lets you specify a different
399delay than LAME's own one, so that it is possible to compensate for the delay
400of mp3's generated with other encoders.
401
402
403=======================================================================
404De-emphasis
405=======================================================================
406-e  n/5/c
407
408  n = (none, default)
409  5 = 0/15 microseconds
410  c = CCITT j.17
411
412All this does is set a flag in the bitstream.  If you have a PCM
413input file where one of the above types of (obsolete) emphasis has
414been applied, you can set this flag in LAME.  Then the mp3 decoder
415should de-emphasize the output during playback, although most
416decoders ignore this flag.
417
418A better solution would be to apply the de-emphasis with a standalone
419utility before encoding, and then encode without -e.
420
421
422=======================================================================
423Strictly enforce VBR minimum bitrate
424=======================================================================
425-F
426
427strictly enforce VBR minimum bitrate.   Without this option, passages of
428analog silence will be encoded at the minimum bitrate possible (32 or 8,
429depending on MPEG version).
430
431
432=======================================================================
433Free format bitstreams
434=======================================================================
435--freeformat
436
437LAME will produce a fixed bitrate, free format bitstream. User must
438specify the desired bitrate in kbps, which can be any integer between
4398 and 640.
440
441Not supported by most decoders.  Complient decoders (of which there
442are few) are only required to support up to 320 kbps.
443
444Decoders known to handle free format:
445
446                      supports up to
447mpg123                   640 kbps
448MAD                      640 kbps
449"lame --decode"          640 kbps
450l3dec                    310 kbps
451
452
453=======================================================================
454Gain
455=======================================================================
456--gain Apply gain in decibels.
457
458Apply Gain adjustment in decibels, range -20.0 to +12.0. 0dBFS means no
459amplification.
460
461
462=======================================================================
463High pass filter
464=======================================================================
465--highpass number Use a highpass filter when encoding
466
467Enables a highpass filter of the specified frequency when encoding the source.
468    Range [0.001..50]kHz or [50..50000]Hz.
469This is usually not required, and the gains are usually minimal. May be useful
470to remove an interference signal on 50Hz or 60Hz, or a DC offset.
471(default: disabled)
472Note: The current implementation has a minimum highpass frequency of
473(67.5/62)% of the sample rate (I.e. 481Hz at 44Khz).
474
475
476=======================================================================
477High pass filter
478=======================================================================
479--highpass-width width Set the width of the decaying curve.
480
481Specify the width in Hz of the decaying curve of the highpass.
482    Range [16..50000]Hz
483The minimum (and default) width is 75% of a band's width (which is 1/64th of
484 the sample rate).
485Note: See the remark in the --highpass command above.
486
487
488=======================================================================
489ID3 tag modes
490=======================================================================
491--id3v1-only Disable the use of id3v2.
492
493Put it before any tag setting.
494This setting tells LAME to use ID3 v1 tag only, and not create an ID3v2
495even if it thinks it should.
496
497--id3v2-only Disable the user ov id3v1.
498
499Put it before any tag setting.
500This setting tells LAME to use ID3 v2 tag only. An ID3 v1 tag would not
501be written.
502
503--ignore-tag-errors Ignore tag information errors
504
505Put it before any tag setting.
506This tells lame to ignore the tag information it sees as erroneous and
507continue encoding without those. Without this setting, errors are reported
508and encoding does not start.
509
510
511=======================================================================
512Endianess. little
513=======================================================================
514--little-endian Set the byte order to little-endian.
515
516This switch tells LAME that the RAW pcm input is encoded in little-endian.
517It is the default setting.
518
519
520=======================================================================
521Low pass filter
522=======================================================================
523--lowpass number Use a lowpass filter when encoding
524
525Enables a lowpass filter of the specified frequency when encoding the source.
526    Range [0.001..50]kHz or [50..50000]Hz
527
528Using a lowpass filter helps reducing the amount of data to encode. This is
529important in MP3 due to a limitation in very high frequencies (>16Khz).
530The default value depends on the target bitrate/quality. It is not recommended
531to change it as a general basis.
532
533--lowpass-width width Set the width of the decaying curve.
534
535Specify the width in Hz of the decaying curve of the lowpass.
536    Range [0.001..16]kHz or [16..50000]Hz
537The lowpass is in the center of this curve. The minimum (and default) width
538is 75% of a band's width (which is 1/64th of the sample rate).
539
540
541=======================================================================
542Modes:
543=======================================================================
544-m m        mono
545-m l	    get only the left channel of a stereo signal for a mono output
546-m r	    get only the right channel of a stereo signal for a mono output
547-m s        (forced) L/R stereo
548-m j        joint stereo
549-m f        forced mid/side stereo
550-m d        dual (independent) channels. Its purpose was meant for dual language
551            streams where only one of them should be decoded.
552			Most decoders just decode them as a stereo stream.
553-m a        Currently, a synonym of m j. (In older releases it selected
554            different modes depending on the bitrate)
555
556MONO is the default mode for mono input files.  If "-m m" is specified
557for a stereo input file, the two channels will be averaged into a mono
558signal.  (Note: See comments about the -a switch for RAW PCM streams)
559
560(FORCED) L/R STEREO encodes the left and the right signals independently,
561and gives more or less bits to each, depending on the currently available.
562
563JOINT STEREO is the default mode of encoding.
564jstereo means the encoder can use (on a frame by frame basis) either
565L/R stereo or mid/side stereo.  In mid/side stereo, the mid(L+R) and side(L-R)
566channels are encoded, and more bits are allocated to the mid channel
567than the side channel.  When there isn't too much stereo separation, this
568effectively increases the bandwidth, so having higher quality with the same
569amount of bits.
570
571Using mid/side stereo inappropriately can result in audible
572compression artifacts.  Too much switching between mid/side and L/R
573stereo can also sound bad. To determine when to switch to mid/side
574stereo, LAME uses a much more sophisticated algorithm than that
575described in the ISO documentation.
576
577FORCED MID/SIDE STEREO forces all frames to be encoded mid/side stereo.  It
578should only be used if you are sure every frame of the input file
579has very little stereo seperation.
580
581DUAL CHANNEL mode is similar to encode the left and right as two mono signals.
582Its purpose was meant for Dual language streams where only one of them should
583be decoded. Most decoders just decode them as a stereo stream
584
585INTENSITY STEREO
586	Not supported.
587
588
589=======================================================================
590MP3 input file
591=======================================================================
592--mp1input --mp2input --mp3input MPEG layer I, II or III input file
593
594Assume the input file is a MP1/2/3 file.  LAME will decode the input file
595before re-encoding it.  Since MP3 is a lossy format, this is not recommended
596in general.  But it is useful for creating low bitrate mp3s from high bitrate
597mp3s.  If the filename ends in ".mp3" LAME will assume it is an MP3.  For
598stdin or MP3 files which dont end in .mp3 you need to use this switch.
599
600
601=======================================================================
602No Gap (continuous audio) encoding of multiple files
603=======================================================================
604 --nogap file1 file2 [...] Encodes multiple continuous files.
605
606Encodes multiple files (ordered by position) which are meant to be played
607gaplessly.
608
609By default, LAME will encode the files with accurate length, but the first
610and last frame may contain a few erroneous samples for signals that don't
611fade-in/out (as is the case of continuous playback).
612
613This setting solves that by using the samples from the next/previous file to
614compute the encoding.
615
616--nogapout dir Specify a directory for the output of the files encoded
617               with --nogap
618
619This setting should precede --nogap, and is used to specify the alternate
620directory where to store the encoded files. The default one is the input file
621directory.
622
623--nogaptags Enables the use of VBR tags with files encoded with --nogap
624
625Tells LAME to put VBR tags to encoded files if they are encoded in VBR or ABR
626modes. Else, using the --nogap option doesn't generate it.
627
628
629=======================================================================
630Disable historgram display
631=======================================================================
632--nohist
633
634By default, LAME will display a bitrate histogram while producing
635VBR mp3 files.  This will disable that feature.
636
637
638=======================================================================
639Disable ReplayGain analysis
640=======================================================================
641--noreplaygain
642
643By default ReplayGain analysis is enabled. This switch disables it.
644
645See also: --replaygain-accurate, --replaygain-fast
646
647
648=======================================================================
649Non-original
650=======================================================================
651-o
652
653mark the encoded file as a copy
654
655
656=======================================================================
657CRC error protection
658=======================================================================
659-p
660
661Turn on CRC error protection.
662It will add a cyclic redundancy check (CRC) code in each frame, allowing
663to detect transmission errors that could occur on the MP3 stream. However,
664it takes 16 bits per frame that would otherwise be used for encoding, and
665therefore will slightly reduce the sound quality.
666
667
668=======================================================================
669ID3 V2 padding
670=======================================================================
671 --pad-id3v2 Pad ID3v2 tag.
672
673Pads the ID3v2 tag with extra 128bytes to allow it to expand.
674
675
676=======================================================================
677Preset system.
678=======================================================================
679--preset x Enable one of the presets
680
681   Setting         Meaning
682--preset medium	   -V 5
683--preset standard  -V 2
684--preset extreme   -V 0
685--preset insane    -b 320
686--preset fast xxx  In versions older than LAME 3.98, "fast" was needed to
687                   enable the vbr-new routine. It is no longer needed.
688--preset number	   --abr number
689--preset cbr number	-b number
690
691Old compatibility settings. Meaningless
692--preset phone	   -b 16 -m m
693--preset phon+ /
694      lw / mw-eu   -b 24 -m m
695--preset mw-us     -b 40 -m m
696--preset voice     -b 56 -m m
697--preset fm / radio -b 112
698--preset hifi      -b 160
699--preset cd        -b 192
700--preset studio    -b 256
701
702
703=======================================================================
704Windows and OS/2 process priority control
705=======================================================================
706--priority <type>
707
708(Windows and OS/2 only)
709
710Sets the process priority for LAME while running under Windows or IBM OS/2.
711This can be very useful to avoid the system becoming slow and/or unresponsive.
712By setting LAME to run in a lower priority, you leave more time for the system
713to update basic processing (drawing windows, polling keyboard/mouse, etc). The
714impact in LAME's performance is minimal if you use priority 0 to 2.
715
716The valid parameters are:
717
718     0 = Low priority (IDLE, delta = 0)
719     1 = Medium priority (IDLE, delta = +31)
720     2 = Regular priority (REGULAR, delta = -31)
721     3 = High priority (REGULAR, delta = 0)
722     4 = Maximum priority (REGULAR, delta = +31)
723
724Note that if you call '--priority' without a parameter, priority 0 will be
725assumed.
726
727
728=======================================================================
729Algorithm quality selection
730=======================================================================
731-q n
732
733Bitrate is of course the main influence on quality. The higher the bitrate,
734the higher the quality. But for a given bitrate, we have a choice of algorithms
735to determine the best scalefactors and Huffman coding (noise shaping).
736
737For CBR, ABR and --vbr-old modes, the following table applies
738
739-q 0            Use the best algorithms (Best Huffman coding search, full outer
740                loop, and the highest precision of several parameters).
741-q 1 to -q 4    Similar to -q 0 without the full outer loop and decreasing
742                precision of parameters the further from q0. -q 3 is the default
743-q 5 and -q 6   Same as -q 7, but enables noise shaping and increases subblock
744                gain
745-q 7 to -q 9    Same as -f. Very fast, OK quality. Psychoacoustics are used for
746                pre-echo and mid/side stereo, but no noise-shaping is done.
747
748For the default VBR mode since LAME 3.98, the following table applies
749
750-q 0 to -q 4    include all features of the other modes and additionally use
751                the best search when applying Huffman coding.
752-q 5 and -q 6   include all features of -q7, calculate and consider actual
753                quantisation noise, and additionally enable subblock gain.
754-q 7 to -q 9    This level uses a psymodel but does not calculate quantisation
755                noise when encoding: it takes a quick guess.
756
757
758=======================================================================
759Input file is raw pcm
760=======================================================================
761-r
762
763Assume the input file is raw pcm.  Sampling rate and mono/stereo/jstereo
764must be specified on the command line.  Without -r, LAME will perform
765several fseek()'s on the input file looking for WAV and AIFF headers.
766
767Not supported if LAME is compiled to use LIBSNDFILE.
768
769
770=======================================================================
771Slightly more accurate ReplayGain analysis and finding the peak sample
772=======================================================================
773--replaygain-accurate
774
775Compute "Radio" ReplayGain on the decoded data stream. Find the peak sample
776by decoding on the fly the encoded data stream and store it in the file.
777
778
779ReplayGain analysis does _not_ affect the content of a compressed data
780stream itself, it is a value stored in the header of a sound file.
781Information on the purpose of ReplayGain and the algorithms used is
782available from http://www.replaygain.org/
783
784By default, LAME performs ReplayGain analysis on the input data (after
785the user-specified volume scaling). This behaviour might give slightly
786inaccurate results because the data on the output of a lossy
787compression/decompression sequence differs from the initial input data.
788When --replaygain-accurate is specified the mp3 stream gets decoded on
789the fly and the analysis is performed on the decoded data stream.
790Although theoretically this method gives more accurate results, it has
791several disadvantages:
792  * tests have shown that the difference between the ReplayGain values
793    computed on the input data and decoded data is usually no greater
794    than 0.5dB, although the minimum volume difference the human ear
795    can perceive is about 1.0dB
796  * decoding on the fly significantly slows down the encoding process
797The apparent advantage is that:
798  * with --replaygain-accurate the peak sample is determined and
799    stored in the file. The knowledge of the peak sample can be useful
800    to decoders (players) to prevent a negative effect called 'clipping'
801    that introduces distortion into sound.
802
803
804Only the "Radio" ReplayGain value is computed. It is stored in the LAME tag.
805The analysis is performed with the reference volume equal to 89dB.
806Note: the reference volume has been changed from 83dB on transition from
807version 3.95 to 3.95.1.
808
809This option is not usable if the MP3 decoder was _explicitly_ disabled
810in the build of LAME. (Note: if LAME is compiled without the MP3 decoder,
811ReplayGain analysis is performed on the input data after user-specified
812volume scaling).
813
814See also: --replaygain-fast, --noreplaygain, --clipdetect
815
816
817=======================================================================
818Fast ReplayGain analysis
819=======================================================================
820--replaygain-fast
821
822Compute "Radio" ReplayGain of the input data stream after user-specified
823volume scaling and/or resampling.
824
825ReplayGain analysis does _not_ affect the content of a compressed data
826stream itself, it is a value stored in the header of a sound file.
827Information on the purpose of ReplayGain and the algorithms used is
828available from http://www.replaygain.org/
829
830Only the "Radio" ReplayGain value is computed. It is stored in the LAME tag.
831The analysis is performed with the reference volume equal to 89dB.
832Note: the reference volume has been changed from 83dB on transition
833from version 3.95 to 3.95.1.
834
835This switch is enabled by default.
836
837See also: --replaygain-accurate, --noreplaygain
838
839
840=======================================================================
841Output sampling frequency in kHz
842=======================================================================
843--resample  n
844
845where n = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48. The values as Hz
846instead of Khz are also supported. Else, the value will be ignored.
847
848Output sampling frequency.  Resample the input if necessary.
849
850If not specified, LAME may sometimes resample automatically
851when faced with extreme compression conditions (like encoding
852a 44.1 kHz input file at 32 kbps).  To disable this automatic
853resampling, you have to use --resamle to set the output samplerate
854equal to the input samplerate.  In that case, LAME will not
855perform any extra computations.
856
857
858=======================================================================
859Sampling frequency in kHz (for input RAW PCM)
860=======================================================================
861-s  n
862
863where n = sampling rate in kHz.
864
865Required for raw PCM input files.  Otherwise it will be determined
866from the header information in the input file.
867
868LAME will automatically resample the input file to one of the
869supported MP3 samplerates if necessary.
870
871
872=======================================================================
873Silent operation
874=======================================================================
875-S
876
877don't print progress report
878
879
880=======================================================================
881Scale
882=======================================================================
883--scale <arg>
884
885Scales input by <arg>.  This just multiplies the PCM data
886(after it has been converted to floating point) by <arg>.
887
888<arg> > 1:  increase volume
889<arg> = 1:  no effect
890<arg> < 1:  reduce volume
891
892Use with care, since most MP3 decoders will truncate data
893which decodes to values greater than 32768.
894
895
896=======================================================================
897Strict ISO complience
898=======================================================================
899--strictly-enforce-ISO
900
901With this option, LAME will enforce the 7680 bit limitation on
902total frame size.  This results in many wasted bits for
903high bitrate encodings.
904
905
906=======================================================================
907Disable VBR tag/WAV header
908=======================================================================
909-t
910This setting has two different uses:
911
912When encoding to VBR, this setting disables writing the VBR Tag (also
913known as XING tag). This tag is embedded by default in the frame 0 of
914MP3 file. It allows VBR aware players to accurately seek and compute playing
915times in such files.
916
917When decoding MP3 to WAV using --decode, this flag will disable writing the
918WAV header. The output will be raw pcm, native endian format. Use -x to swap
919bytes.
920
921
922=======================================================================
923VBR quality setting
924=======================================================================
925 -V n Enable VBR encoding
926
927Encodes using the VBR algorithm, at the indicated quality.
9280=highest quality, bigger files. 9.999=lowest quality, smaller files.
929Decimal values can be specified, like: 4.51
930
931On average, the resulting bitrates are as follows:
932Setting       Average bitrate (kbps)
933    0             245
934    2             190
935    3             175
936    4             165
937    5             130
938
939Using -V 7 or higher (lower quality) is not recommended.
940ABR usually produces better results.
941
942
943=======================================================================
944Swap bytes
945=======================================================================
946-x
947
948swap bytes in the input file (and output file when using --decode).
949For sorting out little endian/big endian type problems.  If your encodings
950sound like static, try this first.
951
952
953=======================================================================
954Ignore scalefactor band 21
955=======================================================================
956-Y Ignore noise in sbf21, like CBR mode does
957
958Allows -V2, -V1 and -V0 to not encode the highest frequencies accurately,
959if doing so causes disproportional increases in bitrate.
960This is the same that CBR and ABR modes do.
961
962Due to the design of the MP3 format, to keep precision in the last scalefactor
963band, an encoder needs to increase the precision in all the bands (not only in
964this one).
965The consequence is an increase of bitrate (+60kbps in some cases) compared to
966not keeping that precision. Generally, this band should allow for distortions,
967so using this switch shouldn't cause harm.
968
969