Patch for Video element support in Firefox
I've uploaded a patch which is the first pass at implementing support for the <video> element in Firefox. The patch is attached to bug 382267.
There are quite a few known issues with the patch at the moment, and I'm working through them, but I've made it available at this time so others can at least try it out. A page with some example usage is here: http://www.double.co.nz/video_test.
To build you'll need the latest Firefox CVS, and apply the following:
Categories: firefox, ogg
There are quite a few known issues with the patch at the moment, and I'm working through them, but I've made it available at this time so others can at least try it out. A page with some example usage is here: http://www.double.co.nz/video_test.
To build you'll need the latest Firefox CVS, and apply the following:
- Third party modules patch (Ogg, Vorbis, Theora, Portaudio, etc)
- Patch from Bug 382267
git clone http://double.co.nz/git/video.gitThe main issues at the moment are problems with optimized builds, so I suggest trying it out with a debug build. I'm also not using channels correctly for multithreaded code which is the cause for a bit of instability. Read the bug for further details.
git clone git://double.co.nz/git/video.git
Categories: firefox, ogg
Labels: mozilla

17 Comments:
Do you have a recent build for the intel mac laying around ? (In case not, I started already to clone your git repo)
I do but I've just left for home, and fly to Wellington tonight. I can upload it then (about 5 hours from now). I'll also upload a windows build.
Why do you use portaudio?
That's a bad solution on Linux at the moment AFAIK since its ALSA supports is not really complete yet.
There was a thread on mozilla.dev.platform about audio library choice. I think it's also discussed under the bug for the audio element.
Basically it came down to openal or portaudio, and the latter had a more compatible license.
I'm open to suggestions for alternatives though if you know of something more suitable.
Are you using liboggplay as a library? http://svn.annodex.net/liboggplay/trunk/README
ginger, I use liboggplay in the implementation, yes. It's a great library. Much easier to use than the vorbis and theora API's directly.
Cool stuff. Once a build shows up I'll have a lot of fun toying around with it, that's for sure.
I've added a download for a Mac OS X Intel build.
played with the build. great !!
I hope you will bring down CPU usage so it works on slow machines.
I also hope you will implement seek (if possible at all) based on HTTP content range. In flash video, this is only possible with a lot of serverside trickery.
And again, this is great, I hope it goes into FF3.
Well, the Theora decoder used seems to stem from one of the official Theora alpha releases, which features a rather slow and incomplete decoder. Current Theora SVN has a decoder that is a) implementing the complete spec and b) is faster on high resolution content.
We really should put up a new release with the new decoder included.
roberto, glad it worked for you! I've done no work yet on optimisation so things will improve on the CPU usage I'm sure.
Also, as maikmerten mentioned, I'm using the alpha source release of theora. It has no optimised assembly implementation for Mac OS X. It sound s like the SVN version is much improved.
maikmerten, I'd love a new source release! I was going to work off SVN but there was some concern from one of the oggplay people in that they weren't sure it worked on some platforms with their code. I'm keen to try the newer codebase though.
roberto, oops, missed the seek question. Yes, I plan to add seek support. liboggplay supports seeking as long as the implementations of their 'reader' abstraction implements some functions.
I'm not using their tcp reader implementation, instead implementing a reader for Mozilla's networking API's so I need to do a bit of work there but it's on the list of things to do.
I'm trying to compile for Linux off of your git repo, and I'm getting stuck on the build with undefined references in
mozilla/content/media/modules/portaudio/src/hostapi/alsa/pa_linux_alsa.c
for example for snd_pcm_info() snd_pcm_info_get_card(). How do I include the alsa or other libs for a successful make?
If you are doing a libxul enabled build (which is the default), there was an issue where I was missing libraries. I pushed a patch to the git repository last night which fixed that.
Otherwise, a workaround is to put the following in your .mozconfig:
ac_add_options --disable-libxul
Let me know if either of these two suggestions work.
Pulling your update on git worked fine.
All of the tests work except for the first (test1,play1) which reports in the shell repeatedly:
"Buffer is larger than read request: request: 8192 buffer: 291808"
and clicking 'Pause 1' it freezes firefox.
test2.html doesn't seem to open. However, after removing the '<video>' text from the title, and opening it locally, it worked fine.
I didn't express before how important this work is. Many many thanks from those that work extensively with video on the web, and would like more open options than, e.g. flash.
Please keep us updated on how we can help testing, etc.
Thanks schuyler. What platform did you run it on?
I've pushed an update yesterday that changes the way I was doing buffering and using channels. In my tests it now is more stable so hopefully you should be able to run the tests that didn't work before.
The main machine i'm testing is Linux x86_64 (Mac Pro hardware).
Test1.1 plays now, but plays very slowly (actually, they all do). Pausing Test1.1 still crashes firefox. This is the output from playing test1.1 and then clicking pause:
--------------------
Got vorbis info: version 0 channels 2 rate 44100
There are 2 tracks
Frame rate: 29.970030
samplerate: 44100, channels: 2
About to start decoding...
Starting decoding
###!!! ASSERTION: nsGenericElement not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file /home/sky/sb/firefox/video/mozilla/content/base/src/nsGenericElement.cpp, line 3376
Frame Needs Reflow!
nsHTMLVideoFrame::ComputeSize
ChannelToPipeListener::OnStopRequest
WARNING: Write failed (non-fatal): file /home/sky/sb/firefox/video/mozilla/xpcom/io/nsInputStreamTee.cpp, line 84
Presentation thread completed
Decoding loop completed.
------------------
Here's my build for x86_64.
Post a Comment
<< Home