Route9.js: VP8 in Javascript

851 views
Skip to first unread message

Benjamin Schwartz

unread,
Nov 30, 2011, 12:10:26 AM11/30/11
to codec...@webmproject.org
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 weeks digging into Broadway.js, stripping out
the H.264 bits and replacing them with libvpx and libnestegg. Now
it's working, to a degree. See for yourself:

http://people.xiph.org/~bens/route9/route9.html

My personal goal with this project was to get more familiar with VP8
and libvpx ... although I ended up learning more about emscripten and
libnestegg, since that's where the problems were. (libnestegg makes
extensive use of 64-bit ints, which are not yet very well supported by
Emscripten because Javascript does not offer a corresponding type.)

I know of one major bug in this release: there is a serious
correctness issue with motion compensation, possibly in motion vector
decoding. The problem is especially clear in "Sign Irene", and also
near the end of the BBB trailer. I expect this represents a bug in
Emscripten. However, now that playback is mostly working, squashing
it should be a "simple matter of debugging".

There is also at least one major missing feature as compared to
Broadway.js: seeking is unimplemented (although it should be
straightforward to add).

I hate to release a project with these two issues unresolved, but I am
a very busy with my dissertation and truly cannot afford to spend any
more time on this project right now. If you're interested in messing
with this code, please fork from https://github.com/bemasc/Broadway
and dive right in.

Future directions:
1. Emscripten tuning. There are a lot of Emscripten parameters (like
QUANTUM_SIZE and LLVM_OPTS) that could make the code go faster, but I
haven't attempted to use them.
2. Javascript inner loops. Emscripten preserves the function-call
structure from C, so it's totally plausible to rewrite libvpx
incrementally, starting with the functions where hand-written code can
make the biggest impact. (Sort of like arch-specific assembly.)
3. Vorbis (and "Web Audio")
4. Build system improvements. Right now the build system is even
hackier than upstream's (although it is documented in vp8/README).
5. [Your idea here]

Acknowledgements:
1. The impressive work is in Emscripten, Broadway.js, libvpx, and
libnestegg. Putting them together is the least of it.
2. Special thanks to Alon Zakai for helping to diagnose and squash a
series of blocker Emscripten bugs. Make sure you have git HEAD
Emscripten if you're trying to build Route9!
3. Thanks to Paul Tagliamonte, Michael Stone, and Chris and Madeleine
Ball, for helping with coffeescript, clang, and time management.

--Ben Schwartz

Michael Dale

unread,
Dec 2, 2011, 12:40:53 AM12/2/11
to Codec Developers
cool!

On Nov 29, 9:10 pm, Benjamin Schwartz <benjamin.m.schwa...@gmail.com>
wrote:

> with this code, please fork fromhttps://github.com/bemasc/Broadway

philipp...@gmail.com

unread,
Nov 17, 2013, 5:38:09 PM11/17/13
to codec...@webmproject.org
The demo is not working anymore.

Maybe this issue is related to this topic: https://groups.google.com/forum/#!topic/webgl-dev-list/sJOoNNFY8vo

Benjamin Schwartz

unread,
Nov 18, 2013, 1:45:25 PM11/18/13
to codec...@webmproject.org
That seems like a likely diagnosis.  Route9.js was meant mostly as a one-shot tech demo, but the code is up on github if anyone's inspired to fix it.  I might fix it myself if I find some free time, but that probably won't be for another month at least.


--
You received this message because you are subscribed to the Google Groups "Codec Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codec-devel...@webmproject.org.

To post to this group, send email to codec...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/codec-devel/.
For more options, visit https://groups.google.com/a/webmproject.org/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages