Giter Site home page Giter Site logo

ffmpeg-h264-decoder-wasm's Introduction

FFmpeg C Lib封装的前端WebAssembly(Wasm)库

项目描述

本项目是一个使用FFmpeg C Lib库封装的前端WebAssembly库,旨在为前端开发者提供H.264解码功能。通过使用FFmpeg C Lib,可以在Web浏览器环境中实现对H.264视频流的解码操作,以便在前端应用程序中进行视频处理和播放。

功能特性

  • 提供H.264视频解码功能
  • 可在前端Web浏览器中使用
  • 基于FFmpeg C Lib实现,具有强大的解码能力和广泛的格式支持

安装和使用

以下是安装和使用该库的基本步骤:

git clone https://github.com/Fruneng/ffmpeg-h264-decoder-wasm.git
cd ffmpeg-h264-decoder-wasm
make
// Create the decoder and canvas
var decoder = new Worker('h264_worker.js');

var display = new Canvas(canvas, {'fullRangeColor': true});

console.log('Created decoder and canvas');

decoder.addEventListener('error', function(e) {
    console.log('Decoder error', e);
})

decoder.addEventListener('message', function(e) {
    var message = e.data;
    if (!message.hasOwnProperty('type')) return;

    switch(message.type) {
    case 'pictureReady':
        display.drawNextOutputPicture(
            message.width,
            message.height,
            message.croppingParams,
            new Uint8Array(message.data));
        ++pictureCount;
        break;
    case 'decoderReady':
        console.log('Decoder ready');
        break;
    }
});
decoder.postMessage({
    'type' : 'input', 
    'data' : copy.buffer, 
}, [copy.buffer]);

example

  1. 运行脚本
bash run_example.sh
  1. 浏览器打开 http://localhost:8080/test.html

  2. 选择项目下dump文件 即可播放

贡献和支持

欢迎对该项目进行贡献!如果你发现了问题或有改进建议,请在GitHub上提交issue或提出pull请求。

如果你对项目有任何疑问或需要支持,请联系我们或访问项目的GitHub页面。

许可证

该项目基于 MIT许可证,请查阅许可证文件获取更多信息。

鸣谢

感谢FFmpeg团队为我们提供强大的多媒体处理能力。此项目受益于FFmpeg C Lib的贡献和开源社区的支持。

参考项目

https://github.com/xiangxud/webrtc_H265player

https://github.com/ffmpegwasm/libav.wasm

https://github.com/oneam/h264bsd

ffmpeg-h264-decoder-wasm's People

Contributors

fruneng avatar cchu1988 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

cigarliu

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.