Jessibuca是一款开源的纯H5直播流播放器,通过Emscripten将音视频解码库编译成Js(ams.js/wasm)运行于浏览器之中。兼容几乎所有浏览器,可以运行在PC、手机、微信中,无需额外安装插件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
李宇翔 65ac8f0e97 ffmpeg的编译脚本 4 years ago
.vuepress 音频连续播放 4 years ago
CppTest Jessibuca 6 years ago
obj 新增了h265的解码选项 5 years ago
others/offscreen_canvas_demo add others demo 4 years ago
thirdparty ffmpeg的编译脚本 4 years ago
.gitignore yarn run build 4 years ago
AudioDecoder.h 新增了h265的解码选项 5 years ago
Jessibuca.cpp update 4 years ago
Jessibuca.js 音频连续播放 4 years ago
LICENSE 新增了h265的解码选项 5 years ago
README.md update 4 years ago
VideoDecoder.h update 4 years ago
api.md add rotate 4 years ago
base.h 新增了h265的解码选项 5 years ago
broadway.h Jessibuca 6 years ago
cocos.js 修改成jessibuca 6 years ago
cocosCom.js 加入cocos支持 6 years ago
debug.log 更新 8 years ago
ffmpeg.h 过滤ffmpeg输出的数据 4 years ago
flash.html 优化ff解码 6 years ago
libde265.h 增加可以反复重置解码头 6 years ago
libfaac.h 新增了h265的解码选项 5 years ago
libhevc.h 使用compostionTime延迟播放For B 帧 6 years ago
make.py 增加离屏渲染功能 4 years ago
mp3Decoder.h 新增了h265的解码选项 5 years ago
mse.go 定制化 7 years ago
player.md remove files 4 years ago
settings.js 加入cocos支持 6 years ago
slice.h 修改成jessibuca 6 years ago
speex.h 新增了h265的解码选项 5 years ago

README.md

home heroImage heroText tagline actionText actionLink sidebarDepth sidebar features footer
true /logo.png Jessibuca 纯H5直播流播放器 打开播放器 /player.md 2 auto {title 无插件} {details 基于ASM.js/WebAssembly(wasm)实现的纯JavaScript直播播放器}] [{title 低延时} {details 能够在 PC\Android\iOS 浏览器Webview 内实现2秒以内低延迟直播播放}] [{title 支持H265} {details 软解码H.264/H.265+AAC/MP3/Speex流,WebGL视频渲染,WebAudio音频播放。} GPL Licensed | Copyright © 2020-present dexter

简介

Jessibuca是一款开源的纯H5直播流播放器,通过Emscripten将音视频解码库编译成Js(ams.js/wasm)运行于浏览器之中。兼容几乎所有浏览器,可以运行在PC、手机、微信中,无需额外安装插件。

功能

  • 支持解码H.264视频(Baseline, Main, High Profile全支持,支持解码B帧视频)
  • 支持解码H.265视频(flv id == 12)
  • 支持解码AAC音频(LC,HE,HEv2 Profile全支持)
  • 支持解码MP3音频以及Speex音频格式
  • 可设置播放缓冲区时长,可设置0缓冲极限低延迟(网络抖动会造成卡顿现象)
  • 支持智能不花屏丢帧,长时间播放绝不累积延迟。
  • 可创建多个播放实例
  • 程序精简,经CDN加速,GZIP压缩(实际下载500k),加载速度更快
  • 同时支持http-flv和websocket-flv协议以及websocket-raw私有协议(裸数据,传输量更小,需要搭配Monibuca服务器) 注:以http-flv请求时,存在跨域请求的问题,需要设置access-control-allow-origin, websocket-flv默认不存在此问题
  • 支持HTTPS/WSS加密视频传输,保证视频内容传输安全
  • 手机浏览器内打开视频不会变成全屏播放

使用方法

自动播放http-flv格式

<div id="container" style="width:800px;height:600px"></div>
<script src="./renderer.js"></script>
<script>
  var container = document.getElementById("container");
  var jessibuca = new Jessibuca({ container, decoder: "ff.js" ,videoBuffer:0.2});
  jessibuca.onLoad = function () {
      this.play("http://localhost/live/user1.flv")
  }
</script>

程序控制播放websocket-raw格式

<div id="container" style="width:800px;height:600px"></div>
<script src="./renderer.js"></script>
<button onclick="play">播放</button>
<script>
  var container = document.getElementById("container");
  var jessibuca = new Jessibuca({ container, decoder: "ff.js" ,videoBuffer:0.2});
  function play(){
    jessibuca.play("ws://localhost/live/user1")
  }
</script>

API

API

源码目录结构

  • obj 存放emscripten编译好的各种解码库的字节码库
  • public 存放编译输出的js和wasm文件以及renderer.js
  • thirdparty 各种第三方解码库的代码(已修改)和编译脚本

编译

编译命令是python make.py 加上参数构成

参数包括

  • -v 视频解码库,有效值为ff(ffmpeg)、libhevc、libde265 如果不传参数代表使用avc库(只支持h264 的baseline)
  • -a 音频解码库,有效值为mp3、speex、aac,如果不传参数则无音频解码(ffmpeg自带aac解码)
  • --wasm 表示编译成WebAssembly格式
  • -o 代表输出文件路径,默认值是public/Jessibuca.js

示例: ffmpeg(h264-aac)

python make.py -v ff -o .vuepress/public/ff.js

avc-mp3组合

python make.py -a mp3 -o .vuepress/public/avc_mp3.js

libhevc-aac组合

python make.py -v libhevc -a aac -o .vuepress/public/h265_aac.js

基本原理