home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Sound / LAME / USAGE < prev    next >
Text File  |  2000-08-06  |  23KB  |  677 lines

  1.  
  2. % lame [options] inputfile [outputfile]
  3.  
  4. =======================================================================
  5. Examples:
  6. =======================================================================
  7. fixed bit rate jstereo 128kbs encoding:
  8. % lame sample.wav  sample.mp3      
  9.  
  10. fixed bit rate jstereo 128kbs encoding, highest quality:  (recommended)
  11. % lame -h sample.wav  sample.mp3      
  12.  
  13. To disable joint stereo encoding (slightly faster, but less quality at bitrates<=128kbs)
  14. % lame -m s sample.wav  sample.mp3     
  15.  
  16. Fast encode, low quality  (no noise shaping)
  17. % lame -f sample.wav  sample.mp3     
  18.  
  19. Variable Bitrate (VBR): (use -V n to adjust quality/filesize)
  20. % lame -h -v sample.wav sample.mp3
  21.  
  22. Note: VBR is currently under heavy development.  Right now it can
  23. often result in too much compression.  I would recommend using VBR
  24. with a minimum bitrate of 112kbs.  This will let LAME increase
  25. the bitrate for difficult-to-encode frames, but prevent LAME from
  26. being too aggressive for simple frames:
  27.  
  28. % lame -h -v -b 112  sample.wav sample.mp3
  29.  
  30.  
  31. =======================================================================
  32. LOW BITRATES
  33. =======================================================================
  34. At lower bitrates, (like 24kbs per channel), it is recommended that
  35. you use a 16kHz sampling rate combined with lowpass filtering.  LAME,
  36. as well as commercial encoders (FhG, Xing) will do this automatically.
  37. However, if you feel there is too much (or not enough) lowpass
  38. filtering, you may need to try different values of the lowpass cutoff
  39. and passband width (--resample, --lowpass and --lowpass-width options).
  40.  
  41.  
  42. =======================================================================
  43. STREAMING EXAMPLES
  44. =======================================================================
  45.  
  46. % cat inputfile | lame [options] - - > output
  47.  
  48.  
  49.  
  50.  
  51. =======================================================================
  52.  
  53. For more options, just type:
  54. % lame --help
  55.  
  56. Scripts are included to run lame on multiple files:
  57.  
  58. bach script:  mlame     Run "mlame -h" for instructions.
  59. sh script:    auenc     Run auenc for instructions
  60.  
  61.  
  62.  
  63. =======================================================================
  64. options guide:
  65. =======================================================================
  66. These options are explained in detail below.
  67.  
  68.  
  69. Quality related:
  70.  
  71. -m m/s/j/f     mode selection
  72. -k             disable all filtering
  73. -d             allow block types to differ between channels
  74. --athonly      ignore psy-model output, only use masking from the ATH
  75. --voice        experimental voice encoding mode
  76. --noshort      disable short blocks
  77.  
  78.  
  79. Constant Bit Rate (CBR)
  80. -b  n          set bitrate (8,16,24,...,320)
  81. -h             higher quality but slower
  82. -f             disable noise shaping.  Encodes faster, but lower quality
  83. --freeformat   produce a free format bitstream.  User must also specify
  84.                a bitrate with -b, between 8 and 320 kbs.
  85.  
  86. Variable Bit Rate (VBR)
  87. -v             VBR
  88. --vbr-old      use old variable bitrate (VBR) routine
  89. -V n           VBR quality setting  (0=highest quality, 9=lowest)
  90. -b  n          specify a minimum allowed bitrate (8,16,24,...,320)
  91. -B  n          specify a maximum allowed bitrate (8,16,24,...,320)
  92. -F             strictly enforce minimum bitrate
  93. -t             disable Xing VBR informational tag 
  94. --nohist       disable display of VBR bitrate histogram
  95.  
  96. --abr n        specify average bitrate desired
  97.  
  98.  
  99. Experimental (undocumented):  may work better or worse:
  100.  
  101. -X n           try different quality measures (when comparing quantizations)
  102. -Y             
  103. -Z             
  104.  
  105.  
  106. Operational:
  107.  
  108. -r             assume input file is raw PCM
  109. -s  n          input sampling frequency in kHz (for raw PCM input files)
  110. --resample n   output sampling frequency
  111. --mp3input     input file is an MP3 file.  decode using mpglib/mpg123
  112. --ogginput     input file is an Ogg Vorbis file.  decode using libvorbis
  113. -x             swap bytes of input file
  114. -a             downmix stereo input file to mono .mp3
  115. -e  n/5/c      de-emphasis
  116. -p             add CRC error protection
  117. -c             mark the encoded file as copyrighted
  118. -o             mark the encoded file as a copy
  119. -S             don't print progress report, VBR histogram
  120. -g             run MP3x, the graphical frame analyzer
  121. --strictly-enforce-ISO   comply as much as possible to ISO MPEG spec
  122.  
  123. --decode       assume input file is an mp3 file, and decode to wav.
  124. -t             disable writing of WAV header when using --decode
  125.                (decode to raw pcm, native endian format (use -x to swap))
  126.  
  127. --ogg          Encode using Ogg Vorbis (.ogg) instead of mp3.
  128.  
  129.  
  130.  
  131. ID3 tagging:
  132.  
  133. --tt <title>    audio/song title (max 30 chars for version 1 tag)
  134. --ta <artist>   audio/song artist (max 30 chars for version 1 tag)
  135. --tl <album>    audio/song album (max 30 chars for version 1 tag)
  136. --ty <year>     audio/song year of issue (1 to 9999)
  137. --tc <comment>  user-defined text (max 30 chars for v1 tag, 28 for v1.1)
  138. --tn <track>    audio/song track number (1 to 99, creates v1.1 tag)
  139. --tg <genre>    audio/song genre (name or number in list)
  140. --add-id3v2     force addition of version 2 tag
  141. --id3v1-only    add only a version 1 tag
  142. --id3v2-only    add only a version 2 tag
  143. --space-id3v1   pad version 1 tag with spaces instead of nulls
  144. --pad-id3v2     pad version 2 tag with extra 128 bytes
  145. --genre-list    print alphabetically sorted ID3 genre list and exit
  146.  
  147. Note: A version 2 tag will NOT be added unless one of the input fields
  148. won't fit in a version 1 tag (e.g. the title string is longer than 30
  149. characters), or the `--add-id3v2' or `--id3v2-only' options are used,
  150. or output is redirected to stdout.
  151.  
  152.  
  153.  
  154. options not yet described:
  155. --nores            disable bit reservoir
  156. --noath            disable ATH
  157. --athlower <n db>  lower the ATH by n db.  
  158. --athshort         use only the ATH for short blocks
  159. --cwlimit <freq>   specify range of tonality calculation
  160.  
  161. --lowpass
  162. --lowpass-width
  163. --highpass
  164. --highpass-width
  165.  
  166.  
  167.  
  168.  
  169.  
  170. =======================================================================
  171. Detailed description of all options in alphabetical order
  172. =======================================================================
  173.  
  174.  
  175. =======================================================================
  176. downmix
  177. =======================================================================
  178. -a  
  179.  
  180. mix the stereo input file to mono and encode as mono.  
  181.  
  182. This option is only needed in the case of raw PCM stereo input 
  183. (because LAME cannot determine the number of channels in the input file).
  184. To encode a stereo PCM input file as mono, use "lame -m s -a"
  185.  
  186. For WAV and AIFF input files, using "-m m" will always produce a
  187. mono .mp3 file from both mono and stereo input.
  188.  
  189.  
  190. =======================================================================
  191. average bitrate encoding (aka Safe VBR)
  192. =======================================================================
  193. --abr n
  194.  
  195. turns on encoding with a targeted average bitrate of n kbits, allowing
  196. to use frames of different sizes.  The allowed range of n is 4-310,
  197. you can use any integer value within that range.
  198.  
  199. It can be combined with the -b and -B switches like
  200. lame --abr 123 -b 64 -B 192 a.wav a.mp3
  201. which would limit the allowed frame sizes between 64 and 192 kbits.
  202.  
  203. Using -B is NOT RECOMMENDED.  A 128kbs CBR bitstream, because of the
  204. bit reservoir, can actually have frames which use as many bits as a
  205. 320kbs frame.  VBR modes minimize the use of the bit reservoir, and
  206. thus need to allow 320kbs frames to get the same flexability as CBR
  207. streams.
  208.  
  209.  
  210.  
  211.  
  212. =======================================================================
  213. ATH only
  214. =======================================================================
  215. --athonly
  216.  
  217. This option causes LAME to ignore the output of the psy-model and
  218. only use masking from the ATH.  Might be useful at very high bitrates
  219. or for testing the ATH.  
  220.  
  221.  
  222.  
  223.  
  224. =======================================================================
  225. bitrate
  226. =======================================================================
  227. -b  n
  228.  
  229. For MPEG1 (sampling frequencies of 32, 44.1 and 48kHz)
  230. n =   32,40,48,56,64,80,96,112,128,160,192,224,256,320
  231.  
  232. For MPEG2 (sampling frequencies of 16, 22.05 and 24kHz)
  233. n = 8,16,24,32,40,48,56,64,80,96,112,128,144,160
  234.  
  235.  
  236. The bitrate to be used.  Default is 128kbs MPEG1, 80kbs MPEG2.
  237.  
  238. When used with variable bitrate encodings (VBR), -b specifies the
  239. minimum bitrate to use.  This is useful to prevent LAME VBR from
  240. using some very aggressive compression which can cause some distortion
  241. due to small flaws in the psycho-acoustic model.
  242.  
  243. =======================================================================
  244. max bitrate
  245. =======================================================================
  246. -B  n
  247.  
  248. For MPEG1 (sampling frequencies of 32, 44.1 and 48kHz)
  249. n =   32,40,48,56,64,80,96,112,128,160,192,224,256,320
  250.  
  251. For MPEG2 (sampling frequencies of 16, 22.05 and 24kHz)
  252. n = 8,16,24,32,40,48,56,64,80,96,112,128,144,160
  253.  
  254. Maximum allowed bitrate when using VBR.
  255.  
  256.  
  257. =======================================================================
  258. copyright
  259. =======================================================================
  260. -c   
  261.  
  262. mark the encoded file as copyrighted
  263.  
  264.  
  265.  
  266. =======================================================================
  267. block type control
  268. =======================================================================
  269. -d 
  270.  
  271. Allows the left and right channels to use different block types.
  272. Normally this is not allowed, only because the FhG encoder does
  273. not seem to allow it either.  If anyone finds a sample where -d
  274. produces better results, let me know.  (mt@sulaco.org)
  275.  
  276.  
  277. =======================================================================
  278. mpglib decode capability
  279. =======================================================================
  280. --decode 
  281.  
  282. This just uses LAME's mpg123/mpglib interface to decode an MP3 file to
  283. a wav file.  The input file can be any input type supported by
  284. encoding, including .mp3  and .ogg.  
  285.  
  286. If -t is used (disable wav header), LAME will output
  287. raw pcm in native endian format (use -x to swap bytes).
  288.  
  289.  
  290. =======================================================================
  291. de-emphasis
  292. =======================================================================
  293. -e  n/5/c   
  294.  
  295.   n = (none, default)
  296.   5 = 0/15 microseconds
  297.   c = citt j.17
  298.  
  299. All this does is set a flag in the bitstream.  If you have a PCM
  300. input file where one of the above types of (obsolete) emphasis has
  301. been applied, you can set this flag in LAME.  Then the mp3 decoder
  302. should de-emphasize the output during playback, although most 
  303. decoders ignore this flag.
  304.  
  305. A better solution would be to apply the de-emphasis with a standalone
  306. utility before encoding, and then encode without -e.  
  307.  
  308.  
  309.  
  310. =======================================================================
  311. fast mode
  312. =======================================================================
  313. -f   
  314.  
  315. disable noise shaping.  Encodes faster, but lower quality.
  316. Psycho acoustics are computed for bit allocation and 
  317. pre-echo detection.
  318.  
  319. =======================================================================
  320. strictly enforce VBR minimum bitrate
  321. =======================================================================
  322. -F   
  323.  
  324. strictly enforce VBR minimum bitrate.  With out this optioni, the minimum
  325. bitrate will be ignored for passages of analog silence.
  326.  
  327.  
  328.  
  329. =======================================================================
  330. free format bitstreams
  331. =======================================================================
  332. --freeformat   
  333.  
  334. LAME will produce a fixed bitrate, free format bitstream.
  335. User must specify the desired bitrate in kbs, which can
  336. be any integer between 8 and 320.
  337.  
  338. Not supported by most decoders.  Decoders only required to support
  339. up to 320kbs.  
  340.  
  341. Decoders which can handle free format:
  342.                      supports up to
  343. "lame --decode"          560kbs  
  344. Freeamp:                 440kbs
  345. l3dec:                   310kbs
  346.  
  347.  
  348.  
  349.  
  350.  
  351. =======================================================================
  352. graphical frame analyzer
  353. =======================================================================
  354. -g
  355.  
  356. run MP3x, the graphical frame analyzer analysis on the inputfile.  The
  357. inputfile can be either an .mp3 file or uncompressed audio file.  MP3x
  358. support must be compiled into LAME, and requires GTK 1.2.
  359. Documentation is under the About pull down menu.
  360.  
  361.  
  362.  
  363. =======================================================================
  364. high quality
  365. =======================================================================
  366. -h
  367.  
  368. use (maybe) some quality improvements
  369.  
  370. LAME 3.21 and up:  -h enables specialized mid/side masking thresholds to
  371. be used in jstereo mode.  Will sound better in jstereo mode
  372. but is 20% slower.  No effect for mono files.
  373.  
  374. LAME 3.58beta and up: -h also enables a more accurate but slightly
  375. slower quantization formula.  
  376.  
  377.  
  378.  
  379. =======================================================================
  380. keep all frequencies
  381. =======================================================================
  382. -k   
  383.  
  384. keep all frequencies.  (Disable all filters)
  385.  
  386. LAME will automatically apply various types of lowpass filters.  This
  387. is because the high frequency coefficients can take up a lot of bits
  388. that would be better used for lower, more important frequencies.
  389.  
  390. -k will disable all lowpass filtering.  Not recommended.
  391.  
  392.  
  393.  
  394. =======================================================================
  395. Modes:
  396. =======================================================================
  397.  
  398. -m m           mono.  
  399. -m s           stereo
  400. -m j           jstereo
  401. -m f           forced mid/side stereo
  402.  
  403. mono is the default mode for mono input files.  If "-m m" is specified
  404. for a stereo input file, the two channels will be averaged into a mono
  405. signal.  
  406.  
  407. jstereo is the default mode for stereo files with fixed bitrates of
  408. 128kbs or less.  At higher fixed bitrates, the default is stereo.
  409. For VBR encoding, jstereo is the default for VBR_q >4, and stereo
  410. is the default for VBR_q <=4.  You can override all of these defaults
  411. by specifing the mode on the command line.  
  412.  
  413. jstereo means the encoder can use (on a frame by frame bases) either
  414. regular stereo (just encode left and right channels independently)
  415. or mid/side stereo.  In mid/side stereo, the mid (L+R) and side (L-R)
  416. channels are encoded, and more bits are allocated to the mid channel
  417. than the side channel.  This will effectively increase the bandwidth
  418. if the signal does not have too much stereo separation.  
  419.  
  420. Mid/side stereo is basically a trick to increase bandwidth.  At 128kbs,
  421. it is clearly worth while.  At higher bitrates it is less usefull.  
  422.  
  423. Using mid/side stereo inappropriately can result in audible
  424. compression artifacts.  To much switching between mid/side and regular
  425. stereo can also sound bad.  To determine when to switch to mid/side
  426. stereo, LAME uses a much more sophisticated algorithm than that
  427. described in the ISO documentation.
  428.  
  429. -m f forces all frames to be encoded mid/side stereo.  It 
  430. should only be used if you are sure every frame of the input file
  431. has very little stereo seperation.  
  432.  
  433.  
  434.  
  435. =======================================================================
  436. MP3 input file
  437. =======================================================================
  438. --mp3input
  439.  
  440. Assume the input file is a MP3 file.  Usefull for downsampling from
  441. one mp3 to another.  If the filename ends in ".mp3" LAME will assume
  442. it is an MP3.  For stdin or MP3 files which dont end in .mp3 you need
  443. to use this switch.
  444.  
  445.  
  446. =======================================================================
  447. disable historgram display
  448. =======================================================================
  449. --nohist
  450.  
  451. By default, LAME will display a bitrate histogram while producing
  452. VBR mp3 files.  This will disable that feature.
  453.  
  454.  
  455. =======================================================================
  456. disable short blocks
  457. =======================================================================
  458. --noshort
  459.  
  460. Encode all frames using long blocks.
  461.  
  462.  
  463.  
  464. =======================================================================
  465. non-original
  466. =======================================================================
  467. -o   
  468.  
  469. mark the encoded file as a copy
  470.  
  471.  
  472.  
  473. =======================================================================
  474. Ogg Vorbis encoding
  475. =======================================================================
  476. --ogg
  477.  
  478. Encode using the Ogg Vobis codec (using libvorbis) instead of
  479. LAME's internal mp3 codec.
  480.  
  481.  
  482.  
  483. =======================================================================
  484. Ogg Vorbis input file
  485. =======================================================================
  486. --ogginput
  487.  
  488. Assume the input file is an Ogg Vorbis file.  Mostly usefull
  489. with --decode for playing back .ogg files, or converting
  490. your .ogg collection to MP3 :-)
  491.  
  492. If the filename ends in ".ogg" LAME will assume it is Ogg.  For
  493. stdin or files which dont end in .ogg you need to use this switch.
  494.  
  495.  
  496.  
  497.  
  498. =======================================================================
  499. CRC error protection
  500. =======================================================================
  501. -p  
  502.  
  503. turn on CRC error protection.  
  504. Yes this really does work correctly in LAME.  However, it takes 
  505. 16 bits per frame that would otherwise be used for encoding.
  506.  
  507.  
  508.  
  509. =======================================================================
  510. input file is raw pcm
  511. =======================================================================
  512. -r  
  513.  
  514. Assume the input file is raw pcm.  Sampling rate and mono/stereo/jstereo
  515. must be specified on the command line.  Without -r, LAME will perform
  516. several fseek()'s on the input file looking for WAV and AIFF headers.
  517.  
  518. Not supported if LAME is compiled to use LIBSNDFILE.
  519.  
  520.  
  521.  
  522. =======================================================================
  523. output sampling frequency in kHZ
  524. =======================================================================
  525. --resample  n
  526.  
  527. where n = 16, 22.05, 24, 32, 44.1, 48
  528.  
  529. Output sampling frequency.  Resample the input if necessary.  
  530.  
  531. If not specified, LAME may sometimes resample automatically 
  532. when faced with extreme compression conditions (like encoding
  533. a 44.1khz input file at 16kbs).  
  534.  
  535.  
  536.  
  537. =======================================================================
  538. sampling frequency in kHZ
  539. =======================================================================
  540. -s  n
  541.  
  542. where n = sampling rate in kHz.
  543.  
  544. Required for raw PCM input files.  Otherwise it will be determined
  545. from the header information in the input file.
  546.  
  547. LAME will automatically resample the input file to one of the
  548. supported MP3 samplerates if necessary.
  549.  
  550.  
  551. =======================================================================
  552. silent operation
  553. =======================================================================
  554. -S
  555.  
  556. don't print progress report
  557.  
  558.  
  559. =======================================================================
  560. strict ISO complience
  561. =======================================================================
  562. --strictly-enforce-ISO   
  563.  
  564. With this option, LAME will enforce the 7680 bit limitation on
  565. total frame size.  This results in many wasted bits for
  566. high bitrate encodings.
  567.  
  568.  
  569. =======================================================================
  570. disable Xing VBR tag
  571. =======================================================================
  572. -t              
  573.  
  574. Disable writing of the Xing VBR Tag (only valid if -v flag is
  575. specified) This tag in embedded in frame 0 of the MP3 file.  It lets
  576. VBR aware players correctly seek and compute playing times of VBR
  577. files.
  578.  
  579. When '--decode' is specified (decode mp3 to wav), this flag will 
  580. disable writing the WAV header.  The output will be raw pcm,
  581. native endian format.  Use -x to swap bytes.
  582.  
  583.  
  584.  
  585. =======================================================================
  586. variable bit rate  (VBR)
  587. =======================================================================
  588. -v
  589.  
  590. Turn on VBR.  There are several ways you can use VBR.  I personally
  591. like using VBR to get files slightly bigger than 128kbs files, where
  592. the extra bits are used for the occasional difficult-to-encode frame.
  593. For this, try specifying a minimum bitrate to use with VBR:
  594.  
  595. lame -v -b 112  input.wav output.mp3
  596.  
  597. If the file is too big, use -V n, where n=0..9
  598.  
  599. lame -v -V n   -b 112  input.wav output.mp3
  600.  
  601.  
  602. If you wan to use VBR to get the maximum compression possible,
  603. and for this, you can try:  
  604.  
  605. lame -v  input.wav output.mp3
  606. lame -v -V n input.wav output.mp3         (to very quality/filesize)
  607.  
  608.  
  609.  
  610.  
  611. =======================================================================
  612. old variable bit rate  (VBR)
  613. =======================================================================
  614. --vbr-old
  615.  
  616. same as -v but turns on the old VBR routine
  617.  
  618.  
  619.  
  620. =======================================================================
  621. VBR quality setting
  622. =======================================================================
  623. -V n       
  624.  
  625. n=0..9.  Specifies the value of VBR_q.  default=4.  0=highest quality.
  626.  
  627.  
  628.  
  629. How is VBR_q used?
  630.  
  631. OVER = number of scalefactor bands with distortion that exceeds the
  632. allowed distortion given by the masking thresholds.  OVER is computed
  633. by outer_loop, and the masking thresholds are computed by the
  634. psycho-acoustic model. 
  635.  
  636. VBR_q = the minimum value of OVER which is to be allowed.
  637. LAME will choose the smallest bitrate for which OVER <= VBR_q.  
  638. (a minimum allowed bitrate can be set with -b.  default=64kbs)
  639.  
  640. If the frame contains short blocks, then the minimum bitrate is made
  641. much larger since the OVER does not adequately measure distortion
  642. caused by pre-echo.  LAME uses bitrates of at least 160kbs for short
  643. blocks to make sure they sound good.
  644.  
  645. *NOTE* No psy-model is perfect, so there can often be distortion which
  646. is audible even though the psy-model claims it is not!  Thus using a
  647. small minimum bitrate can result in some aggressive compression and
  648. audible distortion even with -V 0.  Thus using -V 0 does not sound
  649. better than a fixed 256kbs encoding.  For example: suppose in the 1kHz
  650. frequency band the psy-model claims 20db of distortion will not be
  651. detectable by the human ear, so LAME VBR-0 will compress that
  652. frequency band as much as possible and introduce at most 20db of
  653. distortion.  Using a fixed 256kbit framesize, LAME could end up
  654. introducing only 2db of distortion.  If the psy-model was correct,
  655. they will both sound the same.  If the psy-model was wrong, the VBR-0
  656. result can sound worse.
  657.  
  658.  
  659. =======================================================================
  660. voice encoding mode
  661. =======================================================================
  662. --voice
  663.  
  664. An experimental voice encoding mode.  Tuned for 44.1kHz input files.
  665.  
  666.  
  667. =======================================================================
  668. swapbytes   
  669. =======================================================================
  670. -x
  671.  
  672. swap bytes in the input file (and output file when using --decode).
  673. For sorting out little endian/big endian type problems.  If your
  674. encodings sound like static, try this first.
  675.  
  676.  
  677.