HTML5 Video Tag only works with audio rate of 44100Hz

by Stephen Fluin 2009.07.11

As a part of the development of the HTML5 video sharing site, I have been experimenting with automated encoding, and various encoding settings. As I reviewed some of my outputs, I found a disturbing problem. The audio wasn't playing with the video. I opened other theora/vorbis videos successfully, so it wasn't a problem with my browser. I also opened the .ogv files using VLC and the audio played just fine. After extensive comparisons of the encoding settings and the codec details, I found that the source file used a audio bitrate of 24000Hz, and that by encoding the audio at a more standard 44100Hz, the audio plays just fine in Firefox.

Here is the most recent command I have settled on using to ensure that videos play properly. One thing I need to test further is whether or not duplicating the mono sound channel into stereo with the -c flag is necessary.

ffmpeg2theora <inputfile> -c2 -H44100 -o <outputfile>