streaming video in firefox
by Christopher Blizzard
Asa Dotzler has been trying to get live streaming working with our new native video support that’s coming with Firefox 3.1. That is, video that is taken by a camera, encoded and pushed directly out to a web server instead of stored as a file so you can watch an event in real time. The screenshot above is the first time – that I know of – where anyone has gotten this working in the browser without some kind of plug-in involved. (And it’s free software, end-to-end, which is also nice.)
We managed to get the lag down to 2-3 seconds at one point. We can probably get it even lower. But it’s a fantastic start.
Asa isn’t the most technical guy, but he managed to get it working by mostly following the instructions on this page. And it mostly works out of the box. There are some bugs to fix on our end, and encoding theora without dedicated hardware is kind of painful, but it’s great to see the possibilities open up when we’ve got dedicated video support directly in the browser.

What does this mean for the browser plugins like mplayerplug-in and gecko-mediaplayer?
Are you doing the streaming upload from a webpage, using Brad’s camera work at http://blog.mozilla.com/blassey/2008/09/23/camera-input-tag/?
If so, which HTML do you use – <input type=”file” accept=”video/*”/>? Then how do you get it to stream, rather than wait for the record to finish then upload?
Can’t wait to not need flash for one more thing.
Wow, great stuff! I’m looking forward to this becoming more common in the future!
What would be really nice is if Firefox supported rtsp too. Using recent GStreamer, its just a matter of putting in a rtsp:// URI I think, that way, the delay can be even lower than a HTTP based solution. And obviously, if we want to kill flash entirely, I think it will be a requirement.
To answer some of the questions:
1. It doesn’t mean anything to the plugins like mplayer, etc. Except that Mozilla will handle some media types directly instead of delegating to a plugin.
2. The streaming is done via a camera and dedicated machine for encoding. We’re not publishing via the browser (yet!)
3. We’re not supporting rtsp yet, but I think it would be pretty cool if we did. Not sure if that’s in the plans yet.
http://flickr.com/photos/zbraniecki/3183001193/ – I made this screenshot with Asa on 3 platforms holding Fennec streaming himself. :)
Hey,
very nice! Here you go if you don’t want to mess around compiling stuff, but use our very nice friend gstreamer (a simple commandline):
http://www.informatik.uni-bremen.de/~fabiand/video.html
Hey, thanks! That’s a crazy command line.
This looks awesome. I am so excited about Theora playback in FF3.1, that I am sitting on the edge of my seat awaiting the release. I think we have not yet imagined all the possibilities of an open and freely usable, internet video framework. I feel like I am gazing at all the presents under a christmas tree!
This is cool. Does anyone know if this will work with Flumotion as well?
It’s just ogg-over-http, not too much beyond that at this point.
Since this blog post is being used as a reference, I think it is important for visitors to also note that it is already very possible to stream Ogg Theora with the aid of plug-ins or with the use of external video player programs. There is nothing new about streaming Theora!
Examples are: Theora Sea, iTheora, Editing Archive TV, TV Mallorca, Visonair.tv, Okto’s Theora Livestream, VagueTV, modulix.org, and many more. Streaming Ogg Theora is not at all new, and it can even be done with JavaScript and a multimedia backend.
Why this is exciting is because it is W3C-standard-compliant video playback within Firefox, without any external programs.
[...] interwoven with conventional HTML content and manipulated through the DOM. Mozilla has recently demonstrated the video element feature being used for streaming video. Opera is also integrating standards-based [...]
This is a good first step, for sure, but there needs to be at least rudimentary embedded playback controls in order to be useful.
Arbitary controllers can easily be added using JS.
Agreed on the controls. Embedded controls have landed on the nightly branch for 3.1 and they work OK. But in the streaming case, they need some help. (Dogfooding on air.mozilla.com has been a fantastic experience, turns out.) So we’ll continue to make changes.
Everybody keep hyperventilating over the video capability, but completely ignoring the audio…
While I completely understand (and agree) that the benefit of Ogg Theora over the main proprietary alternative (Adobe Flash video) is its legally-free nature rather than the technology itself, it does seem to be the case – and please correct me if I’m wrong here – that at a given bit rate Flash video will tend to be higher quality than the same video in Theora at the same rate.
On the other hand, Ogg Vorbis audio in my experience not only is Legally Free as well, but also is a step up in quality from its main proprietary alternative (mp3) at the same bitrate in my experience. I’m surprised that there’s been no real mention of this. I think it’s a serious selling-point. Being able to post homebrew audio Legally Free, in a much simpler manner then the proprietary alternative (<audio> tag vs. the obnoxious <embed>/<object>-with-embedded-player-and-plugin) AND have the result be higher quality is an unambiguous improvement.
(I think Theora would have done better if Xiph hadn’t ended up delegating it to one guy who was too busy to work on it most of the time for 8 years before finally releasing it…)
Video-wise I think that they are roughly on-par. Depends a lot on the encoder.
I don’t know how Theora compares to VP6 but it definitely is rather shit compared to h264 which most of the world is moving to (including FLV and mov of course) or even the crappier VC-1 (WMV). Sad to say, I just don’t see Theora working. It’s just too shit a codec for that. If this was 4 years ago, when most people were still using crappier codecs then maybe. But now that basically everyone is using or moving to a good codec Theora just has no chance. Bandwidth both for providers and users is simply too expensive to waste it on a crappy video codec (audio doesn’t matter). And people are starting to demand better quality.
Dirac may fare better. It seems to me it’s the only hope for a truly open source codec. I don’t know how it is at the moment but my gut feeling is it has the chance of competing with H264 on efficiency. The fact it’s in a newer area means there’s hopefully fewer patents to worry about. (I personally wonder if it was a mistake for the BBC to their application lapse, if they had the patents they could use them in case any wavelet competitor emerged who had patents Dirac allegly infringed.) Really I think Mozilla choose the wrong horse when they picked Theora. Yes it’s more mature. But it’s also pretty shit (and the fact it’s mature and shit is not a good sign).
Having said that, I wonder whether any codec has any real hope. Whether we like it or not the threat of submarine (or not so submarine) patents is real. For large companies, the risk is real. H264 is well implemented enough that for most providers the risk is far less. Yes it’s possible there’s something (it always is) but if you haven’t come out of the woodwork to sue Sony, Apple, (soon) Microsoft, et al, who are you going to sue? With Theora who has there been to sue? Wikimedia? Now Mozilla? A few small Korean companies and some small game producers? No one worth your while (remembering you may only have one shot at it). Most of them don’t have the resources plus sueing a nonprofit is never likely to go down well (people care far less if you sue Apple, Nokia or Microsoft, indeed some may even support you David vs Goliath and all that). Whether we like it or not, it’s a real risk with the current patent system
NE.
just to keep the days as sunny as it is: You will be relieved to hear that there were some people whom decided that dirac will be included in oggplay.