Changes between Version 3 and Version 4 of Encode/MP3
- Timestamp:
- Dec 29, 2013, 9:14:15 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Encode/MP3
v3 v4 1 To encode VBR mp3 audio with `ffmpeg`, using libmp3lamelibrary, we would specify a command like this:1 To encode VBR MP3 audio with `ffmpeg`, using the `libmp3lame` library, we would specify a command like this: 2 2 {{{ 3 ffmpeg -i input.wav -codec:a libmp3lame -q:a 2 out .mp33 ffmpeg -i input.wav -codec:a libmp3lame -q:a 2 output.mp3 4 4 }}} 5 5 6 Option `-q:a` needs a parameter, that tells `ffmpeg` something about expected "audio quality". This parameter has a different meaning for each audio encoder used, and we are now describing the libmp3lameencoder.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. 7 7 8 The table for LAME option `-V <number>` is shown here (and that option is mapped to the `-q:a` option in `ffmpeg`): [http://wiki.hydrogenaudio.org/index.php?title=LAME#VBR_.28variable_bitrate.29_settings VBR (variable bitrate) settings for LAME].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 9 10 10 ||= Switch =||= Kbit/s =||= Bitrate range kbit/s =|| … … 21 21 || -V 9 || 65 || 45...85 || 22 22 23 So, in our example above, we selected `-q:a 2`, meaning we used LAME's option `-V 2`, which gives a VBR mp3 audio in the approximate range of 170-210 kbit/s.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. 24 24 25 If you want constant bit rate (CBR) mp3 audio, instead of using `-q:a` option, you need to use the `-b:a` option to set the preferred "audio bit rate" in bits per second, like `-b:a 256k` if you want 256 kbit/s audio.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.
