Thanks to Dave Miller, in the comments of an earlier post, for recommending the Xiph's XipQT package for QuickTime. With that, converting videos to Theora for Firefox's new <video> element is a breeze.
I tested out this new conversion with the Barack Obama weekly address which is available at YouTube and at www.change.gov.
I just took the higher resolution QuickTime movie, scaled it down to the size of the YouTube version and exported it with the option "Movie to Ogg" and it came out pretty nice.
There were a number of quality options and the "low" quality option (number 2 of five levels) got the size down to roughly what the YouTube Flash version is and at about the same quality. But YouTube quality sucks. It's surprisingly bad. So, I went with the "high" quality setting which is just about twice the size of the YouTube Flash version but sooo much easier to watch.
I just discovered that they have an even larger version of file, not linked, but available here, so maybe I'll try again starting with that. I'm gonna presume that starting with the highest quality file I can get will lead to a higher quality result. Then again, maybe that's not the case. If the compression on the original file is the same and we're just talking about the number of pixels, maybe it won't make much of a difference. I guess I will investigate and see.
update: The audio sync seems off a bit. It's not off like that when I play the video in VLC but it is in Firefox both in this page and locally. Not sure why that is.
update2: I've replaced the earlier version with a new one that has a better audio track. I'm hoping this fixes some of the problem with the audio and video syncing.
update3: OK, final update. I grabbed ffmpeg2theora, which boasts a newer theora encoder and made one more version of the file. I'm still seeing sync issues in Firefox that I'm not seeing in VLC so I'm going to chalk those up to Firefox problems. This latest version of the file is about 20% smaller and looks and sounds a good bit better than the previous one so I'm encouraged by the move to a newer encoder. Now we just need a new version of the QT plug-in and a simple GUI for the ffmpeg2theora app. It sure would be nice to have those for the Firefox 3.1 release.
Posted by: Juliana Peña | November 22, 2008 8:23 PM
I get no sound at all here and the movie seems to fast forward instead of play at the normal speed.
I think theora is currently not a very mature thing and the user experience is quite mediocre. Properly packaged & tested codecs seem to be hard to find.
BTW. Youtube quality is low mainly because they want to keep the bandwidth down as well as the server side cpu for reencoding, so be careful about blaming the clientside decoder here.
Posted by: Jilles van Gurp | November 23, 2008 2:00 AM
No sound at all here (20081119 Minefield), but I loved the idea of using a OSS codec.
Posted by: Thales | November 23, 2008 7:48 AM
Is it worth noting that BLIP.tv allows hosting and sharing of Theora-encoded videos?
Posted by: Matthew | November 23, 2008 8:32 AM
In terms of the Theora video quality, realize you are encoding from one lossy format into another lossy format, each using different encoding techniques. You will get better results if you encode to Theora from the loss-less video source files, DV or M-JPEG for example.
Even in situations of lack of quality due to lossy formats, Ogg Theora may still be the best solution because of HTML5 video element playback functionality and because of the absence of distribution restrictions of the encoding and the decoding software.
Posted by: Matthew | November 23, 2008 8:48 AM
No sound for me either (on Linux), but the video looks good. (The sound works for me in VLC.)
Posted by: David Baron | November 23, 2008 8:51 AM
The audio is synced perfectly to the video for me in Firefox
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b2pre) Gecko/20081120 Minefield/3.1b2pre
Posted by: mws | November 23, 2008 9:18 AM
Well it was synced perfectly the first time I played it. Now after I posted my last comment, the audio is not synced correctly.
Posted by: mws | November 23, 2008 9:21 AM
On Safari, video/audio is slightly our of sync as well.
Posted by: Fred | November 23, 2008 10:32 AM
Asa, the audio sampling rate is waaay too high. It's 192 kHz, while commonly used frequencies for very high quality recording are 48 kHz (DVDs) or 44.1 kHz (audio CDs).
Moreover it's 6-channels audio; a simple stereo or even mono audio would make more sense here.
Posted by: Lino Mastrodomenico | November 23, 2008 4:37 PM
One more thing: the Theora library version that you (XiphQT) are using is completely obsolete!
The timestamp is 2006-05-26 and the stream version is 3.2.0, which AFAIK means it's a pre-beta libtheora version!
As you know Theora 1.0 has been released recently, I suggest to make sure you use it since the quality/bitrate ratio of the encoder has improved a lot in the last months.
Posted by: Lino Mastrodomenico | November 23, 2008 5:05 PM
Thanks for all the comments.
I'd love to use an updated Theora encoder, but I don't see an updated XiphQT package and have no idea how I'd get the updated libtheora integrated with QuickTime Pro. Any help would be greatly appreciated.
Also, I've re-encoded and fixed the audio, I think. I'd been experimenting with multi-pass encodings and forgot I'd jacked the audio like that. Hopefully the updated version will work better and have fewer problems syncing audio and video.
- A
Posted by: Asa Dotzler | November 23, 2008 5:26 PM
If you've updated the video here, then I still get no sound on:
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b2pre) Gecko/20081123 Minefield/3.1b2pre ID:20081123131619
Posted by: Damian | November 23, 2008 6:30 PM
And I'm still seeing a bad sync with audio and video. I wonder if the Xiph QT stuff just sucks. It is pretty old.
On advice from Lino and others, I'm gonna give ffmpeg2theora a try. Maybe it does a better job.
- A
Posted by: Asa Dotzler | November 23, 2008 6:33 PM
Hey Asa,
do you think that http://www.ffmpegx.com/ would solve your need for a Mac GUI?
--Tristan (still looking for a solution to easily produce OGG videos too).
Posted by: Tristan | November 24, 2008 4:28 AM
Handbrake for OSX was released on Sunday, with Ogg Theora encoding. This is worth checking out!
http://handbrake.fr/
Posted by: Matthew | November 24, 2008 10:07 AM
Too bad you chose Theora over Dirac.... :(
Posted by: Greg | November 24, 2008 4:43 PM
It happened to me again. The first time I played the new video, the audio was synced but every time after that it is not.
Posted by: mws | November 24, 2008 5:07 PM
Greg, it's not an either/or. We got Theora first because it seems to be the only truly unencumbered codec, but Dirac may happen. Others may also happen. It's still early.
- A
Posted by: Asa Dotzler | November 24, 2008 5:09 PM
I get sound!! Plus, at least at the start I'm not seeing any audio sync problems even with a full game and CPU doing all sorts of stuff in the background.
Greg: Dirac is a very immature format, you'll struggle finding an implementation f a decoder that doesn't chew down CPU like nothing else. Plus it's not an either or situation, I'm sure in time Firefox will be able to add more.
Posted by: Damian | November 25, 2008 5:50 PM
It's not just this video. Audio is commonly out of sync. I've never tried to troubleshoot it, so I don't know if the bug is in Firefox, or somewhere else.
But there's definitely a bug for someone to look into. For what it's worth, this is a 900 MHz Pentium. Most YouTube videos are in sync, but some are not.
Posted by: VanillaMozilla | November 28, 2008 9:46 AM
It's not just this video. Audio is commonly out of sync. I've never tried to troubleshoot it, so I don't know if the bug is in Firefox, or somewhere else.
But there's definitely a bug for someone to look into. For what it's worth, this is a 900 MHz Pentium. Most YouTube videos are in sync, but some are not.
OK, I hope this isn't a double post. I had JS turned off the first time.
Posted by: VanillaMozilla | November 28, 2008 9:48 AM
Firstly, Theora is very important and it's great to see Mozilla engaging with it beyond just playing it back, that is exploring the production side and actually using it.
Secondly, a bug report:
Comparing playback with Safari and XiphQT versus an old Minefield on Mac OS X, not only do I see the audio lag under Minefield, also the colours have a dull green tinge compared with the XiphQT playback. VLC matches the XiphQT colours. I'm surprised no one else has mentioned this, though perhaps few have played the video in two apps, it's subtle enough to not notice unless you have them side by side.
Posted by: dave | December 7, 2008 4:50 AM
Minefield (Nov 18 nightly build) was crashing on me when clicking play on this video.
I updated to the latest nightly (Nov 22) and now at least the video plays, but I have no sound.(As a reference, videos on YouTube sound just fine.)
But the video quality is excellent... crisp clean, unlike YouTube.