Git Product home page Git Product logo

prism's Introduction

Prism - H.264 decoder in pure javascript

Logo by Jiangnan Zhuang

Prism is a H.264 decoder written in javascript(ES5), which is used in browser to decode H.264 stream data into RGBA/YCbCr format frames.

Prism can run in browsers support javascript ES5 or higher standard, and support H.264 realtime decoding profile which contains I/P frames.

Prism is a project of CloudwareHub, aiming at providing cross platform video stream decoder.


Build

Prism depends on Node.js, npm, gruntjs. Execute commands below to build prism, and the built file prism.min.js should be generated in build/ folder.

$ npm install
$ bower install
$ grunt

Usage

Prism uses requirejs/almod to package, and export window.prism if not in AMD context. The typical usage of prism should work with websocket, just read raw H.264 nal data from server via websocket and feed into prism, then prism will decode every frame into RGBA/YCbCr format pictures. Sample code is as follows:

ws.onmessage = function(msg) {
  prism.decodeNal(msg);
  console.log(prism.SL) // decoded frame luma in xy format
  console.log(prism.SCb, prism.SCr) //decoded frame chroma cb/cr in xy format
}

The demo of prism is available at CloudwareHub.

License

BSD-2-Clause

Resources

H.264 standard

prism's People

Contributors

guodong avatar

Watchers

James Cloos avatar tygk 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.