Skip to content

archicz/mpeg4dec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPEG4Dec (libavutil meets WebAssembly)

This is a project which aims to implement a H.264 + AAC decoder for use in Javascript for environments which do not have such decoders built-in (looking at you Facepunch).

Why?

This hopefully will add support for playing the most common videos you can stumble upon on the Internet in a game called Garry's Mod. Garry's Mod has now for almost 10 years had a experimental branch which has CEF (Chrome Embedded Framework) web engine for interaction between the game and the web. Facepunch decided to compile without proprietary codec support.

How?

I stumbled upon some solutions using Broadway.js or others, but never saw anything with the added audio support and a proper class bindings. So MPEG4Dec was born.

Information for developers

Look into bindings.cpp for the actual bindings, I am not fluent with Javascript, the only thing I knew how to do is compile FFmpeg and expose the decoders via a C++ class, the rest was just trial and error.

How to build

  • Download FFmpeg and extract it to this folder (where the README is located).
  • Run ./ffmpeg_script.sh, this will compile FFmpeg as a static library with only the required components (saving file size)
  • Setup Emscripten SDK (so that emcmake and emmake exist)
  • Run ./build.sh, this will build the final mpeg4dec.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published