Changes between Version 4 and Version 5 of Encode/MP3


Ignore:
Timestamp:
Jan 3, 2014, 3:42:00 AM (5 years ago)
Author:
llogan
Comment:

nits and additional info on qscale:a range

Legend:

Unmodified
Added
Removed
Modified
  • Encode/MP3

    v4 v5  
    1 To encode VBR MP3 audio with `ffmpeg`, using the `libmp3lame` library, we would specify a command like this:
     1= VBR Encoding =
     2
     3Example to encode VBR MP3 audio with `ffmpeg` using the `libmp3lame` library:
    24{{{
    3 ffmpeg -i input.wav -codec:a libmp3lame -q:a 2 output.mp3
     5ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3
    46}}}
    57
    6 The option `-q:a` needs a parameter that tells `ffmpeg` what audio quality we expect. This parameter has a different meaning for each audio encoder used, and we are now describing the `libmp3lame` encoder.
     8Control quality with `-qscale:a` (or the alias `-q:a`). Values are encoder specific, so for `libmp3lame` the range is 0-9 where a lower value is a higher quality. 0-3 will normally produce transparent results, 4 (default) should be close to perceptual transparency, and 6 produces an "acceptable" quality. The option `-qscale:a` is mapped to the `-V` option in the standalone `lame` command-line interface tool.
    79
    8 The [http://wiki.hydrogenaudio.org/index.php?title=LAME#VBR_.28variable_bitrate.29_settings table for the LAME -V option] is shown in the following. The option is mapped to `-q:a` in `ffmpeg`.
    9 
    10 ||= Switch =||= Kbit/s =||= Bitrate range kbit/s =||
     10||||||= '''LAME Bitrate Overview''' =||
     11|| Option || Kbit/s || Bitrate range kbit/s ||
    1112|| -b 320 || 320 || 320 CBR ||
    1213|| -V 0 || 245 || 220...260 ||
     
    2122|| -V 9 || 65 || 45...85 ||
    2223
    23 In our example above, we selected `-q:a 2`, meaning we used LAME's option `-V 2`, which gives us a VBR MP3 audio stream with an average stereo bitrate of 170–210 kBit/s.
     24In our example above, we selected `-qscale:a 2`, meaning we used LAME's option `-V2`, which gives us a VBR MP3 audio stream with an average stereo bitrate of 170-210 kBit/s.
    2425
    25 If you need constant bitrate (CBR) MP3 audio, you need to use the `-b:a` option instead of `-q:a`. Here you can specify the number of bits per second, for example `-b:a 256k` if you want 256 kBit/s audio.
     26= CBR Encoding =
     27
     28If you need constant bitrate (CBR) MP3 audio, you need to use the `-b:a` option instead of `-qscale:a`. Here you can specify the number of bits per second, for example `-b:a 256k` if you want 256 kBit/s audio.
     29
     30== Also see ==
     31* [http://ffmpeg.org/ffmpeg-codecs.html#libmp3lame-1 FFmpeg Codecs Documentation for libmp3lame]
     32* [http://wiki.hydrogenaudio.org/index.php?title=LAME#Recommended_encoder_settings Hydrogen Audio: Recommended LAME Encoder Settings]