Latest build of webm.js is available here. NOTE: built-in video player uses software decoding in order to play any video it can encode and thus experimental and slow.
- Firefox: fast enough to encode several minutes of SD/HD video within half of hour
- Chrome: a bit slower than FF but still good
- Edge: a bit slower than FF but still good (make sure to enable asm.js in
- IE11: several times slower than Edge and will fail on big files but otherwise works
Is it fast?
To get you some concrete numbers: it takes ~5m25s to encode sample clip (860x484, 1m9s) with default settings (2pass,
-threads 4 -c:v libvpx -b:v 885k -speed 1 -auto-alt-ref 1 -lag-in-frames 25 -c:a libopus -b:a 64k) at i7 3820. Same encode with native FFmpeg/libvpx takes ~40s. Hopefully we will improve that performance with WebAssembly and SIMD.js, stay tuned!
What about quality?
Trying to compensate the use of outdated codec, two-pass encoding with
lag-in-frames=25 is used. Splitting video in parts creates additional keyframes and therefore loses effeciency a bit, but the difference should be negligible for the
g=128 currently used. It is also possible to specify
quality=best and other FFmpeg/libvpx options if you're trying to achieve the maximal quality.
How to start hacking?
Build your own version of webm.js is as simple as clone the repo and run
npm i && npm run release
inside. Host the
dist directory with your favourite HTTP server or use
npm start to start the development server at 8080 port.
I want to use it locally and don't have node.js
No problem! Just download webm.js-gh-pages.zip, unpack it and open
index.html with Firefox. Everything should work right away. Other browsers will require local HTTP server, run
python -mSimpleHTTPServer in unpacked directory if in doubt.
It's also perfectly possible to build browser extension, user script or even embed WebM encoder into your site. I haven't done anything in that direction yet, but let me know if you're interested.
webm.js own code, documentation, favicon and logo licensed under CC0, but the resulting build also includes the following libraries and assets:
- FFmpeg port ffmpeg.js (LGPL-2.1+ and few libraries under BSD, see full license text)
- Remaining libraries in
dependenciessection of package.json (BSD-like)
- Roboto font by Christian Robertson (Apache License 2.0)
- Liberation Sans font (SIL Open Font License 1.1)
- Sample video is part of Elephants Dream movie ((c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org)
- GitHub Ribbon (MIT)
Written in 2015 by Kagami Hiiragi firstname.lastname@example.org
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.