Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A JavaScript H.264 decoder.
branch: master

Merge pull request #41 from saste/master

update to latest emscripten
latest commit 22583c5eba
Michael Bebenita authored
Failed to load latest commit information.
Decoder update to latest emscripten
Player update to latest emscripten
AUTHORS Merge pull request #4 from p01/master
LICENSE Licensing
README.markdown Update README.markdown



A JavaScript H.264 decoder.

View a Live Demo at: or

Thanks for hosting the demos.

The video player first needs to download the entire video before it can start playing, thus appearing to be a bit slow at first, so have patience. You can start the video by clicking on each player. The top left player runs on the main thread, the remaining players run in background worker threads.

The demo is Android's H.264 decoder compiled with Emscripten to JavaScript, then further optimized with Google's JavaScript closure compiler and further optimized by hand to use WebGL.

Building the demo:

Install and configure Emscripten (

The code for the demo is in the Decoder folder, to build it run the python script.

Encoding Video

The decoder expects an .mp4 file and does not support weighted prediction for P-frames and CABAC entropy encoding. To create such bitstreams use ffmpeg and x264 with the following command line options:

ffmpeg -y -i sourceFile -r 30000/1001 -b:a 2M -bt 4M -vcodec libx264 -pass 1 -coder 0 -bf 0 -flags -loop -wpredp 0 -an targetFile.mp4

Something went wrong with that request. Please try again.