xref: /third_party/lame/USAGE (revision 159b3361)
1159b3361Sopenharmony_ci
2159b3361Sopenharmony_ci% lame [options] inputfile [outputfile]
3159b3361Sopenharmony_ci    inputfile and/or outputfile can be "-", which means stdin/stdout.
4159b3361Sopenharmony_ci
5159b3361Sopenharmony_ciFor more options, just type:
6159b3361Sopenharmony_ci% lame --help  or lame --longhelp
7159b3361Sopenharmony_ci
8159b3361Sopenharmony_ciNote: The HTML documentation is more complete than this text file.
9159b3361Sopenharmony_ci
10159b3361Sopenharmony_ci
11159b3361Sopenharmony_ci=======================================================================
12159b3361Sopenharmony_ciConstant Bitrate Examples:
13159b3361Sopenharmony_ci=======================================================================
14159b3361Sopenharmony_cifixed bit rate jstereo 128 kbps encoding:
15159b3361Sopenharmony_ci% lame -b128 sample.wav  sample.mp3
16159b3361Sopenharmony_ci
17159b3361Sopenharmony_ciUse highest quality mode, slowest:
18159b3361Sopenharmony_ci% lame -q0 -b128 sample.wav  sample.mp3
19159b3361Sopenharmony_ci
20159b3361Sopenharmony_ciUse fast encode, low quality  (no noise shaping)
21159b3361Sopenharmony_ci% lame -f -b128 sample.wav  sample.mp3
22159b3361Sopenharmony_ci
23159b3361Sopenharmony_ci
24159b3361Sopenharmony_ci=======================================================================
25159b3361Sopenharmony_ciVariable Bitrate Examples:
26159b3361Sopenharmony_ci=======================================================================
27159b3361Sopenharmony_ciLAME has two types of variable bitrate: ABR and VBR.
28159b3361Sopenharmony_ci
29159b3361Sopenharmony_ciABR is the type of variable bitrate encoding usually found in other
30159b3361Sopenharmony_ciMP3 encoders, Vorbis and AAC.  The number of bits is determined by
31159b3361Sopenharmony_cisome metric (like perceptual entropy, or just the number of bits
32159b3361Sopenharmony_cineeded for a certain set of encoding tables), and it is not based on
33159b3361Sopenharmony_cicomputing the actual encoding/quantization error.  ABR should always
34159b3361Sopenharmony_cigive results equal or better than CBR:
35159b3361Sopenharmony_ci
36159b3361Sopenharmony_ciABR:   (--abr <x> means encode with an average bitrate of around x kbps)
37159b3361Sopenharmony_ci% lame --abr 128  sample.wav sample.mp3
38159b3361Sopenharmony_ci
39159b3361Sopenharmony_ciAnother way to enable abr is:
40159b3361Sopenharmony_ci% lame --preset 128 sample.wav sample.mp3
41159b3361Sopenharmony_ci
42159b3361Sopenharmony_ci
43159b3361Sopenharmony_ciVBR is a true variable bitrate mode which bases the number of bits for
44159b3361Sopenharmony_cieach frame on the measured quantization error relative to the
45159b3361Sopenharmony_ciestimated allowed masking. The value 0 is the highest quality, which
46159b3361Sopenharmony_cicreates bigger files, and the lowest is 9.999, which creates the smallest
47159b3361Sopenharmony_cifiles. Decimal values can be specified, like: 4.51.
48159b3361Sopenharmony_ciThe resulting filesizes depend on the input material. On typical music 
49159b3361Sopenharmony_ciyou can expect -V5 resulting in files averaging 132 kbps, -V2 averaging 
50159b3361Sopenharmony_ci200 kbps.
51159b3361Sopenharmony_ci
52159b3361Sopenharmony_ciVariable Bitrate (VBR): (use -V n to adjust quality/filesize)
53159b3361Sopenharmony_ci% lame -V2 sample.wav sample.mp3
54159b3361Sopenharmony_ci
55159b3361Sopenharmony_ci
56159b3361Sopenharmony_ci=======================================================================
57159b3361Sopenharmony_ciLow Bitrates
58159b3361Sopenharmony_ci=======================================================================
59159b3361Sopenharmony_ciAt lower bitrates, (like 24 kbps per channel), it is recommended that
60159b3361Sopenharmony_ciyou use a 16 kHz sampling rate combined with lowpass filtering.  LAME,
61159b3361Sopenharmony_cias well as commercial encoders (FhG, Xing) will do this automatically.
62159b3361Sopenharmony_ciHowever, if you feel there is too much (or not enough) lowpass
63159b3361Sopenharmony_cifiltering, you may need to try different values of the lowpass cutoff
64159b3361Sopenharmony_ciand passband width (--resample, --lowpass and --lowpass-width options).
65159b3361Sopenharmony_ci
66159b3361Sopenharmony_ci
67159b3361Sopenharmony_ci=======================================================================
68159b3361Sopenharmony_ciStreaming Example
69159b3361Sopenharmony_ci=======================================================================
70159b3361Sopenharmony_ci
71159b3361Sopenharmony_ci% cat inputfile | lame [options] - - > output
72159b3361Sopenharmony_ci
73159b3361Sopenharmony_ci
74159b3361Sopenharmony_ci=======================================================================
75159b3361Sopenharmony_ciScripts are included (in the 'misc' subdirectory)
76159b3361Sopenharmony_cito run lame on multiple files:
77159b3361Sopenharmony_ci
78159b3361Sopenharmony_cibash script:  mlame      Run "mlame -?" for instructions.
79159b3361Sopenharmony_cish script:    auenc      Run auenc for instructions
80159b3361Sopenharmony_cish script:    mugeco.sh
81159b3361Sopenharmony_ci
82159b3361Sopenharmony_ciPerl script which will re-encode mp3 files and preserve id3 tags:
83159b3361Sopenharmony_cilameid3.pl
84159b3361Sopenharmony_ci
85159b3361Sopenharmony_ciWindows scripts:
86159b3361Sopenharmony_cilame4dos.bat
87159b3361Sopenharmony_ciLame.vbs   (and an HTML frontend: LameGUI.html)
88159b3361Sopenharmony_ci
89159b3361Sopenharmony_ci
90159b3361Sopenharmony_ci=======================================================================
91159b3361Sopenharmony_cioptions guide:
92159b3361Sopenharmony_ci=======================================================================
93159b3361Sopenharmony_ciThese options are explained in detail below.
94159b3361Sopenharmony_ci
95159b3361Sopenharmony_ciBy default, LAME accepts a PCM audio sample inside a .WAV container as the
96159b3361Sopenharmony_ciinput file, in 8, 16, 24 and 32 bits integer and in IEEE FLOAT.
97159b3361Sopenharmony_ciIf it is compiled with libsndfile, then it also supports the extra formats
98159b3361Sopenharmony_cithat the library supports.
99159b3361Sopenharmony_ciThere is also support for raw PCM data and piped input
100159b3361Sopenharmony_ci
101159b3361Sopenharmony_ci
102159b3361Sopenharmony_ciInput options:
103159b3361Sopenharmony_ci--scale <arg>   multiply PCM input by <arg>
104159b3361Sopenharmony_ci--scale-l <arg> scale channel 0 (left) input (multiply PCM data) by <arg>
105159b3361Sopenharmony_ci--scale-r <arg> scale channel 1 (right) input (multiply PCM data) by <arg>
106159b3361Sopenharmony_ci--gain number   apply Gain adjustment in decibels, range -20.0 to +12.0.
107159b3361Sopenharmony_ci--swap-channel	Swap Left and Right input channels
108159b3361Sopenharmony_ci--mp1input      input file is an MPEG 1 Layer I file.  decode on the fly
109159b3361Sopenharmony_ci--mp2input      input file is an MPEG 1 Layer II file.  decode on the fly
110159b3361Sopenharmony_ci--mp3input      input file is an MPEG 1 Layer III file.  decode on the fly
111159b3361Sopenharmony_ci--nogap <file1> <file2> <...>
112159b3361Sopenharmony_ci                gapless encoding for a set of contiguous files
113159b3361Sopenharmony_ci--nogapout <dir>
114159b3361Sopenharmony_ci                output dir for gapless encoding (must precede --nogap)
115159b3361Sopenharmony_ci--nogaptags     allow the use of VBR tags in gapless encoding
116159b3361Sopenharmony_ci--out-dir path	If no explicit output file is specified, a file will be
117159b3361Sopenharmony_ci                written at given path. Ignored when using piped/streamed input
118159b3361Sopenharmony_ci
119159b3361Sopenharmony_ci
120159b3361Sopenharmony_ciInput options for raw PCM:
121159b3361Sopenharmony_ci-r              read the input file as a raw (headerless) PCM stream
122159b3361Sopenharmony_ci-s  n           input sampling frequency in kHz (Default 44.1Khz)
123159b3361Sopenharmony_ci--signed        input is signed (default)
124159b3361Sopenharmony_ci--unsigned      input is unsigned
125159b3361Sopenharmony_ci--bitwidth w    input bit width is w (default 16)
126159b3361Sopenharmony_ci-x              swap bytes of input file
127159b3361Sopenharmony_ci--little-endian input is little-endian (default)
128159b3361Sopenharmony_ci--big-endian    input is big-endian
129159b3361Sopenharmony_ci-a              downmix stereo file to mono file for mono encoding.
130159b3361Sopenharmony_ci                Needed with raw input for the -mm mode to do the downmix.
131159b3361Sopenharmony_ci
132159b3361Sopenharmony_ciResampling and filtering:
133159b3361Sopenharmony_ci--lowpass      Frequency(kHz), lowpass filter cutoff above freq.
134159b3361Sopenharmony_ci               Range [0.001..50]kHz or [50..50000]Hz
135159b3361Sopenharmony_ci--lowpass-width
136159b3361Sopenharmony_ci               Frequency(kHz), lowpass window width.
137159b3361Sopenharmony_ci			   Range [0.001..16]kHz or [16..50000]Hz
138159b3361Sopenharmony_ci			   (See further restriction in the detailed explanation)
139159b3361Sopenharmony_ci--highpass     Frequency(kHz), highpass filter cutoff below freq.
140159b3361Sopenharmony_ci               Range [0.001..16]kHz or [16..50000]Hz
141159b3361Sopenharmony_ci               (See further restriction in the detailed explanation)
142159b3361Sopenharmony_ci--highpass-width
143159b3361Sopenharmony_ci               Frequency(kHz), highpass window width
144159b3361Sopenharmony_ci               (See further restriction in the detailed explanation)
145159b3361Sopenharmony_ci--resample n   Sampling frequency of output file(kHz)
146159b3361Sopenharmony_ci               Default=automatic depending on settings like bitrate.
147159b3361Sopenharmony_ci	
148159b3361Sopenharmony_ciOperational:
149159b3361Sopenharmony_ci--preset type	Enables some preconfigured settings. Check below for each
150159b3361Sopenharmony_ci                of the valid values
151159b3361Sopenharmony_ci--decode        assume input file is an mp3 file, and decode to wav.
152159b3361Sopenharmony_ci--decode-mp3delay samples
153159b3361Sopenharmony_ci                Set the encoder delay to use to decode the input .mp3 file
154159b3361Sopenharmony_ci-t              disable writing of WAV header when using --decode
155159b3361Sopenharmony_ci                (decode to raw pcm, native endian format (use -x to swap))
156159b3361Sopenharmony_ci
157159b3361Sopenharmony_ci-m m/s/j/f/a   mode selection
158159b3361Sopenharmony_ci-q n           Internal algorithm quality setting 0..9.
159159b3361Sopenharmony_ci               0 = slowest algorithms, but potentially highest quality
160159b3361Sopenharmony_ci               9 = faster algorithms, very poor quality
161159b3361Sopenharmony_ci			   Default is 3. Read the differences between VBR and CBR below.
162159b3361Sopenharmony_ci-h             same as -q2
163159b3361Sopenharmony_ci-f             same as -q7
164159b3361Sopenharmony_ci
165159b3361Sopenharmony_ci--priority <type>
166159b3361Sopenharmony_ci               sets the process priority (Windows and OS/2-specific):
167159b3361Sopenharmony_ci                     0,1 = Low priority (IDLE_PRIORITY_CLASS)
168159b3361Sopenharmony_ci                     2 = normal priority (NORMAL_PRIORITY_CLASS, defaul
169159b3361Sopenharmony_ci                     3,4 = High priority (HIGH_PRIORITY_CLASS))
170159b3361Sopenharmony_ci               Note: Calling '--priority' without a parameter will set it to 0.
171159b3361Sopenharmony_ci
172159b3361Sopenharmony_ci
173159b3361Sopenharmony_ci
174159b3361Sopenharmony_ciConstant Bit Rate (CBR)
175159b3361Sopenharmony_ci-b  n          set bitrate (8, 16, 24, ..., 320)
176159b3361Sopenharmony_ci--freeformat   produce a free format bitstream.  User must also specify
177159b3361Sopenharmony_ci               a bitrate with -b, between 8 and 640 kbps.
178159b3361Sopenharmony_ci
179159b3361Sopenharmony_ciVariable Bit Rate (VBR)
180159b3361Sopenharmony_ci-v             VBR  ( alias of -V 4 )
181159b3361Sopenharmony_ci--vbr-old      use old variable bitrate (VBR) routine
182159b3361Sopenharmony_ci--vbr-new      use new variable bitrate (VBR) routine (default)
183159b3361Sopenharmony_ci-V n           VBR quality setting  (0=highest quality, 9.999=lowest)
184159b3361Sopenharmony_ci-b  n          specify a minimum allowed bitrate (8,16,24,...,320)
185159b3361Sopenharmony_ci-B  n          specify a maximum allowed bitrate (8,16,24,...,320)
186159b3361Sopenharmony_ci-F             strictly enforce minimum bitrate
187159b3361Sopenharmony_ci-t             disable VBR informational tag
188159b3361Sopenharmony_ci--nohist       disable display of VBR bitrate histogram
189159b3361Sopenharmony_ci
190159b3361Sopenharmony_ci--abr n        specify average bitrate desired
191159b3361Sopenharmony_ci
192159b3361Sopenharmony_ci
193159b3361Sopenharmony_ci
194159b3361Sopenharmony_ciMP3 header/stream options:
195159b3361Sopenharmony_ci-e  n/5/c       de-emphasis
196159b3361Sopenharmony_ci-p              add CRC error protection
197159b3361Sopenharmony_ci-c              mark the encoded file as copyrighted
198159b3361Sopenharmony_ci-o              mark the encoded file as a copy
199159b3361Sopenharmony_ci-S              don't print progress report, VBR histogram
200159b3361Sopenharmony_ci--strictly-enforce-ISO   comply as much as possible to ISO MPEG spec
201159b3361Sopenharmony_ci--replaygain-fast   compute RG fast but slightly inaccurately (default)
202159b3361Sopenharmony_ci--replaygain-accurate   compute RG more accurately and find the peak sample
203159b3361Sopenharmony_ci--noreplaygain  disable ReplayGain analysis
204159b3361Sopenharmony_ci--clipdetect    enable --replaygain-accurate and print a message whether
205159b3361Sopenharmony_ci                clipping occurs and how far the waveform is from full scale
206159b3361Sopenharmony_ci
207159b3361Sopenharmony_ci
208159b3361Sopenharmony_ciID3 tagging:
209159b3361Sopenharmony_ci
210159b3361Sopenharmony_ci--tt <title>    audio/song title (max 30 chars for version 1 tag)
211159b3361Sopenharmony_ci--ta <artist>   audio/song artist (max 30 chars for version 1 tag)
212159b3361Sopenharmony_ci--tl <album>    audio/song album (max 30 chars for version 1 tag)
213159b3361Sopenharmony_ci--ty <year>     audio/song year of issue (1 to 9999)
214159b3361Sopenharmony_ci--tc <comment>  user-defined text (max 30 chars for v1 tag, 28 for v1.1)
215159b3361Sopenharmony_ci--tn <track[/total]>
216159b3361Sopenharmony_ci                audio/song track number (1 to 255, creates v1.1 tag.
217159b3361Sopenharmony_ci                adding a total force a version 2 tag)
218159b3361Sopenharmony_ci--tg <genre>    audio/song genre (name or number in list)
219159b3361Sopenharmony_ci--ti <file>     audio/song albumArt (jpeg/png/gif file, v2.3 tag)
220159b3361Sopenharmony_ci--tv <id=value> user-defined frame specified by id and value (v2.3 tag)
221159b3361Sopenharmony_ci--add-id3v2     force addition of version 2 tag
222159b3361Sopenharmony_ci--id3v1-only    add only a version 1 tag
223159b3361Sopenharmony_ci--id3v2-only    add only a version 2 tag
224159b3361Sopenharmony_ci--id3v2-utf16   add following options in unicode text encoding
225159b3361Sopenharmony_ci--id3v2-latin1  add following options in latin-1 text encoding
226159b3361Sopenharmony_ci--space-id3v1   pad version 1 tag with spaces instead of nulls
227159b3361Sopenharmony_ci--pad-id3v2     same as '--pad-id3v2-size 128'
228159b3361Sopenharmony_ci--pad-id3v2-size <num>
229159b3361Sopenharmony_ci                adds version 2 tag, pad with extra <num> bytes
230159b3361Sopenharmony_ci--genre-list    print alphabetically sorted ID3 genre list and exit
231159b3361Sopenharmony_ci--ignore-tag-errors
232159b3361Sopenharmony_ci                ignore errors in values passed for tags
233159b3361Sopenharmony_ci
234159b3361Sopenharmony_ciNote: A version 2 tag will NOT be added unless one of the input fields
235159b3361Sopenharmony_ciwon't fit in a version 1 tag (e.g. the title string is longer than 30
236159b3361Sopenharmony_cicharacters), or the '--add-id3v2' or '--id3v2-only' options are used,
237159b3361Sopenharmony_cior output is redirected to stdout.
238159b3361Sopenharmony_ci
239159b3361Sopenharmony_ci
240159b3361Sopenharmony_ciVerbosity:
241159b3361Sopenharmony_ci--disptime     secs	Print progress report every secs seconds
242159b3361Sopenharmony_ci--nohist	   Disable VBR histogram display
243159b3361Sopenharmony_ci--silent       Don't print anything on screen
244159b3361Sopenharmony_ci--quiet        Don't print anything on screen
245159b3361Sopenharmony_ci--verbose	   Print a lot of useful information
246159b3361Sopenharmony_ci--version      Print License information
247159b3361Sopenharmony_ci--license	   Print License information
248159b3361Sopenharmony_ci--help         Shows the common list of switches.
249159b3361Sopenharmony_ci               Add id3 or dev to get help for a specified topic
250159b3361Sopenharmony_ci--usage        Shows the common list of switches.
251159b3361Sopenharmony_ci               Add id3 or dev to get help for a specified topic
252159b3361Sopenharmony_ci--longhelp     Shows the complete list of switches
253159b3361Sopenharmony_ci
254159b3361Sopenharmony_ci
255159b3361Sopenharmony_ci
256159b3361Sopenharmony_ci=======================================================================
257159b3361Sopenharmony_ciDetailed description of all options in alphabetical order
258159b3361Sopenharmony_ci=======================================================================
259159b3361Sopenharmony_ci
260159b3361Sopenharmony_ci
261159b3361Sopenharmony_ci=======================================================================
262159b3361Sopenharmony_ciDownmix
263159b3361Sopenharmony_ci=======================================================================
264159b3361Sopenharmony_ci-a
265159b3361Sopenharmony_ci
266159b3361Sopenharmony_cimix the stereo input file to mono and encode as mono.
267159b3361Sopenharmony_ci
268159b3361Sopenharmony_ciThis option is only needed in the case of raw PCM stereo input
269159b3361Sopenharmony_ci(because LAME cannot determine the number of channels in the input file).
270159b3361Sopenharmony_ciTo encode a stereo (RAW) PCM input file as mono, use "lame -m m -a"
271159b3361Sopenharmony_ci
272159b3361Sopenharmony_ciFor WAV and AIFF input files, using "-m m" will always produce a
273159b3361Sopenharmony_cimono .mp3 file from both mono and stereo input.
274159b3361Sopenharmony_ci
275159b3361Sopenharmony_ci
276159b3361Sopenharmony_ci=======================================================================
277159b3361Sopenharmony_ciAverage bitrate encoding (aka Safe VBR)
278159b3361Sopenharmony_ci=======================================================================
279159b3361Sopenharmony_ci--abr n
280159b3361Sopenharmony_ci
281159b3361Sopenharmony_citurns on encoding with a targeted average bitrate of n kbps, allowing
282159b3361Sopenharmony_cito use frames of different sizes.  The allowed range of n is 8...320
283159b3361Sopenharmony_cikbps, you can use any integer value within that range.
284159b3361Sopenharmony_ci
285159b3361Sopenharmony_ci
286159b3361Sopenharmony_ci=======================================================================
287159b3361Sopenharmony_ciUse version 2 of the ID3 tag standard
288159b3361Sopenharmony_ci=======================================================================
289159b3361Sopenharmony_ci --add-id3v2 Force addition of version 2 tag
290159b3361Sopenharmony_ci
291159b3361Sopenharmony_ciTells LAME to add the tag information as id3v2. This implies adding both,
292159b3361Sopenharmony_cia version 1 and a version 2 tag, if the values fit on a version 1 tag.
293159b3361Sopenharmony_ciSee --id3v1-only and --id3v2-only if you want a more fine-grained control.
294159b3361Sopenharmony_ci
295159b3361Sopenharmony_ci
296159b3361Sopenharmony_ci=======================================================================
297159b3361Sopenharmony_ciBitrate
298159b3361Sopenharmony_ci=======================================================================
299159b3361Sopenharmony_ci-b  n
300159b3361Sopenharmony_ci
301159b3361Sopenharmony_ciMPEG-1   layer III sample frequencies (kHz):  32  48  44.1
302159b3361Sopenharmony_cibitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320
303159b3361Sopenharmony_ci
304159b3361Sopenharmony_ciMPEG-2   layer III sample frequencies (kHz):  16  24  22.05
305159b3361Sopenharmony_cibitrates (kbps):  8 16 24 32 40 48 56 64 80 96 112 128 144 160
306159b3361Sopenharmony_ci
307159b3361Sopenharmony_ciMPEG-2.5 layer III sample frequencies (kHz):   8  12  11.025
308159b3361Sopenharmony_cibitrates (kbps):  8 16 24 32 40 48 56 64
309159b3361Sopenharmony_ci
310159b3361Sopenharmony_ciThe bitrate to be used.  Default is 128kbps in MPEG1 (64 for mono),
311159b3361Sopenharmony_ci64kbps in MPEG2 (32 for mono) and 32kbps in MPEG2.5 (16 for mono).
312159b3361Sopenharmony_ci
313159b3361Sopenharmony_ciWhen used with variable bitrate encodings (VBR), -b specifies the
314159b3361Sopenharmony_ciminimum bitrate to use.  This is useful only if you need to circumvent
315159b3361Sopenharmony_cia buggy hardware device with strange bitrate constrains.
316159b3361Sopenharmony_ci
317159b3361Sopenharmony_ci
318159b3361Sopenharmony_ci=======================================================================
319159b3361Sopenharmony_ciMax bitrate
320159b3361Sopenharmony_ci=======================================================================
321159b3361Sopenharmony_ci-B  n
322159b3361Sopenharmony_ci
323159b3361Sopenharmony_cisee also option "-b" for allowed bitrates.
324159b3361Sopenharmony_ci
325159b3361Sopenharmony_ciMaximum allowed bitrate when using VBR/ABR.
326159b3361Sopenharmony_ci
327159b3361Sopenharmony_ciUsing -B is NOT RECOMMENDED.  A 128 kbps CBR bitstream, because of the
328159b3361Sopenharmony_cibit reservoir, can actually have frames which use as many bits as a
329159b3361Sopenharmony_ci320 kbps frame.  ABR/VBR modes minimize the use of the bit reservoir, and
330159b3361Sopenharmony_cithus need to allow 320 kbps frames to get the same flexability as CBR
331159b3361Sopenharmony_cistreams.  This is useful only if you need to circumvent a buggy hardware
332159b3361Sopenharmony_cidevice with strange bitrate constrains.
333159b3361Sopenharmony_ci
334159b3361Sopenharmony_ci
335159b3361Sopenharmony_ci=======================================================================
336159b3361Sopenharmony_ciEndianess, big.
337159b3361Sopenharmony_ci=======================================================================
338159b3361Sopenharmony_ci --big-endian Set the byte order to big-endian.
339159b3361Sopenharmony_ci
340159b3361Sopenharmony_ciThis switch tells LAME that the RAW pcm input is encoded in big-endian
341159b3361Sopenharmony_ciinstead of little-endian.
342159b3361Sopenharmony_ci
343159b3361Sopenharmony_ci
344159b3361Sopenharmony_ci=======================================================================
345159b3361Sopenharmony_ciSample bit with
346159b3361Sopenharmony_ci=======================================================================
347159b3361Sopenharmony_ci--bitwidth Sets the bitwidth value
348159b3361Sopenharmony_ci
349159b3361Sopenharmony_ciWith RAW pcm input, this switch lets you specify the bitwidth of the same
350159b3361Sopenharmony_ci(8 bits, 16 bits...)
351159b3361Sopenharmony_ci
352159b3361Sopenharmony_ci
353159b3361Sopenharmony_ci=======================================================================
354159b3361Sopenharmony_ciCopyright
355159b3361Sopenharmony_ci=======================================================================
356159b3361Sopenharmony_ci-c
357159b3361Sopenharmony_ci
358159b3361Sopenharmony_ciflag the encoded file as copyrighted
359159b3361Sopenharmony_ci
360159b3361Sopenharmony_ci
361159b3361Sopenharmony_ci=======================================================================
362159b3361Sopenharmony_ciClipping detection
363159b3361Sopenharmony_ci=======================================================================
364159b3361Sopenharmony_ci--clipdetect
365159b3361Sopenharmony_ci
366159b3361Sopenharmony_ciEnable --replaygain-accurate and print a message whether clipping
367159b3361Sopenharmony_cioccurs and how far in dB the waveform is from full scale.
368159b3361Sopenharmony_ci
369159b3361Sopenharmony_ciThis option is not usable if the MP3 decoder was _explicitly_ disabled
370159b3361Sopenharmony_ciin the build of LAME.
371159b3361Sopenharmony_ci
372159b3361Sopenharmony_ciSee also: --replaygain-accurate
373159b3361Sopenharmony_ci
374159b3361Sopenharmony_ci
375159b3361Sopenharmony_ci=======================================================================
376159b3361Sopenharmony_ciMPEG audio decode capability
377159b3361Sopenharmony_ci=======================================================================
378159b3361Sopenharmony_ci--decode
379159b3361Sopenharmony_ci
380159b3361Sopenharmony_ciThis uses LAME's HIP decoder to decode an MP3 file (layers 1, 2 and 3) to
381159b3361Sopenharmony_cia wav file.
382159b3361Sopenharmony_ci
383159b3361Sopenharmony_ciIf -t is used (disable wav header), LAME will output
384159b3361Sopenharmony_ciraw pcm in native endian format (use -x to swap bytes).
385159b3361Sopenharmony_ci
386159b3361Sopenharmony_ciThis option is not usable if the MP3 decoder was _explicitly_ disabled
387159b3361Sopenharmony_ciin the build of LAME.
388159b3361Sopenharmony_ci
389159b3361Sopenharmony_ciHIP stands for Hip Isn't a Player and is based off of Michael Hipp's mpglib 0.2a
390159b3361Sopenharmony_ci
391159b3361Sopenharmony_ci
392159b3361Sopenharmony_ci=======================================================================
393159b3361Sopenharmony_ciMPEG audio decode capability
394159b3361Sopenharmony_ci=======================================================================
395159b3361Sopenharmony_ci--decode-mp3delay x Indicate a different encoder delay for decoding
396159b3361Sopenharmony_ci
397159b3361Sopenharmony_ciWhen decoding an mp3 file, LAME automatically corrects for the start delay
398159b3361Sopenharmony_cithat the encoder had to put into it. This setting lets you specify a different
399159b3361Sopenharmony_cidelay than LAME's own one, so that it is possible to compensate for the delay
400159b3361Sopenharmony_ciof mp3's generated with other encoders.
401159b3361Sopenharmony_ci
402159b3361Sopenharmony_ci
403159b3361Sopenharmony_ci=======================================================================
404159b3361Sopenharmony_ciDe-emphasis
405159b3361Sopenharmony_ci=======================================================================
406159b3361Sopenharmony_ci-e  n/5/c
407159b3361Sopenharmony_ci
408159b3361Sopenharmony_ci  n = (none, default)
409159b3361Sopenharmony_ci  5 = 0/15 microseconds
410159b3361Sopenharmony_ci  c = CCITT j.17
411159b3361Sopenharmony_ci
412159b3361Sopenharmony_ciAll this does is set a flag in the bitstream.  If you have a PCM
413159b3361Sopenharmony_ciinput file where one of the above types of (obsolete) emphasis has
414159b3361Sopenharmony_cibeen applied, you can set this flag in LAME.  Then the mp3 decoder
415159b3361Sopenharmony_cishould de-emphasize the output during playback, although most
416159b3361Sopenharmony_cidecoders ignore this flag.
417159b3361Sopenharmony_ci
418159b3361Sopenharmony_ciA better solution would be to apply the de-emphasis with a standalone
419159b3361Sopenharmony_ciutility before encoding, and then encode without -e.
420159b3361Sopenharmony_ci
421159b3361Sopenharmony_ci
422159b3361Sopenharmony_ci=======================================================================
423159b3361Sopenharmony_ciStrictly enforce VBR minimum bitrate
424159b3361Sopenharmony_ci=======================================================================
425159b3361Sopenharmony_ci-F
426159b3361Sopenharmony_ci
427159b3361Sopenharmony_cistrictly enforce VBR minimum bitrate.   Without this option, passages of
428159b3361Sopenharmony_cianalog silence will be encoded at the minimum bitrate possible (32 or 8,
429159b3361Sopenharmony_cidepending on MPEG version).
430159b3361Sopenharmony_ci
431159b3361Sopenharmony_ci
432159b3361Sopenharmony_ci=======================================================================
433159b3361Sopenharmony_ciFree format bitstreams
434159b3361Sopenharmony_ci=======================================================================
435159b3361Sopenharmony_ci--freeformat
436159b3361Sopenharmony_ci
437159b3361Sopenharmony_ciLAME will produce a fixed bitrate, free format bitstream. User must 
438159b3361Sopenharmony_cispecify the desired bitrate in kbps, which can be any integer between 
439159b3361Sopenharmony_ci8 and 640.
440159b3361Sopenharmony_ci
441159b3361Sopenharmony_ciNot supported by most decoders.  Complient decoders (of which there
442159b3361Sopenharmony_ciare few) are only required to support up to 320 kbps.
443159b3361Sopenharmony_ci
444159b3361Sopenharmony_ciDecoders known to handle free format:
445159b3361Sopenharmony_ci
446159b3361Sopenharmony_ci                      supports up to
447159b3361Sopenharmony_cimpg123                   640 kbps
448159b3361Sopenharmony_ciMAD                      640 kbps
449159b3361Sopenharmony_ci"lame --decode"          640 kbps
450159b3361Sopenharmony_cil3dec                    310 kbps
451159b3361Sopenharmony_ci
452159b3361Sopenharmony_ci
453159b3361Sopenharmony_ci=======================================================================
454159b3361Sopenharmony_ciGain
455159b3361Sopenharmony_ci=======================================================================
456159b3361Sopenharmony_ci--gain Apply gain in decibels.
457159b3361Sopenharmony_ci
458159b3361Sopenharmony_ciApply Gain adjustment in decibels, range -20.0 to +12.0. 0dBFS means no 
459159b3361Sopenharmony_ciamplification.
460159b3361Sopenharmony_ci
461159b3361Sopenharmony_ci
462159b3361Sopenharmony_ci=======================================================================
463159b3361Sopenharmony_ciHigh pass filter
464159b3361Sopenharmony_ci=======================================================================
465159b3361Sopenharmony_ci--highpass number Use a highpass filter when encoding
466159b3361Sopenharmony_ci
467159b3361Sopenharmony_ciEnables a highpass filter of the specified frequency when encoding the source.
468159b3361Sopenharmony_ci    Range [0.001..50]kHz or [50..50000]Hz.
469159b3361Sopenharmony_ciThis is usually not required, and the gains are usually minimal. May be useful
470159b3361Sopenharmony_cito remove an interference signal on 50Hz or 60Hz, or a DC offset.
471159b3361Sopenharmony_ci(default: disabled)
472159b3361Sopenharmony_ciNote: The current implementation has a minimum highpass frequency of
473159b3361Sopenharmony_ci(67.5/62)% of the sample rate (I.e. 481Hz at 44Khz).
474159b3361Sopenharmony_ci
475159b3361Sopenharmony_ci
476159b3361Sopenharmony_ci=======================================================================
477159b3361Sopenharmony_ciHigh pass filter
478159b3361Sopenharmony_ci=======================================================================
479159b3361Sopenharmony_ci--highpass-width width Set the width of the decaying curve.
480159b3361Sopenharmony_ci
481159b3361Sopenharmony_ciSpecify the width in Hz of the decaying curve of the highpass.
482159b3361Sopenharmony_ci    Range [16..50000]Hz
483159b3361Sopenharmony_ciThe minimum (and default) width is 75% of a band's width (which is 1/64th of
484159b3361Sopenharmony_ci the sample rate).
485159b3361Sopenharmony_ciNote: See the remark in the --highpass command above.
486159b3361Sopenharmony_ci
487159b3361Sopenharmony_ci
488159b3361Sopenharmony_ci=======================================================================
489159b3361Sopenharmony_ciID3 tag modes
490159b3361Sopenharmony_ci=======================================================================
491159b3361Sopenharmony_ci--id3v1-only Disable the use of id3v2.
492159b3361Sopenharmony_ci
493159b3361Sopenharmony_ciPut it before any tag setting.
494159b3361Sopenharmony_ciThis setting tells LAME to use ID3 v1 tag only, and not create an ID3v2
495159b3361Sopenharmony_cieven if it thinks it should.
496159b3361Sopenharmony_ci
497159b3361Sopenharmony_ci--id3v2-only Disable the user ov id3v1.
498159b3361Sopenharmony_ci
499159b3361Sopenharmony_ciPut it before any tag setting.
500159b3361Sopenharmony_ciThis setting tells LAME to use ID3 v2 tag only. An ID3 v1 tag would not
501159b3361Sopenharmony_cibe written.
502159b3361Sopenharmony_ci
503159b3361Sopenharmony_ci--ignore-tag-errors Ignore tag information errors
504159b3361Sopenharmony_ci
505159b3361Sopenharmony_ciPut it before any tag setting.
506159b3361Sopenharmony_ciThis tells lame to ignore the tag information it sees as erroneous and 
507159b3361Sopenharmony_cicontinue encoding without those. Without this setting, errors are reported
508159b3361Sopenharmony_ciand encoding does not start.
509159b3361Sopenharmony_ci
510159b3361Sopenharmony_ci
511159b3361Sopenharmony_ci=======================================================================
512159b3361Sopenharmony_ciEndianess. little
513159b3361Sopenharmony_ci=======================================================================
514159b3361Sopenharmony_ci--little-endian Set the byte order to little-endian.
515159b3361Sopenharmony_ci
516159b3361Sopenharmony_ciThis switch tells LAME that the RAW pcm input is encoded in little-endian.
517159b3361Sopenharmony_ciIt is the default setting.
518159b3361Sopenharmony_ci
519159b3361Sopenharmony_ci
520159b3361Sopenharmony_ci=======================================================================
521159b3361Sopenharmony_ciLow pass filter
522159b3361Sopenharmony_ci=======================================================================
523159b3361Sopenharmony_ci--lowpass number Use a lowpass filter when encoding
524159b3361Sopenharmony_ci
525159b3361Sopenharmony_ciEnables a lowpass filter of the specified frequency when encoding the source.
526159b3361Sopenharmony_ci    Range [0.001..50]kHz or [50..50000]Hz
527159b3361Sopenharmony_ci
528159b3361Sopenharmony_ciUsing a lowpass filter helps reducing the amount of data to encode. This is
529159b3361Sopenharmony_ciimportant in MP3 due to a limitation in very high frequencies (>16Khz).
530159b3361Sopenharmony_ciThe default value depends on the target bitrate/quality. It is not recommended
531159b3361Sopenharmony_cito change it as a general basis.
532159b3361Sopenharmony_ci
533159b3361Sopenharmony_ci--lowpass-width width Set the width of the decaying curve.
534159b3361Sopenharmony_ci
535159b3361Sopenharmony_ciSpecify the width in Hz of the decaying curve of the lowpass.
536159b3361Sopenharmony_ci    Range [0.001..16]kHz or [16..50000]Hz
537159b3361Sopenharmony_ciThe lowpass is in the center of this curve. The minimum (and default) width
538159b3361Sopenharmony_ciis 75% of a band's width (which is 1/64th of the sample rate).
539159b3361Sopenharmony_ci
540159b3361Sopenharmony_ci
541159b3361Sopenharmony_ci=======================================================================
542159b3361Sopenharmony_ciModes:
543159b3361Sopenharmony_ci=======================================================================
544159b3361Sopenharmony_ci-m m        mono
545159b3361Sopenharmony_ci-m l	    get only the left channel of a stereo signal for a mono output
546159b3361Sopenharmony_ci-m r	    get only the right channel of a stereo signal for a mono output
547159b3361Sopenharmony_ci-m s        (forced) L/R stereo
548159b3361Sopenharmony_ci-m j        joint stereo
549159b3361Sopenharmony_ci-m f        forced mid/side stereo
550159b3361Sopenharmony_ci-m d        dual (independent) channels. Its purpose was meant for dual language
551159b3361Sopenharmony_ci            streams where only one of them should be decoded.
552159b3361Sopenharmony_ci			Most decoders just decode them as a stereo stream.
553159b3361Sopenharmony_ci-m a        Currently, a synonym of m j. (In older releases it selected
554159b3361Sopenharmony_ci            different modes depending on the bitrate)
555159b3361Sopenharmony_ci
556159b3361Sopenharmony_ciMONO is the default mode for mono input files.  If "-m m" is specified
557159b3361Sopenharmony_cifor a stereo input file, the two channels will be averaged into a mono
558159b3361Sopenharmony_cisignal.  (Note: See comments about the -a switch for RAW PCM streams)
559159b3361Sopenharmony_ci
560159b3361Sopenharmony_ci(FORCED) L/R STEREO encodes the left and the right signals independently,
561159b3361Sopenharmony_ciand gives more or less bits to each, depending on the currently available.
562159b3361Sopenharmony_ci
563159b3361Sopenharmony_ciJOINT STEREO is the default mode of encoding.
564159b3361Sopenharmony_cijstereo means the encoder can use (on a frame by frame basis) either
565159b3361Sopenharmony_ciL/R stereo or mid/side stereo.  In mid/side stereo, the mid(L+R) and side(L-R)
566159b3361Sopenharmony_cichannels are encoded, and more bits are allocated to the mid channel
567159b3361Sopenharmony_cithan the side channel.  When there isn't too much stereo separation, this
568159b3361Sopenharmony_cieffectively increases the bandwidth, so having higher quality with the same
569159b3361Sopenharmony_ciamount of bits.
570159b3361Sopenharmony_ci
571159b3361Sopenharmony_ciUsing mid/side stereo inappropriately can result in audible
572159b3361Sopenharmony_cicompression artifacts.  Too much switching between mid/side and L/R
573159b3361Sopenharmony_cistereo can also sound bad. To determine when to switch to mid/side
574159b3361Sopenharmony_cistereo, LAME uses a much more sophisticated algorithm than that
575159b3361Sopenharmony_cidescribed in the ISO documentation.
576159b3361Sopenharmony_ci
577159b3361Sopenharmony_ciFORCED MID/SIDE STEREO forces all frames to be encoded mid/side stereo.  It
578159b3361Sopenharmony_cishould only be used if you are sure every frame of the input file
579159b3361Sopenharmony_cihas very little stereo seperation.
580159b3361Sopenharmony_ci
581159b3361Sopenharmony_ciDUAL CHANNEL mode is similar to encode the left and right as two mono signals.
582159b3361Sopenharmony_ciIts purpose was meant for Dual language streams where only one of them should
583159b3361Sopenharmony_cibe decoded. Most decoders just decode them as a stereo stream
584159b3361Sopenharmony_ci
585159b3361Sopenharmony_ciINTENSITY STEREO
586159b3361Sopenharmony_ci	Not supported.
587159b3361Sopenharmony_ci
588159b3361Sopenharmony_ci
589159b3361Sopenharmony_ci=======================================================================
590159b3361Sopenharmony_ciMP3 input file
591159b3361Sopenharmony_ci=======================================================================
592159b3361Sopenharmony_ci--mp1input --mp2input --mp3input MPEG layer I, II or III input file
593159b3361Sopenharmony_ci
594159b3361Sopenharmony_ciAssume the input file is a MP1/2/3 file.  LAME will decode the input file
595159b3361Sopenharmony_cibefore re-encoding it.  Since MP3 is a lossy format, this is not recommended 
596159b3361Sopenharmony_ciin general.  But it is useful for creating low bitrate mp3s from high bitrate 
597159b3361Sopenharmony_cimp3s.  If the filename ends in ".mp3" LAME will assume it is an MP3.  For 
598159b3361Sopenharmony_cistdin or MP3 files which dont end in .mp3 you need to use this switch.
599159b3361Sopenharmony_ci
600159b3361Sopenharmony_ci
601159b3361Sopenharmony_ci=======================================================================
602159b3361Sopenharmony_ciNo Gap (continuous audio) encoding of multiple files
603159b3361Sopenharmony_ci=======================================================================
604159b3361Sopenharmony_ci --nogap file1 file2 [...] Encodes multiple continuous files.
605159b3361Sopenharmony_ci
606159b3361Sopenharmony_ciEncodes multiple files (ordered by position) which are meant to be played
607159b3361Sopenharmony_cigaplessly.
608159b3361Sopenharmony_ci
609159b3361Sopenharmony_ciBy default, LAME will encode the files with accurate length, but the first
610159b3361Sopenharmony_ciand last frame may contain a few erroneous samples for signals that don't
611159b3361Sopenharmony_cifade-in/out (as is the case of continuous playback).
612159b3361Sopenharmony_ci
613159b3361Sopenharmony_ciThis setting solves that by using the samples from the next/previous file to
614159b3361Sopenharmony_cicompute the encoding.
615159b3361Sopenharmony_ci
616159b3361Sopenharmony_ci--nogapout dir Specify a directory for the output of the files encoded
617159b3361Sopenharmony_ci               with --nogap
618159b3361Sopenharmony_ci
619159b3361Sopenharmony_ciThis setting should precede --nogap, and is used to specify the alternate
620159b3361Sopenharmony_cidirectory where to store the encoded files. The default one is the input file
621159b3361Sopenharmony_cidirectory.
622159b3361Sopenharmony_ci
623159b3361Sopenharmony_ci--nogaptags Enables the use of VBR tags with files encoded with --nogap
624159b3361Sopenharmony_ci
625159b3361Sopenharmony_ciTells LAME to put VBR tags to encoded files if they are encoded in VBR or ABR
626159b3361Sopenharmony_cimodes. Else, using the --nogap option doesn't generate it.
627159b3361Sopenharmony_ci
628159b3361Sopenharmony_ci
629159b3361Sopenharmony_ci=======================================================================
630159b3361Sopenharmony_ciDisable historgram display
631159b3361Sopenharmony_ci=======================================================================
632159b3361Sopenharmony_ci--nohist
633159b3361Sopenharmony_ci
634159b3361Sopenharmony_ciBy default, LAME will display a bitrate histogram while producing
635159b3361Sopenharmony_ciVBR mp3 files.  This will disable that feature.
636159b3361Sopenharmony_ci
637159b3361Sopenharmony_ci
638159b3361Sopenharmony_ci=======================================================================
639159b3361Sopenharmony_ciDisable ReplayGain analysis
640159b3361Sopenharmony_ci=======================================================================
641159b3361Sopenharmony_ci--noreplaygain
642159b3361Sopenharmony_ci
643159b3361Sopenharmony_ciBy default ReplayGain analysis is enabled. This switch disables it.
644159b3361Sopenharmony_ci
645159b3361Sopenharmony_ciSee also: --replaygain-accurate, --replaygain-fast
646159b3361Sopenharmony_ci
647159b3361Sopenharmony_ci
648159b3361Sopenharmony_ci=======================================================================
649159b3361Sopenharmony_ciNon-original
650159b3361Sopenharmony_ci=======================================================================
651159b3361Sopenharmony_ci-o
652159b3361Sopenharmony_ci
653159b3361Sopenharmony_cimark the encoded file as a copy
654159b3361Sopenharmony_ci
655159b3361Sopenharmony_ci
656159b3361Sopenharmony_ci=======================================================================
657159b3361Sopenharmony_ciCRC error protection
658159b3361Sopenharmony_ci=======================================================================
659159b3361Sopenharmony_ci-p
660159b3361Sopenharmony_ci
661159b3361Sopenharmony_ciTurn on CRC error protection.
662159b3361Sopenharmony_ciIt will add a cyclic redundancy check (CRC) code in each frame, allowing
663159b3361Sopenharmony_cito detect transmission errors that could occur on the MP3 stream. However,
664159b3361Sopenharmony_ciit takes 16 bits per frame that would otherwise be used for encoding, and
665159b3361Sopenharmony_citherefore will slightly reduce the sound quality.
666159b3361Sopenharmony_ci
667159b3361Sopenharmony_ci
668159b3361Sopenharmony_ci=======================================================================
669159b3361Sopenharmony_ciID3 V2 padding
670159b3361Sopenharmony_ci=======================================================================
671159b3361Sopenharmony_ci --pad-id3v2 Pad ID3v2 tag.
672159b3361Sopenharmony_ci
673159b3361Sopenharmony_ciPads the ID3v2 tag with extra 128bytes to allow it to expand.
674159b3361Sopenharmony_ci
675159b3361Sopenharmony_ci
676159b3361Sopenharmony_ci=======================================================================
677159b3361Sopenharmony_ciPreset system.
678159b3361Sopenharmony_ci=======================================================================
679159b3361Sopenharmony_ci--preset x Enable one of the presets
680159b3361Sopenharmony_ci
681159b3361Sopenharmony_ci   Setting         Meaning
682159b3361Sopenharmony_ci--preset medium	   -V 5
683159b3361Sopenharmony_ci--preset standard  -V 2
684159b3361Sopenharmony_ci--preset extreme   -V 0
685159b3361Sopenharmony_ci--preset insane    -b 320
686159b3361Sopenharmony_ci--preset fast xxx  In versions older than LAME 3.98, "fast" was needed to
687159b3361Sopenharmony_ci                   enable the vbr-new routine. It is no longer needed.
688159b3361Sopenharmony_ci--preset number	   --abr number
689159b3361Sopenharmony_ci--preset cbr number	-b number
690159b3361Sopenharmony_ci
691159b3361Sopenharmony_ciOld compatibility settings. Meaningless
692159b3361Sopenharmony_ci--preset phone	   -b 16 -m m
693159b3361Sopenharmony_ci--preset phon+ /
694159b3361Sopenharmony_ci      lw / mw-eu   -b 24 -m m
695159b3361Sopenharmony_ci--preset mw-us     -b 40 -m m
696159b3361Sopenharmony_ci--preset voice     -b 56 -m m
697159b3361Sopenharmony_ci--preset fm / radio -b 112
698159b3361Sopenharmony_ci--preset hifi      -b 160
699159b3361Sopenharmony_ci--preset cd        -b 192
700159b3361Sopenharmony_ci--preset studio    -b 256
701159b3361Sopenharmony_ci
702159b3361Sopenharmony_ci
703159b3361Sopenharmony_ci=======================================================================
704159b3361Sopenharmony_ciWindows and OS/2 process priority control
705159b3361Sopenharmony_ci=======================================================================
706159b3361Sopenharmony_ci--priority <type>
707159b3361Sopenharmony_ci
708159b3361Sopenharmony_ci(Windows and OS/2 only)
709159b3361Sopenharmony_ci
710159b3361Sopenharmony_ciSets the process priority for LAME while running under Windows or IBM OS/2.
711159b3361Sopenharmony_ciThis can be very useful to avoid the system becoming slow and/or unresponsive. 
712159b3361Sopenharmony_ciBy setting LAME to run in a lower priority, you leave more time for the system 
713159b3361Sopenharmony_cito update basic processing (drawing windows, polling keyboard/mouse, etc). The 
714159b3361Sopenharmony_ciimpact in LAME's performance is minimal if you use priority 0 to 2.
715159b3361Sopenharmony_ci
716159b3361Sopenharmony_ciThe valid parameters are:
717159b3361Sopenharmony_ci
718159b3361Sopenharmony_ci     0 = Low priority (IDLE, delta = 0)
719159b3361Sopenharmony_ci     1 = Medium priority (IDLE, delta = +31)
720159b3361Sopenharmony_ci     2 = Regular priority (REGULAR, delta = -31)
721159b3361Sopenharmony_ci     3 = High priority (REGULAR, delta = 0)
722159b3361Sopenharmony_ci     4 = Maximum priority (REGULAR, delta = +31)
723159b3361Sopenharmony_ci
724159b3361Sopenharmony_ciNote that if you call '--priority' without a parameter, priority 0 will be 
725159b3361Sopenharmony_ciassumed.
726159b3361Sopenharmony_ci
727159b3361Sopenharmony_ci
728159b3361Sopenharmony_ci=======================================================================
729159b3361Sopenharmony_ciAlgorithm quality selection
730159b3361Sopenharmony_ci=======================================================================
731159b3361Sopenharmony_ci-q n
732159b3361Sopenharmony_ci
733159b3361Sopenharmony_ciBitrate is of course the main influence on quality. The higher the bitrate,
734159b3361Sopenharmony_cithe higher the quality. But for a given bitrate, we have a choice of algorithms
735159b3361Sopenharmony_cito determine the best scalefactors and Huffman coding (noise shaping).
736159b3361Sopenharmony_ci
737159b3361Sopenharmony_ciFor CBR, ABR and --vbr-old modes, the following table applies
738159b3361Sopenharmony_ci
739159b3361Sopenharmony_ci-q 0            Use the best algorithms (Best Huffman coding search, full outer
740159b3361Sopenharmony_ci                loop, and the highest precision of several parameters).
741159b3361Sopenharmony_ci-q 1 to -q 4    Similar to -q 0 without the full outer loop and decreasing
742159b3361Sopenharmony_ci                precision of parameters the further from q0. -q 3 is the default
743159b3361Sopenharmony_ci-q 5 and -q 6   Same as -q 7, but enables noise shaping and increases subblock
744159b3361Sopenharmony_ci                gain
745159b3361Sopenharmony_ci-q 7 to -q 9    Same as -f. Very fast, OK quality. Psychoacoustics are used for
746159b3361Sopenharmony_ci                pre-echo and mid/side stereo, but no noise-shaping is done.
747159b3361Sopenharmony_ci
748159b3361Sopenharmony_ciFor the default VBR mode since LAME 3.98, the following table applies
749159b3361Sopenharmony_ci
750159b3361Sopenharmony_ci-q 0 to -q 4    include all features of the other modes and additionally use
751159b3361Sopenharmony_ci                the best search when applying Huffman coding.
752159b3361Sopenharmony_ci-q 5 and -q 6   include all features of -q7, calculate and consider actual
753159b3361Sopenharmony_ci                quantisation noise, and additionally enable subblock gain.
754159b3361Sopenharmony_ci-q 7 to -q 9    This level uses a psymodel but does not calculate quantisation
755159b3361Sopenharmony_ci                noise when encoding: it takes a quick guess.
756159b3361Sopenharmony_ci
757159b3361Sopenharmony_ci
758159b3361Sopenharmony_ci=======================================================================
759159b3361Sopenharmony_ciInput file is raw pcm
760159b3361Sopenharmony_ci=======================================================================
761159b3361Sopenharmony_ci-r
762159b3361Sopenharmony_ci
763159b3361Sopenharmony_ciAssume the input file is raw pcm.  Sampling rate and mono/stereo/jstereo
764159b3361Sopenharmony_cimust be specified on the command line.  Without -r, LAME will perform
765159b3361Sopenharmony_ciseveral fseek()'s on the input file looking for WAV and AIFF headers.
766159b3361Sopenharmony_ci
767159b3361Sopenharmony_ciNot supported if LAME is compiled to use LIBSNDFILE.
768159b3361Sopenharmony_ci
769159b3361Sopenharmony_ci
770159b3361Sopenharmony_ci=======================================================================
771159b3361Sopenharmony_ciSlightly more accurate ReplayGain analysis and finding the peak sample
772159b3361Sopenharmony_ci=======================================================================
773159b3361Sopenharmony_ci--replaygain-accurate
774159b3361Sopenharmony_ci
775159b3361Sopenharmony_ciCompute "Radio" ReplayGain on the decoded data stream. Find the peak sample
776159b3361Sopenharmony_ciby decoding on the fly the encoded data stream and store it in the file.
777159b3361Sopenharmony_ci
778159b3361Sopenharmony_ci
779159b3361Sopenharmony_ciReplayGain analysis does _not_ affect the content of a compressed data
780159b3361Sopenharmony_cistream itself, it is a value stored in the header of a sound file.
781159b3361Sopenharmony_ciInformation on the purpose of ReplayGain and the algorithms used is
782159b3361Sopenharmony_ciavailable from http://www.replaygain.org/
783159b3361Sopenharmony_ci
784159b3361Sopenharmony_ciBy default, LAME performs ReplayGain analysis on the input data (after
785159b3361Sopenharmony_cithe user-specified volume scaling). This behaviour might give slightly
786159b3361Sopenharmony_ciinaccurate results because the data on the output of a lossy
787159b3361Sopenharmony_cicompression/decompression sequence differs from the initial input data.
788159b3361Sopenharmony_ciWhen --replaygain-accurate is specified the mp3 stream gets decoded on
789159b3361Sopenharmony_cithe fly and the analysis is performed on the decoded data stream.
790159b3361Sopenharmony_ciAlthough theoretically this method gives more accurate results, it has
791159b3361Sopenharmony_ciseveral disadvantages:
792159b3361Sopenharmony_ci  * tests have shown that the difference between the ReplayGain values
793159b3361Sopenharmony_ci    computed on the input data and decoded data is usually no greater
794159b3361Sopenharmony_ci    than 0.5dB, although the minimum volume difference the human ear
795159b3361Sopenharmony_ci    can perceive is about 1.0dB
796159b3361Sopenharmony_ci  * decoding on the fly significantly slows down the encoding process
797159b3361Sopenharmony_ciThe apparent advantage is that:
798159b3361Sopenharmony_ci  * with --replaygain-accurate the peak sample is determined and
799159b3361Sopenharmony_ci    stored in the file. The knowledge of the peak sample can be useful
800159b3361Sopenharmony_ci    to decoders (players) to prevent a negative effect called 'clipping'
801159b3361Sopenharmony_ci    that introduces distortion into sound.
802159b3361Sopenharmony_ci
803159b3361Sopenharmony_ci
804159b3361Sopenharmony_ciOnly the "Radio" ReplayGain value is computed. It is stored in the LAME tag.
805159b3361Sopenharmony_ciThe analysis is performed with the reference volume equal to 89dB.
806159b3361Sopenharmony_ciNote: the reference volume has been changed from 83dB on transition from 
807159b3361Sopenharmony_civersion 3.95 to 3.95.1.
808159b3361Sopenharmony_ci
809159b3361Sopenharmony_ciThis option is not usable if the MP3 decoder was _explicitly_ disabled
810159b3361Sopenharmony_ciin the build of LAME. (Note: if LAME is compiled without the MP3 decoder,
811159b3361Sopenharmony_ciReplayGain analysis is performed on the input data after user-specified
812159b3361Sopenharmony_civolume scaling).
813159b3361Sopenharmony_ci
814159b3361Sopenharmony_ciSee also: --replaygain-fast, --noreplaygain, --clipdetect
815159b3361Sopenharmony_ci
816159b3361Sopenharmony_ci
817159b3361Sopenharmony_ci=======================================================================
818159b3361Sopenharmony_ciFast ReplayGain analysis
819159b3361Sopenharmony_ci=======================================================================
820159b3361Sopenharmony_ci--replaygain-fast
821159b3361Sopenharmony_ci
822159b3361Sopenharmony_ciCompute "Radio" ReplayGain of the input data stream after user-specified
823159b3361Sopenharmony_civolume scaling and/or resampling.
824159b3361Sopenharmony_ci
825159b3361Sopenharmony_ciReplayGain analysis does _not_ affect the content of a compressed data
826159b3361Sopenharmony_cistream itself, it is a value stored in the header of a sound file.
827159b3361Sopenharmony_ciInformation on the purpose of ReplayGain and the algorithms used is
828159b3361Sopenharmony_ciavailable from http://www.replaygain.org/
829159b3361Sopenharmony_ci
830159b3361Sopenharmony_ciOnly the "Radio" ReplayGain value is computed. It is stored in the LAME tag.
831159b3361Sopenharmony_ciThe analysis is performed with the reference volume equal to 89dB.
832159b3361Sopenharmony_ciNote: the reference volume has been changed from 83dB on transition
833159b3361Sopenharmony_cifrom version 3.95 to 3.95.1.
834159b3361Sopenharmony_ci
835159b3361Sopenharmony_ciThis switch is enabled by default.
836159b3361Sopenharmony_ci
837159b3361Sopenharmony_ciSee also: --replaygain-accurate, --noreplaygain
838159b3361Sopenharmony_ci
839159b3361Sopenharmony_ci
840159b3361Sopenharmony_ci=======================================================================
841159b3361Sopenharmony_ciOutput sampling frequency in kHz
842159b3361Sopenharmony_ci=======================================================================
843159b3361Sopenharmony_ci--resample  n
844159b3361Sopenharmony_ci
845159b3361Sopenharmony_ciwhere n = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48. The values as Hz
846159b3361Sopenharmony_ciinstead of Khz are also supported. Else, the value will be ignored.
847159b3361Sopenharmony_ci
848159b3361Sopenharmony_ciOutput sampling frequency.  Resample the input if necessary.
849159b3361Sopenharmony_ci
850159b3361Sopenharmony_ciIf not specified, LAME may sometimes resample automatically
851159b3361Sopenharmony_ciwhen faced with extreme compression conditions (like encoding
852159b3361Sopenharmony_cia 44.1 kHz input file at 32 kbps).  To disable this automatic
853159b3361Sopenharmony_ciresampling, you have to use --resamle to set the output samplerate
854159b3361Sopenharmony_ciequal to the input samplerate.  In that case, LAME will not
855159b3361Sopenharmony_ciperform any extra computations.
856159b3361Sopenharmony_ci
857159b3361Sopenharmony_ci
858159b3361Sopenharmony_ci=======================================================================
859159b3361Sopenharmony_ciSampling frequency in kHz (for input RAW PCM)
860159b3361Sopenharmony_ci=======================================================================
861159b3361Sopenharmony_ci-s  n
862159b3361Sopenharmony_ci
863159b3361Sopenharmony_ciwhere n = sampling rate in kHz.
864159b3361Sopenharmony_ci
865159b3361Sopenharmony_ciRequired for raw PCM input files.  Otherwise it will be determined
866159b3361Sopenharmony_cifrom the header information in the input file.
867159b3361Sopenharmony_ci
868159b3361Sopenharmony_ciLAME will automatically resample the input file to one of the
869159b3361Sopenharmony_cisupported MP3 samplerates if necessary.
870159b3361Sopenharmony_ci
871159b3361Sopenharmony_ci
872159b3361Sopenharmony_ci=======================================================================
873159b3361Sopenharmony_ciSilent operation
874159b3361Sopenharmony_ci=======================================================================
875159b3361Sopenharmony_ci-S
876159b3361Sopenharmony_ci
877159b3361Sopenharmony_cidon't print progress report
878159b3361Sopenharmony_ci
879159b3361Sopenharmony_ci
880159b3361Sopenharmony_ci=======================================================================
881159b3361Sopenharmony_ciScale
882159b3361Sopenharmony_ci=======================================================================
883159b3361Sopenharmony_ci--scale <arg>
884159b3361Sopenharmony_ci
885159b3361Sopenharmony_ciScales input by <arg>.  This just multiplies the PCM data
886159b3361Sopenharmony_ci(after it has been converted to floating point) by <arg>.
887159b3361Sopenharmony_ci
888159b3361Sopenharmony_ci<arg> > 1:  increase volume
889159b3361Sopenharmony_ci<arg> = 1:  no effect
890159b3361Sopenharmony_ci<arg> < 1:  reduce volume
891159b3361Sopenharmony_ci
892159b3361Sopenharmony_ciUse with care, since most MP3 decoders will truncate data
893159b3361Sopenharmony_ciwhich decodes to values greater than 32768.
894159b3361Sopenharmony_ci
895159b3361Sopenharmony_ci
896159b3361Sopenharmony_ci=======================================================================
897159b3361Sopenharmony_ciStrict ISO complience
898159b3361Sopenharmony_ci=======================================================================
899159b3361Sopenharmony_ci--strictly-enforce-ISO
900159b3361Sopenharmony_ci
901159b3361Sopenharmony_ciWith this option, LAME will enforce the 7680 bit limitation on
902159b3361Sopenharmony_citotal frame size.  This results in many wasted bits for
903159b3361Sopenharmony_cihigh bitrate encodings.
904159b3361Sopenharmony_ci
905159b3361Sopenharmony_ci
906159b3361Sopenharmony_ci=======================================================================
907159b3361Sopenharmony_ciDisable VBR tag/WAV header
908159b3361Sopenharmony_ci=======================================================================
909159b3361Sopenharmony_ci-t
910159b3361Sopenharmony_ciThis setting has two different uses:
911159b3361Sopenharmony_ci
912159b3361Sopenharmony_ciWhen encoding to VBR, this setting disables writing the VBR Tag (also
913159b3361Sopenharmony_ciknown as XING tag). This tag is embedded by default in the frame 0 of
914159b3361Sopenharmony_ciMP3 file. It allows VBR aware players to accurately seek and compute playing
915159b3361Sopenharmony_citimes in such files.
916159b3361Sopenharmony_ci
917159b3361Sopenharmony_ciWhen decoding MP3 to WAV using --decode, this flag will disable writing the
918159b3361Sopenharmony_ciWAV header. The output will be raw pcm, native endian format. Use -x to swap
919159b3361Sopenharmony_cibytes.
920159b3361Sopenharmony_ci
921159b3361Sopenharmony_ci
922159b3361Sopenharmony_ci=======================================================================
923159b3361Sopenharmony_ciVBR quality setting
924159b3361Sopenharmony_ci=======================================================================
925159b3361Sopenharmony_ci -V n Enable VBR encoding
926159b3361Sopenharmony_ci
927159b3361Sopenharmony_ciEncodes using the VBR algorithm, at the indicated quality.
928159b3361Sopenharmony_ci0=highest quality, bigger files. 9.999=lowest quality, smaller files.
929159b3361Sopenharmony_ciDecimal values can be specified, like: 4.51
930159b3361Sopenharmony_ci
931159b3361Sopenharmony_ciOn average, the resulting bitrates are as follows:
932159b3361Sopenharmony_ciSetting       Average bitrate (kbps)
933159b3361Sopenharmony_ci    0             245
934159b3361Sopenharmony_ci    2             190
935159b3361Sopenharmony_ci    3             175
936159b3361Sopenharmony_ci    4             165
937159b3361Sopenharmony_ci    5             130
938159b3361Sopenharmony_ci
939159b3361Sopenharmony_ciUsing -V 7 or higher (lower quality) is not recommended.
940159b3361Sopenharmony_ciABR usually produces better results.
941159b3361Sopenharmony_ci
942159b3361Sopenharmony_ci
943159b3361Sopenharmony_ci=======================================================================
944159b3361Sopenharmony_ciSwap bytes
945159b3361Sopenharmony_ci=======================================================================
946159b3361Sopenharmony_ci-x
947159b3361Sopenharmony_ci
948159b3361Sopenharmony_ciswap bytes in the input file (and output file when using --decode).
949159b3361Sopenharmony_ciFor sorting out little endian/big endian type problems.  If your encodings 
950159b3361Sopenharmony_cisound like static, try this first.
951159b3361Sopenharmony_ci
952159b3361Sopenharmony_ci
953159b3361Sopenharmony_ci=======================================================================
954159b3361Sopenharmony_ciIgnore scalefactor band 21
955159b3361Sopenharmony_ci=======================================================================
956159b3361Sopenharmony_ci-Y Ignore noise in sbf21, like CBR mode does
957159b3361Sopenharmony_ci
958159b3361Sopenharmony_ciAllows -V2, -V1 and -V0 to not encode the highest frequencies accurately,
959159b3361Sopenharmony_ciif doing so causes disproportional increases in bitrate.
960159b3361Sopenharmony_ciThis is the same that CBR and ABR modes do.
961159b3361Sopenharmony_ci
962159b3361Sopenharmony_ciDue to the design of the MP3 format, to keep precision in the last scalefactor
963159b3361Sopenharmony_ciband, an encoder needs to increase the precision in all the bands (not only in
964159b3361Sopenharmony_cithis one).
965159b3361Sopenharmony_ciThe consequence is an increase of bitrate (+60kbps in some cases) compared to
966159b3361Sopenharmony_cinot keeping that precision. Generally, this band should allow for distortions,
967159b3361Sopenharmony_ciso using this switch shouldn't cause harm.
968159b3361Sopenharmony_ci
969