Thursday, July 31, 2008

Theora Video Backend for Firefox Landed

It was announced at the Firefix Plus summit today that Firefox will include native Theora and Vorbis support for the HTML 5 media elements. So <video> and <audio> will support those codecs built into Firefox itself. Chris Blizzard posted about this earlier.

The backend has been committed to the main Mozilla source code and is enabled by default. You can download nightly builds and test it out. An example of a live site that uses <video> is the Wikimedia video archive.

This original commit is a work in progress. There are unimplemented bits, bugs, etc that need to be sorted out. But it's a start towards using a common codec across all platforms and will improve as we get towards the 3.1 release.

In other news, getting out of Whistler, where the summit is being held, is somewhat of an issue at the moment...

Categories: ,

Labels:

33 Comments:

Blogger skierpage said...

If I go to Wikimedia commons and view some videos, it seems to fire up Java to play the videos, not use a <video> tag.

It seems autoplay="false" and controls="true" don't work in Gecko/2008073003 , according to my test page. Anyway, very, very cool work!

10:08 AM  
OpenID mardeg said...

SVG animation builds on the tryserver combined with ogg theora from the nightlies should be at https://build.mozilla.org/tryserver-builds/2008-07-30_13:54-dholbert@mozilla.com-smil_dholbert/ for anyone wanting to play with them.

10:10 AM  
OpenID mardeg said...

@skierpage: You need to disable java/quicktime and any other video playing plugins, since wikimedia tries with them before generating the navtive video tags

10:12 AM  
Blogger skierpage said...

Thanks mardeg, seems like Wikimedia will eventually need to adjust its algorithm.

I also noticed in my Tools >Options > Applications, there's no option for application/ogg to "Preview in Minefield" or "Open in Firefox". How do I tell FF3.1 that it can handle a raw .ogg file natively instead of Quicktime?

I also noticed that Tools > Page Info doesn't show anything under the Media tab for a page with audio and video tags.

10:26 AM  
Blogger skierpage said...

I filed bugs 448630 and 448633. I didn't file a bug about controls="true" not working since you acknowledged that in your Firefox HTML5 Video with GStreamer post.

5:24 PM  
Blogger Chris Double said...

Thanks skierpage, I'll look into them!

5:34 PM  
Blogger maikmerten said...

One doesn't need to disable Java to use the new video-support on Wikipedia. Once the video is playing you can click on "More..." and select your video playback preference.

This perhaps needs a UI redesign.

6:30 PM  
Blogger Bastiaan said...

sweeeeeeeeeeeet

9:47 PM  
OpenID Swatinem said...

Well for me it doesn't work that good. On wikimedia, the videos use as much cpu power as flash does, which is 100% on one core. It also crashed on me twice. This is with hg 793aba82ef76 compiled from source on ubuntu 64bit.
Also when I have for example rhythmbox running and try to play a video, I get the following error on the console: ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
The video then plays in super high-speed.

10:44 PM  
Blogger Mikachu said...

I certainly hope you can disable autoplay, which the page can't override. There's nothing i hate more than clicking a link and suddenly something starts playing (especially when opening links in new tabs).

11:34 PM  
Blogger David Gerard said...

@swatinem: this is why video-tag playback is the last option MediaWiki tries, because it's buggy :-) Presumably that's the point of this being in the nightly: so people can beat on it and crash it and report bugs and bugs and bugs.

Wikimedia really wants this to be the default option. But it has to work better than loading Cortado in Java first.

12:44 AM  
Blogger jmdesp said...

On XP/SP2 Fx 2008073106 when I load this page :
http://www.skierpage.com/moz_bugs/Albanian_numbers.ogg
I get only a (no video) display.

And then if I try to reload the page, I have a systematic crash.

Crash stack:
http://crash-stats.mozilla.com/report/index/00b1926e-5f1e-11dd-8895-001cc4e2bf68?p=1
http://crash-stats.mozilla.com/report/index/ce7daf9e-5f1d-11dd-bf97-001321b13766

Probably this is known but on this page :
http://people.xiph.org/~maikmerten/demos/arctic_giant.html
two things are obvious;
- "(no video)" is displayed until the video is fully loaded. We need a "video is loading" message instead
- the video is displayed only once it has been fully loaded

Some other sample like
http://www.double.co.nz/video_test/test1.html
don't display anything.
Cliking the "Play" and "Pause" button gives a javascript error.
- v.play is not a function
- v.pause is not a function

4:43 AM  
Blogger skierpage said...

@jmdesp, I think browsing a raw .ogg file (rather than one referenced by an<audio> or <video> tag in an HTML page) goes through the browser's Tools > Options > Applications handling. My OGG file setting was "Use QuickTime 7.4 Plug-in (in Minefield)", I'm not sure how to change it to "let browser handle this internally". When I set it to "Use Firefox" 120 tabs opened before I killed the process.

5:46 AM  
Blogger jmdesp said...

@skierpage:

You're right, there was libvlc.dll in my stack.

Now what's strange is once I disable all my video and java plugins, I realize that all the cases that worked were going through vlc, and nothing works anymore without it.

I get an error message on wikimedia that I don't have any player, not the native video tag.

I wonder what's going wrong.

6:04 AM  
Blogger Singpolyma said...

Firefox has always had Theora/Vorbis support for standards-compliant media <object> tags if a good plugin (totem/xine/vlc) was around on the system.

Building any kind of knowledge of codecs/media into the browser directly is just disgusting bloat. Firefox is slow enough as it is. One more reason to hate the crap that is HTML5.

6:21 AM  
OpenID jhartzell42 said...

Firefox could use plugins to implement the video tag. This disgusting bloat is not HTML5's fault, but rather firefox's implementation of it. HTML5 is awesome.

12:05 PM  
Blogger उन्मुक्त said...

Great! I have been podcasting in ogg format for two years and my listners always had difficulty in listening it.

3:07 PM  
Blogger The_Decryptor said...

"Firefox could use plugins to implement the video tag."

It will, Firefox is only going to come with an Theora/Vorbis decoder, it'll plug into a system backend on the platform it's running on. On Windows It'll use DirectShow, on OS X It'll use QuickTime and on Linux It'll use Gstreamer.

Theora and Vorbis are just a common implementation across all platforms (which will be overridden by the system backends if they can handle it).

Regarding the inbuilt Theora backend, It's a bit buggy for me. On OS X it starts a bad memory leak when I try watching a video (4GB of VM RAM, and 500MB of system RAM) and Firefox eventually closes (after making the entire system unresponsive). Works fine on Windows though.

4:56 PM  
Blogger maikmerten said...

The object-tag is not enough, mostly because a) one *cannot* rely on plugins being available (and installed) across platforms and b) because plugins as-we-know-them don't integrate properly into the rendering pipeline. At least I'm not aware that e.g. plugins could be transparent or have filter effects applied - currently (as one example) the Flash plugin always seems to render on top of everything else, occasionally wrecking "dynamic menus" (like on http://asus.com/index.aspx ). This may be an implementation issue, though. Oh, and c) basically every video plugin implements its own JavaScript API.

Compare this to e.g. Flash, where video nicely integrates with other Flash content and has reliable scripting (and notice the downside of how Flash usually lives within its own bubble). Video should be just as convenient in HTML, with the exception of not living within its own world. People don't seriously suggest img should rely on plugins, video and audio should be first class citizens as well.

6:27 PM  
Blogger Pavlos said...

The videos here ( http://www.double.co.nz/video_test/ ) keep playing even after I close the tab they're in.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1a2pre) Gecko/2008080103 Minefield/3.1a2pre ID:2008080103

12:59 AM  
Blogger Chris Double said...

pavlos, yes this is a known bug. See bug 448534. A patch has been completed and will hopefully be committed to trunk soon. It'll then appear in new nightly builds.

1:01 AM  
OpenID singpolyma said...

RE HTML5 being awesome: how can a spec that introduces elements into a document markup language that are not data, that supports SGML-style producers, that fragments the HTML family further by introducing Yet Another Fork, and that fails to properly build on its own history (ie, this example of using <video> instead of <object> with a video mime-type.

On whether this should be in-browser or not, that may be up in the air. My argument was more about the combination of things being done here (HTML5 and a full codec set in an already bloated browser).

RE images as plugins - some browsers do that, many more have the option if you compile them to. It works quite nicely.

1:40 AM  
Blogger Sveinung said...

Thank you for having open codecs that everyone can use by default. This will hopefully make it possible to have a standard codec for the web even if the HTML 5 spec don't specify one.

3:30 AM  
Blogger cybernytrix said...

Why can't you guys simply get rid of the extra bloat OGG decoder? Isn't it possible to simply ship the platform default (gst/QT/DS) and include a free decoder (for example ogg.ax for windows DS). This way you can make DS load ogg.ax if no decoder exists.
Also, your video mixing is from the 70s and it sux. Ever tried playing a 720p video in fullscreen?

3:49 AM  
Blogger maikmerten said...

User installations of QuickTime, GStreamer and DirectShow (especially DirectShow) are often messed up. Users apparently love to install every "codec pack" they can find, with often horrible, unspeakable results. It's just not really reliable, and Mozilla can't change that. Including something one can actually support at least guarantees a basic featureset is present (and working).

6:53 AM  
Blogger jamiegau said...

Theora support in the browser does bring up some interesting issues.

The move by Apple to attempt to obtain a resonable slice of the web video market a Quicktime X appears to be.
Apple, behind closd doors, is likely to want to play this down.

See my blog post n the matter at
http://www.crafted.com.au/blog/2008/08/03/a-fly-in-steves-soup-apples-path-to-online-video/

James

12:13 AM  
Blogger Peter Stuifzand said...

I'm glad Firefox will get the video and audio tag. I think it's a good thing that browsers, will do all things that normally would be done with a plugin. I see it as one step closer to a world without Flash.

8:20 AM  
Blogger bawjaws said...

Is there somewhere I can find info about the ability to interface with audio and video tags via extensions?

I'm imagining some greasemonkey/userscript style enhancements for digital media e.g.

* showing a page of stills to allow you to jump to a specific segment of a a video
* collaborative subtitling (both for the deaf/busy/searchbots and for language translations)
* speeding up audio or video without changing the pitch so that you can get the same amount of into in half the time.

I generally find that I use Firefox over other nice browsers like Safari or Opera because of the add-on ecosystem. I would imagine it would also help the video tag beat flash and silverlight.

9:17 AM  
Blogger jmdesp said...

Chris, I really can't get the video to work under XP and don't understand why, because it works with Seamonkey on the same platform.

Now, what's more, I tried to get some logs with :
set NSPR_LOG_FILE=c:\ogg.log
set NSPR_LOG_MODULES=nsVideoDecoder:5,nsAudioStream:5

and I only get an empty file, even with Seamonkey where the video display correctly.
I don't understand and I believe I'll give up trying for now.

2:35 AM  
Blogger omattos said...

Is the video GUI the one that you intend to ship?

If it is, I'd like to point out that it's missing a few features I feel are vital:
A load progress indicator
A video duration indicator
A video playback position indicator
A UI to enable video seeking
A UI to enable volume changes
(optional) A UI to enter fullscreen.
A UI to open the video content in an external player.

When the WHATWG standard is fully implemented, I guess these will be relatively easy to implement, but I wouldn't want the Mozila team rushing this out of the door without them.

Since I've spotted the GUI is simple SVG and Javascript, it might even be an idea to ask for submissions of proposal GUI's from the public - could save you a good amount of work :-)

6:29 AM  
Blogger Chris Double said...

See bug 448909 for mockups of the controls that people are working on. Feel free to comment on that bug with your ideas.

11:33 AM  
Blogger funTomas said...

Chris, has the decision to go with Theora been closed yet? What about considering VP8. On2 claims it's royalty free. Way to go?

6:03 AM  
Blogger SBL said...

This post has been removed by a blog administrator.

8:25 PM  

Post a Comment

<< Home