Giter VIP home page Giter VIP logo

ffmpeg-h264-dec's Introduction

ffmpeg-h264-dec

Build Status

H.264 decoder extracted from FFmpeg

Extraction

Files related to H.264 decoding are extracted from FFmpeg and put in the folder ./ffmpeg-src.

The checkout commit is 2f76157eb05bf63725f96167feda6b2e07501c7e.

Some files may be modified (a little).

Build the decoder

Run make, and you will get the executable h264dec.

Compile into JavaScript

With the tool Emscripten, the C code can also be compiled into JavaScript:

  • Run emmake make h264dec.html to get h264dec.html (and its supporting files), which can be open in a browser when served using a web server (e.g., with python3 -m http.server). Note that since we can not pass arguments to HTML pages, you should modify main.c (see the commented line in the main function) to let the program starts decoding without arguments.

  • Run emmake make h264dec.node.js to get h264dec.node.js, which can be executed by Node.js: node h264dec.node.js.

(emmake comes with Emscripten; make clean is usually needed before building for another platform.)

Use in JavaScript player

In the folder ./javascript, run emmake make to build Decoder.js, which is used in a JavaScript TS file player demo: https://github.com/shengbinmeng/javascript-ts-player.

Future work

  1. Compare performance with Broadway's that is based on Android's software H.264 decoder. No big difference maybe, but the latter only supports baseline profile.

  2. Optimize JavaScript code generation, e.g., investigate Emscripten flags, use SIMD.

  3. Remove unused code. Current extraction is file based. A lot of code in some files are not used by H.264 decoding. However, changing file content will make it harder to sync with FFmpeg version update.

  4. Abstract a better interface and implement a better demo player.

ffmpeg-h264-dec's People

Contributors

shengbinmeng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.