| 1 |
.TH lame 1 "December 08, 2013" "LAME 3.99" "LAME audio compressor" |
| 2 |
.SH NAME |
| 3 |
lame \- create mp3 audio files |
| 4 |
.SH SYNOPSIS |
| 5 |
lame [options] <infile> <outfile> |
| 6 |
.SH DESCRIPTION |
| 7 |
.PP |
| 8 |
LAME is a program which can be used to create compressed audio files. |
| 9 |
(Lame ain't an MP3 encoder). |
| 10 |
These audio files can be played back by popular MP3 players such as |
| 11 |
mpg123 or madplay. |
| 12 |
To read from stdin, use "\-" for <infile>. |
| 13 |
To write to stdout, use "\-" for <outfile>. |
| 14 |
.SH OPTIONS |
| 15 |
Input options: |
| 16 |
.TP |
| 17 |
.B \-r |
| 18 |
Assume the input file is raw pcm. |
| 19 |
Sampling rate and mono/stereo/jstereo must be specified on the command line. |
| 20 |
For each stereo sample, LAME expects the input data to be ordered left channel |
| 21 |
first, then right channel. By default, LAME expects them to be signed integers |
| 22 |
with a bitwidth of 16 and stored in little-endian. |
| 23 |
Without |
| 24 |
.B \-r, |
| 25 |
LAME will perform several |
| 26 |
.I fseek()'s |
| 27 |
on the input file looking for WAV and AIFF headers. |
| 28 |
.br |
| 29 |
Might not be available on your release. |
| 30 |
.TP |
| 31 |
.B \-x |
| 32 |
Swap bytes in the input file (or output file when using |
| 33 |
.B \-\-decode). |
| 34 |
.br |
| 35 |
For sorting out little endian/big endian type problems. |
| 36 |
If your encodings sounds like static, |
| 37 |
try this first. |
| 38 |
.br |
| 39 |
Without using |
| 40 |
.B \-x, |
| 41 |
LAME will treat input file as native endian. |
| 42 |
.TP |
| 43 |
.BI \-s " sfreq" |
| 44 |
.I sfreq |
| 45 |
= 8/11.025/12/16/22.05/24/32/44.1/48 |
| 46 |
|
| 47 |
Required only for raw PCM input files. |
| 48 |
Otherwise it will be determined from the header of the input file. |
| 49 |
|
| 50 |
LAME will automatically resample the input file to one of the supported |
| 51 |
MP3 samplerates if necessary. |
| 52 |
.TP |
| 53 |
.BI \-\-bitwidth " n" |
| 54 |
Input bit width per sample. |
| 55 |
.br |
| 56 |
.I n |
| 57 |
= 8, 16, 24, 32 (default 16) |
| 58 |
|
| 59 |
Required only for raw PCM input files. |
| 60 |
Otherwise it will be determined from the header of the input file. |
| 61 |
.TP |
| 62 |
.BI \-\-signed |
| 63 |
Instructs LAME that the samples from the input are signed (the default |
| 64 |
for 16, 24 and 32 bits raw pcm data). |
| 65 |
|
| 66 |
Required only for raw PCM input files. |
| 67 |
.TP |
| 68 |
.BI \-\-unsigned |
| 69 |
Instructs LAME that the samples from the input are unsigned (the default |
| 70 |
for 8 bits raw pcm data, where 0x80 is zero). |
| 71 |
|
| 72 |
Required only for raw PCM input files |
| 73 |
and only available at bitwidth 8. |
| 74 |
.TP |
| 75 |
.BI \-\-little-endian |
| 76 |
Instructs LAME that the samples from the input are in little-endian form. |
| 77 |
|
| 78 |
Required only for raw PCM input files. |
| 79 |
.TP |
| 80 |
.BI \-\-big-endian |
| 81 |
Instructs LAME that the samples from the input are in big-endian form. |
| 82 |
|
| 83 |
Required only for raw PCM input files. |
| 84 |
.TP |
| 85 |
.B \-\-mp1input |
| 86 |
Assume the input file is a MPEG Layer I (ie MP1) file. |
| 87 |
.br |
| 88 |
If the filename ends in ".mp1" LAME will assume it is a MPEG Layer I file. |
| 89 |
For stdin or Layer I files which do not end in .mp1 you need to use |
| 90 |
this switch. |
| 91 |
.TP |
| 92 |
.B \-\-mp2input |
| 93 |
Assume the input file is a MPEG Layer II (ie MP2) file. |
| 94 |
.br |
| 95 |
If the filename ends in ".mp2" LAME will assume it is a MPEG Layer II file. |
| 96 |
For stdin or Layer II files which do not end in .mp2 you need to use |
| 97 |
this switch. |
| 98 |
.TP |
| 99 |
.B \-\-mp3input |
| 100 |
Assume the input file is a MP3 file. |
| 101 |
.br |
| 102 |
Useful for downsampling from one mp3 to another. |
| 103 |
As an example, |
| 104 |
it can be useful for streaming through an IceCast server. |
| 105 |
.br |
| 106 |
If the filename ends in ".mp3" LAME will assume it is an MP3. |
| 107 |
For stdin or MP3 files which do not end in .mp3 you need to use this switch. |
| 108 |
.TP |
| 109 |
.BI \-\-nogap " file1 file2 ..." |
| 110 |
gapless encoding for a set of contiguous files |
| 111 |
.TP |
| 112 |
.BI \-\-nogapout " dir" |
| 113 |
output dir for gapless encoding (must precede \-\-nogap) |
| 114 |
.TP |
| 115 |
.BI \-\-out-dir " dir" |
| 116 |
If no explicit output file is specified, a file will be written at given path. |
| 117 |
Ignored when using piped/streamed input |
| 118 |
|
| 119 |
.PP |
| 120 |
Operational options: |
| 121 |
.TP |
| 122 |
.BI \-m " mode" |
| 123 |
.I mode |
| 124 |
= s, j, f, d, m, l, r |
| 125 |
|
| 126 |
Joint-stereo is the default mode for stereo files. |
| 127 |
|
| 128 |
.B (s)imple stereo (Forced LR) |
| 129 |
.br |
| 130 |
In this mode, |
| 131 |
the encoder makes no use of potentially existing correlations between |
| 132 |
the two input channels. |
| 133 |
It can, |
| 134 |
however, |
| 135 |
negotiate the bit demand between both channel, |
| 136 |
i.e. give one channel more bits if the other contains silence or needs |
| 137 |
less bits because of a lower complexity. |
| 138 |
|
| 139 |
.B (j)oint stereo |
| 140 |
.br |
| 141 |
In this mode, |
| 142 |
the encoder can use (on a frame by frame basis) either L/R stereo or mid/side stereo. |
| 143 |
In mid/side stereo, |
| 144 |
the mid (L+R) and side (L-R) channels are encoded, |
| 145 |
and more bits are allocated to the mid channel than the side channel. |
| 146 |
When there isn't too much stereo separation, this effectively increases the bandwidth, |
| 147 |
so having higher quality with the same amount of bits. |
| 148 |
|
| 149 |
Using mid/side stereo inappropriately can result in audible compression artifacts. |
| 150 |
Too much switching between mid/side and regular stereo can also sound bad. |
| 151 |
To determine when to switch to mid/side stereo, |
| 152 |
LAME uses a much more sophisticated algorithm than the one described in the ISO documentation. |
| 153 |
|
| 154 |
.B (f)orced MS stereo |
| 155 |
.br |
| 156 |
Forces all frames to be encoded with mid/side stereo. It should be used only if you are sure that every frame of the input file has very little stereo separation. |
| 157 |
|
| 158 |
.B (d)ual channel |
| 159 |
.br |
| 160 |
In this mode, |
| 161 |
the 2 channels will be totally independently encoded. |
| 162 |
Each channel will have exactly half of the bitrate. |
| 163 |
This mode is designed for applications like dual languages |
| 164 |
encoding (for example: English in one channel and French in the other). |
| 165 |
Using this encoding mode for regular stereo files will result in a |
| 166 |
lower quality encoding. |
| 167 |
|
| 168 |
.B (m)ono |
| 169 |
.br |
| 170 |
The input will be encoded as a mono signal. |
| 171 |
If it was a stereo signal, |
| 172 |
it will be downsampled to mono. |
| 173 |
The downmix is calculated as the sum of the left and right channel, |
| 174 |
attenuated by 6 dB. |
| 175 |
Also note that, if using a stereo RAW PCM stream, you need to use the -a parameter. |
| 176 |
|
| 177 |
.B (l)eft channel only |
| 178 |
.br |
| 179 |
The input will be encoded as a mono signal. |
| 180 |
If it was a stereo signal, |
| 181 |
the left channel will be encoded only. |
| 182 |
|
| 183 |
.B (r)ight channel only |
| 184 |
.br |
| 185 |
The input will be encoded as a mono signal. |
| 186 |
If it was a stereo signal, |
| 187 |
the right channel will be encoded only. |
| 188 |
|
| 189 |
.TP |
| 190 |
.B \-a |
| 191 |
Mix the stereo input file to mono and encode as mono. |
| 192 |
.br |
| 193 |
The downmix is calculated as the sum of the left and right channel, |
| 194 |
attenuated by 6 dB. |
| 195 |
|
| 196 |
This option is only needed in the case of raw PCM stereo input |
| 197 |
(because LAME cannot determine the number of channels in the input file). |
| 198 |
To encode a stereo RAW PCM input file as mono, |
| 199 |
use |
| 200 |
.B lame \-a \-m m |
| 201 |
|
| 202 |
For WAV and AIFF input files, |
| 203 |
using |
| 204 |
.B \-m m |
| 205 |
will always produce a mono .mp3 file from both mono and stereo input. |
| 206 |
.TP |
| 207 |
.B \-\-freeformat |
| 208 |
Produces a free format bitstream. |
| 209 |
With this option, |
| 210 |
you can use |
| 211 |
.B \-b |
| 212 |
with any bitrate higher than 8 kbps. |
| 213 |
|
| 214 |
However, |
| 215 |
even if an mp3 decoder is required to support free bitrates at |
| 216 |
least up to 320 kbps, |
| 217 |
many players are unable to deal with it. |
| 218 |
|
| 219 |
Tests have shown that the following decoders support free format: |
| 220 |
.br |
| 221 |
.B in_mpg123 |
| 222 |
up to 560 kbps |
| 223 |
.br |
| 224 |
.B l3dec |
| 225 |
up to 310 kbps |
| 226 |
.br |
| 227 |
.B LAME |
| 228 |
up to 640 kbps |
| 229 |
.br |
| 230 |
.B MAD |
| 231 |
up to 640 kbps |
| 232 |
.TP |
| 233 |
.B \-\-decode |
| 234 |
Uses LAME for decoding to a wav file. |
| 235 |
The input file can be any input type supported by encoding, |
| 236 |
including layer II files. |
| 237 |
LAME uses a fork of mpglib known as HIP for decoding. |
| 238 |
|
| 239 |
If |
| 240 |
.B \-t |
| 241 |
is used (disable wav header), |
| 242 |
LAME will output raw pcm in native endian format. |
| 243 |
You can use |
| 244 |
.B \-x |
| 245 |
to swap bytes order. |
| 246 |
|
| 247 |
This option is not usable if the MP3 decoder was |
| 248 |
.B explicitly |
| 249 |
disabled in the build of LAME. |
| 250 |
.TP |
| 251 |
.BI \-t |
| 252 |
Disable writing of the INFO Tag on encoding. |
| 253 |
.br |
| 254 |
This tag is embedded in frame 0 of the MP3 file. |
| 255 |
It includes some information about the encoding options of the file, |
| 256 |
and in VBR it lets VBR aware players correctly seek and compute |
| 257 |
playing times of VBR files. |
| 258 |
|
| 259 |
When |
| 260 |
.B \-\-decode |
| 261 |
is specified (decode to WAV), |
| 262 |
this flag will disable writing of the WAV header. |
| 263 |
The output will be raw pcm, |
| 264 |
native endian format. |
| 265 |
Use |
| 266 |
.B \-x |
| 267 |
to swap bytes. |
| 268 |
.TP |
| 269 |
.BI \-\-comp " arg" |
| 270 |
Instead of choosing bitrate, |
| 271 |
using this option, |
| 272 |
user can choose compression ratio to achieve. |
| 273 |
.TP |
| 274 |
.BI \-\-scale " n" |
| 275 |
.PD 0 |
| 276 |
.TP |
| 277 |
.BI \-\-scale\-l " n" |
| 278 |
.TP |
| 279 |
.BI \-\-scale\-r " n" |
| 280 |
Scales input (every channel, only left channel or only right channel) by |
| 281 |
.I n. |
| 282 |
This just multiplies the PCM data (after it has been converted to floating |
| 283 |
point) by |
| 284 |
.I n. |
| 285 |
|
| 286 |
.I n |
| 287 |
> 1: increase volume |
| 288 |
.br |
| 289 |
.I n |
| 290 |
= 1: no effect |
| 291 |
.br |
| 292 |
.I n |
| 293 |
< 1: reduce volume |
| 294 |
|
| 295 |
Use with care, |
| 296 |
since most MP3 decoders will truncate data which decodes to values |
| 297 |
greater than 32768. |
| 298 |
.PD |
| 299 |
.TP |
| 300 |
.B \-\-replaygain\-fast |
| 301 |
Compute ReplayGain fast but slightly inaccurately. |
| 302 |
|
| 303 |
This computes "Radio" ReplayGain on the input data stream after |
| 304 |
user\(hyspecified volume\(hyscaling and/or resampling. |
| 305 |
|
| 306 |
The ReplayGain analysis does |
| 307 |
.I not |
| 308 |
affect the content of a compressed data stream itself, |
| 309 |
it is a value stored in the header of a sound file. |
| 310 |
Information on the purpose of ReplayGain and the algorithms used is |
| 311 |
available from |
| 312 |
.B http://www.replaygain.org/. |
| 313 |
|
| 314 |
Only the "RadioGain" Replaygain value is computed, |
| 315 |
it is stored in the LAME tag. |
| 316 |
The analysis is performed with the reference |
| 317 |
volume equal to 89dB. |
| 318 |
Note: the reference volume has been changed from 83dB on transition from |
| 319 |
version 3.95 to 3.95.1. |
| 320 |
|
| 321 |
This switch is enabled by default. |
| 322 |
|
| 323 |
See also: |
| 324 |
.B \-\-replaygain\-accurate, \-\-noreplaygain |
| 325 |
.TP |
| 326 |
.B \-\-replaygain\-accurate |
| 327 |
Compute ReplayGain more accurately and find the peak sample. |
| 328 |
|
| 329 |
This computes "Radio" ReplayGain on the decoded data stream, |
| 330 |
finds the peak sample by decoding on the fly the encoded data stream and stores it in the file. |
| 331 |
|
| 332 |
The ReplayGain analysis does |
| 333 |
.I not |
| 334 |
affect the content of a compressed data stream itself, |
| 335 |
it is a value stored in the header of a sound file. |
| 336 |
Information on the purpose of ReplayGain and the algorithms used is |
| 337 |
available from |
| 338 |
.B http://www.replaygain.org/. |
| 339 |
|
| 340 |
|
| 341 |
By default, LAME performs ReplayGain analysis on the input data |
| 342 |
(after the user\(hyspecified volume scaling). |
| 343 |
This behavior might give slightly inaccurate results |
| 344 |
because the data on the output of a lossy compression/decompression sequence |
| 345 |
differs from the initial input data. |
| 346 |
When |
| 347 |
.B \-\-replaygain-accurate |
| 348 |
is specified the mp3 stream gets decoded on the fly and the analysis is |
| 349 |
performed on the decoded data stream. |
| 350 |
Although theoretically this method gives more accurate results, |
| 351 |
it has several disadvantages: |
| 352 |
.RS 8 |
| 353 |
.IP "*" 4 |
| 354 |
tests have shown that the difference between the ReplayGain values computed |
| 355 |
on the input data and decoded data is usually not greater than 0.5dB, |
| 356 |
although the minimum volume difference the human ear can perceive is |
| 357 |
about 1.0dB |
| 358 |
.IP "*" 4 |
| 359 |
decoding on the fly significantly slows down the encoding process |
| 360 |
.RE |
| 361 |
.RS 7 |
| 362 |
|
| 363 |
The apparent advantage is that: |
| 364 |
.RE |
| 365 |
.RS 8 |
| 366 |
.IP "*" 4 |
| 367 |
with |
| 368 |
.B \-\-replaygain-accurate |
| 369 |
the real peak sample is determined and stored in the file. |
| 370 |
The knowledge of the peak sample can be useful to decoders (players) |
| 371 |
to prevent a negative effect called 'clipping' that introduces distortion |
| 372 |
into the sound. |
| 373 |
.RE |
| 374 |
.RS 7 |
| 375 |
|
| 376 |
Only the "RadioGain" ReplayGain value is computed, |
| 377 |
it is stored in the LAME tag. |
| 378 |
The analysis is performed with the reference |
| 379 |
volume equal to 89dB. |
| 380 |
Note: the reference volume has been changed from 83dB on transition from |
| 381 |
version 3.95 to 3.95.1. |
| 382 |
|
| 383 |
This option is not usable if the MP3 decoder was |
| 384 |
.B explicitly |
| 385 |
disabled in the build of LAME. |
| 386 |
(Note: if LAME is compiled without the MP3 decoder, |
| 387 |
ReplayGain analysis is performed on the input data after user-specified |
| 388 |
volume scaling). |
| 389 |
|
| 390 |
See also: |
| 391 |
.B \-\-replaygain-fast, \-\-noreplaygain \-\-clipdetect |
| 392 |
.RE |
| 393 |
.TP |
| 394 |
.B \-\-noreplaygain |
| 395 |
Disable ReplayGain analysis. |
| 396 |
|
| 397 |
By default ReplayGain analysis is enabled. This switch disables it. |
| 398 |
|
| 399 |
See also: |
| 400 |
.B \-\-replaygain-fast, \-\-replaygain-accurate |
| 401 |
.TP |
| 402 |
.B \-\-clipdetect |
| 403 |
Clipping detection. |
| 404 |
|
| 405 |
Enable |
| 406 |
.B \-\-replaygain-accurate |
| 407 |
and print a message whether clipping occurs and how far in dB the waveform |
| 408 |
is from full scale. |
| 409 |
|
| 410 |
This option is not usable if the MP3 decoder was |
| 411 |
.B explicitly |
| 412 |
disabled in the build of LAME. |
| 413 |
|
| 414 |
See also: |
| 415 |
.B \-\-replaygain-accurate |
| 416 |
.TP |
| 417 |
.B \-\-preset " type | [cbr] kbps" |
| 418 |
Use one of the built-in presets. |
| 419 |
|
| 420 |
Have a look at the PRESETS section below. |
| 421 |
|
| 422 |
.B \-\-preset help |
| 423 |
gives more infos about the the used options in these presets. |
| 424 |
.TP |
| 425 |
.B \-\-noasm " type" |
| 426 |
Disable specific assembly optimizations ( |
| 427 |
.B mmx |
| 428 |
/ |
| 429 |
.B 3dnow |
| 430 |
/ |
| 431 |
.B sse |
| 432 |
). |
| 433 |
Quality will not increase, only speed will be reduced. |
| 434 |
If you have problems running Lame on a Cyrix/Via processor, |
| 435 |
disabling mmx optimizations might solve your problem. |
| 436 |
|
| 437 |
.PP |
| 438 |
Verbosity: |
| 439 |
.TP |
| 440 |
.BI \-\-disptime " n" |
| 441 |
Set the delay in seconds between two display updates. |
| 442 |
.TP |
| 443 |
.B \-\-nohist |
| 444 |
By default, |
| 445 |
LAME will display a bitrate histogram while producing VBR mp3 files. |
| 446 |
This will disable that feature. |
| 447 |
.br |
| 448 |
Histogram display might not be available on your release. |
| 449 |
.TP |
| 450 |
.B -S |
| 451 |
.PD 0 |
| 452 |
.TP |
| 453 |
.B \-\-silent |
| 454 |
.TP |
| 455 |
.B \-\-quiet |
| 456 |
Do not print anything on the screen. |
| 457 |
.PD |
| 458 |
.TP |
| 459 |
.B \-\-verbose |
| 460 |
Print a lot of information on the screen. |
| 461 |
.TP |
| 462 |
.B \-\-help |
| 463 |
Display a list of available options. |
| 464 |
|
| 465 |
.PP |
| 466 |
Noise shaping & psycho acoustic algorithms: |
| 467 |
.TP |
| 468 |
.BI -q " qual" |
| 469 |
0 <= |
| 470 |
.I qual |
| 471 |
<= 9 |
| 472 |
|
| 473 |
Bitrate is of course the main influence on quality. |
| 474 |
The higher the bitrate, |
| 475 |
the higher the quality. |
| 476 |
But for a given bitrate, |
| 477 |
we have a choice of algorithms to determine the best scalefactors |
| 478 |
and Huffman encoding (noise shaping). |
| 479 |
|
| 480 |
For CBR and ABR, the following table applies: |
| 481 |
|
| 482 |
.B -q 0: |
| 483 |
.br |
| 484 |
Use the best algorithms (Best Huffman coding search, full outer loop, and the highest precision of several parameters). |
| 485 |
|
| 486 |
.B -q 1 to q 4: |
| 487 |
.br |
| 488 |
Similar to -q 0 without the full outer loop and decreasing precision of parameters the further from q0. -q 3 is the default. |
| 489 |
|
| 490 |
.B -q 5 and -q 6: |
| 491 |
.br |
| 492 |
Same as -q 7, but enables noise shaping and increases subblock gain |
| 493 |
|
| 494 |
.B -q 7 to -q 9: |
| 495 |
.br |
| 496 |
Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but no noise-shaping is done. |
| 497 |
|
| 498 |
For the default VBR mode since LAME 3.98, the following table applies : |
| 499 |
|
| 500 |
.B -q 0 to -q 4: |
| 501 |
.br |
| 502 |
include all features of the other modes and additionally use the best search when applying Huffman coding. |
| 503 |
|
| 504 |
.B -q 5 and -q 6: |
| 505 |
.br |
| 506 |
include all features of -q7, calculate and consider actual quantisation noise, and additionally enable subblock gain. |
| 507 |
|
| 508 |
.B -q 7 to -q 9 |
| 509 |
.br |
| 510 |
This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a quick guess. |
| 511 |
|
| 512 |
|
| 513 |
.TP |
| 514 |
.B -h |
| 515 |
Alias of |
| 516 |
.B -q 2 |
| 517 |
.TP |
| 518 |
.B -f |
| 519 |
Alias of |
| 520 |
.B -q 7 |
| 521 |
|
| 522 |
|
| 523 |
.PP |
| 524 |
CBR (constant bitrate, the default) options: |
| 525 |
.TP |
| 526 |
.BI -b " n" |
| 527 |
For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz) |
| 528 |
.br |
| 529 |
.I n |
| 530 |
= 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 |
| 531 |
|
| 532 |
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz) |
| 533 |
.br |
| 534 |
.I n |
| 535 |
= 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 |
| 536 |
|
| 537 |
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz) |
| 538 |
.br |
| 539 |
.I n |
| 540 |
= 8, 16, 24, 32, 40, 48, 56, 64 |
| 541 |
|
| 542 |
Default is 128 for MPEG1 and 64 for MPEG2 and 32 for MPEG2.5 |
| 543 |
(64, 32 and 16 respectively in case of mono). |
| 544 |
.TP |
| 545 |
.BI \-\-cbr |
| 546 |
enforce use of constant bitrate. Used to disable VBR or ABR encoding even if their settings |
| 547 |
are enabled. |
| 548 |
|
| 549 |
.PP |
| 550 |
ABR (average bitrate) options: |
| 551 |
.TP |
| 552 |
.BI \-\-abr " n" |
| 553 |
Turns on encoding with a targeted average bitrate of n kbits, |
| 554 |
allowing to use frames of different sizes. |
| 555 |
The allowed range of |
| 556 |
.I n |
| 557 |
is 8 - 310, |
| 558 |
you can use any integer value within that range. |
| 559 |
|
| 560 |
It can be combined with the |
| 561 |
.B -b |
| 562 |
and |
| 563 |
.B -B |
| 564 |
switches like: |
| 565 |
.B lame \-\-abr |
| 566 |
.I 123 |
| 567 |
.B -b |
| 568 |
.I 64 |
| 569 |
.B -B |
| 570 |
.I 192 a.wav a.mp3 |
| 571 |
which would limit the allowed frame sizes between 64 and 192 kbits. |
| 572 |
|
| 573 |
The use of |
| 574 |
.B -B |
| 575 |
is NOT RECOMMENDED. |
| 576 |
A 128 kbps CBR bitstream, |
| 577 |
because of the bit reservoir, |
| 578 |
can actually have frames which use as many bits as a 320 kbps frame. |
| 579 |
VBR modes minimize the use of the bit reservoir, |
| 580 |
and thus need to allow 320 kbps frames to get the same flexibility |
| 581 |
as CBR streams. |
| 582 |
|
| 583 |
.PP |
| 584 |
VBR (variable bitrate) options: |
| 585 |
.TP |
| 586 |
.B -v |
| 587 |
use variable bitrate |
| 588 |
.B (\-\-vbr-new) |
| 589 |
.TP |
| 590 |
.B \-\-vbr-old |
| 591 |
Invokes the oldest, |
| 592 |
most tested VBR algorithm. |
| 593 |
It produces very good quality files, |
| 594 |
though is not very fast. |
| 595 |
This has, |
| 596 |
up through v3.89, |
| 597 |
been considered the "workhorse" VBR algorithm. |
| 598 |
.TP |
| 599 |
.B \-\-vbr-new |
| 600 |
Invokes the newest VBR algorithm. |
| 601 |
During the development of version 3.90, |
| 602 |
considerable tuning was done on this algorithm, |
| 603 |
and it is now considered to be on par with the original |
| 604 |
.B \-\-vbr-old. |
| 605 |
It has the added advantage of being very fast (over twice as fast as |
| 606 |
.B \-\-vbr-old |
| 607 |
). This is the default since 3.98. |
| 608 |
.TP |
| 609 |
.BI -V " n" |
| 610 |
0 <= |
| 611 |
.I n |
| 612 |
<= 9.999 |
| 613 |
.br |
| 614 |
Enable VBR (Variable BitRate) and specifies the value of VBR quality |
| 615 |
(default = 4). Decimal values can be specified, like 4.51. |
| 616 |
.br |
| 617 |
0 = highest quality. |
| 618 |
|
| 619 |
.PP |
| 620 |
ABR and VBR options: |
| 621 |
.TP |
| 622 |
.BI -b " bitrate" |
| 623 |
For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz) |
| 624 |
.br |
| 625 |
.I n |
| 626 |
= 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 |
| 627 |
|
| 628 |
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz) |
| 629 |
.br |
| 630 |
.I n |
| 631 |
= 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 |
| 632 |
|
| 633 |
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz) |
| 634 |
.br |
| 635 |
.I n |
| 636 |
= 8, 16, 24, 32, 40, 48, 56, 64 |
| 637 |
|
| 638 |
Specifies the minimum bitrate to be used. |
| 639 |
However, |
| 640 |
in order to avoid wasted space, |
| 641 |
the smallest frame size available will be used during silences. |
| 642 |
.TP |
| 643 |
.BI -B " bitrate" |
| 644 |
For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz) |
| 645 |
.br |
| 646 |
.I n |
| 647 |
= 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 |
| 648 |
|
| 649 |
For MPEG-2 (sampling frequencies of 16, 22.05 and 24 kHz) |
| 650 |
.br |
| 651 |
.I n |
| 652 |
= 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 |
| 653 |
|
| 654 |
For MPEG-2.5 (sampling frequencies of 8, 11.025 and 12 kHz) |
| 655 |
.br |
| 656 |
.I n |
| 657 |
= 8, 16, 24, 32, 40, 48, 56, 64 |
| 658 |
|
| 659 |
Specifies the maximum allowed bitrate. |
| 660 |
|
| 661 |
Note: If you own an mp3 hardware player build upon a MAS 3503 chip, |
| 662 |
you must set maximum bitrate to no more than 224 kpbs. |
| 663 |
.TP |
| 664 |
.B -F |
| 665 |
Strictly enforce the |
| 666 |
.B -b |
| 667 |
option. |
| 668 |
.br |
| 669 |
This is mainly for use with hardware players that do not support low |
| 670 |
bitrate mp3. |
| 671 |
|
| 672 |
Without this option, |
| 673 |
the minimum bitrate will be ignored for passages of analog silence, |
| 674 |
i.e. when the music level is below the absolute threshold of |
| 675 |
human hearing (ATH). |
| 676 |
|
| 677 |
.PP |
| 678 |
Experimental options: |
| 679 |
.TP |
| 680 |
.BI -X " n" |
| 681 |
0 <= |
| 682 |
.I n |
| 683 |
<= 7 |
| 684 |
|
| 685 |
When LAME searches for a "good" quantization, |
| 686 |
it has to compare the actual one with the best one found so far. |
| 687 |
The comparison says which one is better, |
| 688 |
the best so far or the actual. |
| 689 |
The |
| 690 |
.B -X |
| 691 |
parameter selects between different approaches to make this decision, |
| 692 |
.B -X0 |
| 693 |
being the default mode: |
| 694 |
|
| 695 |
.B -X0 |
| 696 |
.br |
| 697 |
The criteria are (in order of importance): |
| 698 |
.br |
| 699 |
* less distorted scalefactor bands |
| 700 |
.br |
| 701 |
* the sum of noise over the thresholds is lower |
| 702 |
.br |
| 703 |
* the total noise is lower |
| 704 |
|
| 705 |
.B -X1 |
| 706 |
.br |
| 707 |
The actual is better if the maximum noise over all scalefactor bands is |
| 708 |
less than the best so far. |
| 709 |
|
| 710 |
.B -X2 |
| 711 |
.br |
| 712 |
The actual is better if the total sum of noise is lower than the best so |
| 713 |
far. |
| 714 |
|
| 715 |
.B -X3 |
| 716 |
.br |
| 717 |
The actual is better if the total sum of noise is lower than the best so |
| 718 |
far and the maximum noise over all scalefactor bands is less than the |
| 719 |
best so far plus 2dB. |
| 720 |
|
| 721 |
.B -X4 |
| 722 |
.br |
| 723 |
Not yet documented. |
| 724 |
|
| 725 |
.B -X5 |
| 726 |
.br |
| 727 |
The criteria are (in order of importance): |
| 728 |
.br |
| 729 |
* the sum of noise over the thresholds is lower |
| 730 |
.br |
| 731 |
* the total sum of noise is lower |
| 732 |
|
| 733 |
.B -X6 |
| 734 |
.br |
| 735 |
The criteria are (in order of importance): |
| 736 |
.br |
| 737 |
* the sum of noise over the thresholds is lower |
| 738 |
.br |
| 739 |
* the maximum noise over all scalefactor bands is lower |
| 740 |
.br |
| 741 |
* the total sum of noise is lower |
| 742 |
|
| 743 |
.B -X7 |
| 744 |
.br |
| 745 |
The criteria are: |
| 746 |
.br |
| 747 |
* less distorted scalefactor bands |
| 748 |
.br |
| 749 |
or |
| 750 |
.br |
| 751 |
* the sum of noise over the thresholds is lower |
| 752 |
.TP |
| 753 |
.B -Y |
| 754 |
lets LAME ignore noise in sfb21, like in CBR |
| 755 |
|
| 756 |
.PP |
| 757 |
MP3 header/stream options: |
| 758 |
.TP |
| 759 |
.BI -e " emp" |
| 760 |
.I emp |
| 761 |
= n, 5, c |
| 762 |
|
| 763 |
n = (none, default) |
| 764 |
.br |
| 765 |
5 = 0/15 microseconds |
| 766 |
.br |
| 767 |
c = citt j.17 |
| 768 |
|
| 769 |
All this does is set a flag in the bitstream. |
| 770 |
If you have a PCM input file where one of the above types of |
| 771 |
(obsolete) emphasis has been applied, |
| 772 |
you can set this flag in LAME. |
| 773 |
Then the mp3 decoder should de-emphasize the output during playback, |
| 774 |
although most decoders ignore this flag. |
| 775 |
|
| 776 |
A better solution would be to apply the de-emphasis with a standalone |
| 777 |
utility before encoding, |
| 778 |
and then encode without |
| 779 |
.B -e. |
| 780 |
.TP |
| 781 |
.B -c |
| 782 |
Mark the encoded file as being copyrighted. |
| 783 |
.TP |
| 784 |
.B -o |
| 785 |
Mark the encoded file as being a copy. |
| 786 |
.TP |
| 787 |
.B -p |
| 788 |
Turn on CRC error protection. |
| 789 |
.br |
| 790 |
It will add a cyclic redundancy check (CRC) code in each frame, |
| 791 |
allowing to detect transmission errors that could occur on the |
| 792 |
MP3 stream. |
| 793 |
However, |
| 794 |
it takes 16 bits per frame that would otherwise be used for encoding, |
| 795 |
and then will slightly reduce the sound quality. |
| 796 |
.TP |
| 797 |
.B \-\-nores |
| 798 |
Disable the bit reservoir. |
| 799 |
Each frame will then become independent from previous ones, |
| 800 |
but the quality will be lower. |
| 801 |
.TP |
| 802 |
.B \-\-strictly-enforce-ISO |
| 803 |
With this option, |
| 804 |
LAME will enforce the 7680 bit limitation on total frame size. |
| 805 |
.br |
| 806 |
This results in many wasted bits for high bitrate encodings but will |
| 807 |
ensure strict ISO compatibility. |
| 808 |
This compatibility might be important for hardware players. |
| 809 |
|
| 810 |
.PP |
| 811 |
Filter options: |
| 812 |
.TP |
| 813 |
.BI \-\-lowpass " freq" |
| 814 |
Set a lowpass filtering frequency in kHz. |
| 815 |
Frequencies above the specified one will be cutoff. |
| 816 |
.TP |
| 817 |
.BI \-\-lowpass-width " freq" |
| 818 |
Set the width of the lowpass filter. |
| 819 |
The default value is 15% of the lowpass frequency. |
| 820 |
.TP |
| 821 |
.BI \-\-highpass " freq" |
| 822 |
Set an highpass filtering frequency in kHz. |
| 823 |
Frequencies below the specified one will be cutoff. |
| 824 |
.TP |
| 825 |
.BI \-\-highpass-width " freq" |
| 826 |
Set the width of the highpass filter in kHz. |
| 827 |
The default value is 15% of the highpass frequency. |
| 828 |
.TP |
| 829 |
.BI \-\-resample " sfreq" |
| 830 |
.I sfreq |
| 831 |
= 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48 |
| 832 |
.br |
| 833 |
Select output sampling frequency (only supported for encoding). |
| 834 |
.br |
| 835 |
If not specified, |
| 836 |
LAME will automatically resample the input when using high compression ratios. |
| 837 |
|
| 838 |
.PP |
| 839 |
ID3 tag options: |
| 840 |
.TP |
| 841 |
.BI \-\-tt " title" |
| 842 |
audio/song title (max 30 chars for version 1 tag) |
| 843 |
.TP |
| 844 |
.BI \-\-ta " artist" |
| 845 |
audio/song artist (max 30 chars for version 1 tag) |
| 846 |
.TP |
| 847 |
.BI \-\-tl " album" |
| 848 |
audio/song album (max 30 chars for version 1 tag) |
| 849 |
.TP |
| 850 |
.BI \-\-ty " year" |
| 851 |
audio/song year of issue (1 to 9999) |
| 852 |
.TP |
| 853 |
.BI \-\-tc " comment" |
| 854 |
user-defined text (max 30 chars for v1 tag, 28 for v1.1) |
| 855 |
.TP |
| 856 |
.BI \-\-tn " track[/total]" |
| 857 |
audio/song track number and (optionally) the total number of tracks on |
| 858 |
the original recording. (track and total each 1 to 255. Providing |
| 859 |
just the track number creates v1.1 tag, providing a total forces v2.0). |
| 860 |
.TP |
| 861 |
.BI \-\-tg " genre" |
| 862 |
audio/song genre (name or number in list) |
| 863 |
.TP |
| 864 |
.BI \-\-tv " id=value" |
| 865 |
Text or URL frame specified by id and value (v2.3 tag). User defined frame. Syntax: \-\-tv "TXXX=description=content" |
| 866 |
.TP |
| 867 |
.B \-\-add-id3v2 |
| 868 |
force addition of version 2 tag |
| 869 |
.TP |
| 870 |
.B \-\-id3v1-only |
| 871 |
add only a version 1 tag |
| 872 |
.TP |
| 873 |
.B \-\-id3v2-only |
| 874 |
add only a version 2 tag |
| 875 |
.TP |
| 876 |
.B \-\-id3v2-latin1 |
| 877 |
add following options in ISO-8859-1 text encoding. |
| 878 |
.TP |
| 879 |
.B \-\-id3v2-utf8 |
| 880 |
add following options in unicode UTF-8 text encoding (ID3v2.4). |
| 881 |
.TP |
| 882 |
.B \-\-id3v2-utf16 |
| 883 |
add following options in unicode UCS-2 text encoding (ID3v2.3). |
| 884 |
.TP |
| 885 |
.B \-\-space-id3v1 |
| 886 |
pad version 1 tag with spaces instead of nulls |
| 887 |
.TP |
| 888 |
.B \-\-pad-id3v2 |
| 889 |
same as \-\-pad-id3v2-size 128 |
| 890 |
.TP |
| 891 |
.B \-\-pad-id3v2-size "num" |
| 892 |
adds version 2 tag, pad with extra "num" bytes |
| 893 |
.TP |
| 894 |
.B \-\-genre-list |
| 895 |
print alphabetically sorted ID3 genre list and exit |
| 896 |
.TP |
| 897 |
.B \-\-ignore-tag-errors |
| 898 |
ignore errors in values passed for tags, use defaults in case an error occurs |
| 899 |
|
| 900 |
.PP |
| 901 |
Analysis options: |
| 902 |
.TP |
| 903 |
.B \-g |
| 904 |
run graphical analysis on <infile>. |
| 905 |
<infile> can also be a .mp3 file. |
| 906 |
(This feature is a compile time option. |
| 907 |
Your binary may for speed reasons be compiled without this.) |
| 908 |
|
| 909 |
.SH ID3 TAGS |
| 910 |
LAME is able to embed ID3 v1, |
| 911 |
v1.1 or v2 tags inside the encoded MP3 file. |
| 912 |
This allows one to have some useful information about the music track |
| 913 |
included inside the file. |
| 914 |
Those data can be read by most MP3 players. |
| 915 |
|
| 916 |
Lame will smartly choose which tags to use. |
| 917 |
It will add ID3 v2 tags only if the input comments won't fit in v1 |
| 918 |
or v1.1 tags, |
| 919 |
i.e. if they are more than 30 characters. |
| 920 |
In this case, |
| 921 |
both v1 and v2 tags will be added, |
| 922 |
to ensure reading of tags by MP3 players which are unable to read ID3 v2 tags. |
| 923 |
|
| 924 |
.SH ENCODING MODES |
| 925 |
LAME is able to encode your music using one of its 3 encoding modes: |
| 926 |
constant bitrate (CBR), average bitrate (ABR) and variable bitrate (VBR). |
| 927 |
.TP |
| 928 |
.B Constant Bitrate (CBR) |
| 929 |
This is the default encoding mode, |
| 930 |
and also the most basic. |
| 931 |
In this mode, |
| 932 |
the bitrate will be the same for the whole file. |
| 933 |
It means that each part of your mp3 file will be using the same |
| 934 |
number of bits. |
| 935 |
The musical passage being a difficult one to encode or an easy one, |
| 936 |
the encoder will use the same bitrate, |
| 937 |
so the quality of your mp3 is variable. |
| 938 |
Complex parts will be of a lower quality than the easiest ones. |
| 939 |
The main advantage is that the final files size won't change and |
| 940 |
can be accurately predicted. |
| 941 |
.TP |
| 942 |
.B Average Bitrate (ABR) |
| 943 |
In this mode, |
| 944 |
you choose the encoder will maintain an average bitrate while using |
| 945 |
higher bitrates for the parts of your music that need more bits. |
| 946 |
The result will be of higher quality than CBR encoding but the |
| 947 |
average file size will remain predictable, |
| 948 |
so this mode is highly recommended over CBR. |
| 949 |
This encoding mode is similar to what is referred as vbr in AAC or |
| 950 |
Liquid Audio (2 other compression technologies). |
| 951 |
.TP |
| 952 |
.B Variable bitrate (VBR) |
| 953 |
In this mode, |
| 954 |
you choose the desired quality on a scale from 9 (lowest |
| 955 |
quality/biggest distortion) to 0 (highest quality/lowest distortion). |
| 956 |
Then encoder tries to maintain the given quality in the whole file by |
| 957 |
choosing the optimal number of bits to spend for each part of your music. |
| 958 |
The main advantage is that you are able to specify the quality level that |
| 959 |
you want to reach, |
| 960 |
but the inconvenient is that the final file size is totally unpredictable. |
| 961 |
|
| 962 |
.SH PRESETS |
| 963 |
The |
| 964 |
.B \-\-preset |
| 965 |
switches are aliases over LAME settings. |
| 966 |
|
| 967 |
To activate these presets: |
| 968 |
.PP |
| 969 |
For VBR modes (generally highest quality): |
| 970 |
.TP |
| 971 |
.B \-\-preset medium |
| 972 |
This preset should provide near transparency to most people on most music. |
| 973 |
.TP |
| 974 |
.B \-\-preset standard |
| 975 |
This preset should generally be transparent to most people on most music and |
| 976 |
is already quite high in quality. |
| 977 |
.TP |
| 978 |
.B \-\-preset extreme |
| 979 |
If you have extremely good hearing and similar equipment, |
| 980 |
this preset will generally provide slightly higher quality than the |
| 981 |
.B standard |
| 982 |
mode. |
| 983 |
.PP |
| 984 |
For CBR 320kbps (highest quality possible from the |
| 985 |
.B \-\-preset |
| 986 |
switches): |
| 987 |
.TP |
| 988 |
.B \-\-preset insane |
| 989 |
This preset will usually be overkill for most people and most situations, |
| 990 |
but if you must have the absolute highest quality with no regard to filesize, |
| 991 |
this is the way to go. |
| 992 |
.PP |
| 993 |
For ABR modes (high quality per given bitrate but not as high as VBR): |
| 994 |
.TP |
| 995 |
.B \-\-preset " kbps" |
| 996 |
Using this preset will usually give you good quality at a specified bitrate. |
| 997 |
Depending on the bitrate entered, |
| 998 |
this preset will determine the optimal settings for that particular situation. |
| 999 |
While this approach works, |
| 1000 |
it is not nearly as flexible as VBR, |
| 1001 |
and usually will not attain the same level of quality as VBR at higher bitrates. |
| 1002 |
.TP |
| 1003 |
.B cbr |
| 1004 |
If you use the ABR mode (read above) with a significant bitrate such as 80, |
| 1005 |
96, |
| 1006 |
112, |
| 1007 |
128, |
| 1008 |
160, |
| 1009 |
192, |
| 1010 |
224, |
| 1011 |
256, |
| 1012 |
320, |
| 1013 |
you can use the |
| 1014 |
.B \-\-preset cbr " kbps" |
| 1015 |
option to force CBR mode encoding instead of the standard ABR mode. |
| 1016 |
ABR does provide higher quality but CBR may be useful in situations such as when |
| 1017 |
streaming an MP3 over the Internet may be important. |
| 1018 |
|
| 1019 |
|
| 1020 |
.SH EXAMPLES |
| 1021 |
.LP |
| 1022 |
Fixed bit rate jstereo 128kbs encoding: |
| 1023 |
.IP |
| 1024 |
.B lame \-b |
| 1025 |
.I 128 sample.wav sample.mp3 |
| 1026 |
|
| 1027 |
.LP |
| 1028 |
Fixed bit rate jstereo 128 kbps encoding, highest quality: |
| 1029 |
.IP |
| 1030 |
.B lame \-q 0 \-b |
| 1031 |
.I 128 sample.wav sample.mp3 |
| 1032 |
|
| 1033 |
.LP |
| 1034 |
To disable joint stereo encoding (slightly faster, |
| 1035 |
but less quality at bitrates <= 128 kbps): |
| 1036 |
.IP |
| 1037 |
.B lame \-m |
| 1038 |
.I s sample.wav sample.mp3 |
| 1039 |
|
| 1040 |
.LP |
| 1041 |
Variable bitrate (use \-V n to adjust quality/filesize): |
| 1042 |
.IP |
| 1043 |
.B lame \-V |
| 1044 |
.I 2 sample.wav sample.mp3 |
| 1045 |
|
| 1046 |
.LP |
| 1047 |
Streaming mono 22.05 kHz raw pcm, 24 kbps output: |
| 1048 |
.IP |
| 1049 |
.B cat |
| 1050 |
.I inputfile |
| 1051 |
.B | lame \-r \-m |
| 1052 |
.I m |
| 1053 |
.B \-b |
| 1054 |
.I 24 |
| 1055 |
.B \-s |
| 1056 |
.I 22.05 \- \- |
| 1057 |
.B > |
| 1058 |
.I output |
| 1059 |
|
| 1060 |
.LP |
| 1061 |
Streaming mono 44.1 kHz raw pcm, |
| 1062 |
with downsampling to 22.05 kHz: |
| 1063 |
.IP |
| 1064 |
.B cat |
| 1065 |
.I inputfile |
| 1066 |
.B | lame \-r \-m |
| 1067 |
.I m |
| 1068 |
.B \-b |
| 1069 |
.I 24 |
| 1070 |
.B \-\-resample |
| 1071 |
.I 22.05 \- \- |
| 1072 |
.B > |
| 1073 |
.I output |
| 1074 |
|
| 1075 |
.LP |
| 1076 |
Encode with the |
| 1077 |
.B standard |
| 1078 |
preset: |
| 1079 |
.IP |
| 1080 |
.B lame \-\-preset standard |
| 1081 |
.I sample.wav sample.mp3 |
| 1082 |
|
| 1083 |
.SH BUGS |
| 1084 |
.PP |
| 1085 |
Probably there are some. |
| 1086 |
.SH SEE ALSO |
| 1087 |
.BR mpg123 (1) , |
| 1088 |
.BR madplay (1) , |
| 1089 |
.BR sox (1) |
| 1090 |
.SH AUTHORS |
| 1091 |
.nf |
| 1092 |
LAME originally developed by Mike Cheng and now maintained by |
| 1093 |
Mark Taylor, and the LAME team. |
| 1094 |
|
| 1095 |
GPSYCHO psycho-acoustic model by Mark Taylor. |
| 1096 |
(See https://lame.sourceforge.io/). |
| 1097 |
|
| 1098 |
mpglib by Michael Hipp |
| 1099 |
|
| 1100 |
Manual page by William Schelter, Nils Faerber, Alexander Leidinger, |
| 1101 |
and Rog\['e]rio Brito. |
| 1102 |
.\" Local Variables: |
| 1103 |
.\" mode: nroff |
| 1104 |
.\" End: |