APPENDIX 3
Encoding Audio and Video for the Web
Encoding audio and video for use with HTML5’s <audio> and <video> tags is a
complex subject that’s out of scope for this book, but this short appendix will
get you going in the right direction if you ever need to prepare your own
content.
A3.1 Encoding Audio
You’ll need to encode your audio files in both MP3 and Vorbis formats to
reach the widest possible audience, and to do that, you’ll use a couple of
tools.
For encoding MP3 files, LAME will give you the best quality.^1 You’ll want to
use a variable bit rate when you encode. You can get a high-quality encoding
using something like this:
$ lamein.wavout.mp3-V2 --vbr-new-q0 --lowpass19.7
For Vorbis audio, you can use Oggenc.^2 To encode a good-sounding Vorbis
file using a variable bit rate, you’d use something like this:
$ oggenc-q 3 inputfile.wav
You can learn more about MP3 and Vorbis encoding at Hydrogen Audio.^3 The
information there is excellent, but you’ll need to experiment with settings that
will work for you and your listeners.
- http://lame.sourceforge.net/
- http://wiki.xiph.org/Vorbis-tools
- MP3 encoding with LAME is covered at http://wiki.hydrogenaudio.org/
index.php?title=Lame#Quickstart.28short_answer.29, and Vorbis encoding is at http://wiki.hydroge-
naudio.org/index.php?title=Recommended_Ogg_Vorbis.
Download from Wow! eBook <www.wowebook.com> report erratum • discuss