I was really impressed by Michael Bebenita’s Broadway.js, the recent port of an H.264 decoder to pure Javascript using Emscripten, a LLVM-based C-to-JS converter … but of course this is the opposite of what we want! Who needs H.264? We want WebM!

I’ve spent the past few weekends digging into Broadway.js, stripping out the H.264 bits and replacing them with libvpx and libnestegg. Now it’s working, to a degree. You can see it for yourself at the demo page (so far tested only in Firefox 7…).

I’m not going to be able to take this much further … at least not right now. It’s been a fun exercise though. I invite all interested comers to read some more details and then fork the repo.

Take this thing, and make it your own.

Reactions: Hacker News, r/programming, and BadassJS, Twitter.

7 Replies to “Route9.js”

  1. This is very impressive! It works fine in Chrome 15, and is roughly three times faster than Firefox 8 on this Core i5 notebook (~61 fps on average!). It would be interesting to see if this works in Internet Explorer 9 (that would be one obvious target).

    Too bad current browsers don’t seem to have a proper audio API to also get the audio portion working (it *is* possible to produce PCM data in JavaScript and play that back using data URLs, but that means everything has to be decoded beforehand).

  2. Hi Maik. Thanks for testing! Actually, Firefox does have a proper audio API, and soon the WebKit browsers should too … which is going to make this a whole lot more interesting.

  3. @Ben: Actually, Chrome has had an audio API for quite some time now 🙂 For now, I’d recommend using a library such as sink.js to support both Firefox’s Audio Data API, and Chrome’s Web Audio API.

    The situation is a bit hairy at the moment, if you want to learn more about it you can read Mark Boas’s excellent article about it.

    Cheers and congrats from the ofmlabs team for pulling off VP8 🙂 Quite nice!

  4. Hi Ben, yeah, the APIs of Firefox and WebKit browsers look promising, but sadly the very interesting use case of decoding free audio codecs in JavaScript will not work in Internet Explorer due to the lack of such an audio API.

    If mobile Safari browsers will support an audio API this will be awesome, though: Free audio codecs sneaking into a walled garden.

  5. Thanks for the tip, Amos! Of course, when I say “the WebKit browsers”, I’m mostly thinking of the ones that don’t yet have WebM decoding built in…

    1. I did try the demo in IE10 and it’s running at a reasonable frame rate about 40fps with the canvas renderer (IE10 doesn’t support WebGL).

Leave a Reply

Your email address will not be published.