Coder Social home page Coder Social logo

byteman / h5live Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 6.0 20.14 MB

h5 live stream server

C++ 78.90% C 16.96% QMake 0.11% Objective-C 0.12% CSS 0.04% HTML 0.19% JavaScript 3.52% Java 0.15% Makefile 0.02% Batchfile 0.01%
flv html5-video flv-websocket websocket live h264 html5-player

h5live's Introduction

h5live的设计目标

  • 一个轻量级可嵌入式的C++流媒体服务器
  • 一个支持各种浏览器的实时视频流播放器
  • 服务器以库的形式提供
  • 主要用于视频预览,对长时间稳定连接无特别需求
  • 局域网内延迟时间控制在500ms以内
  • 跨平台支持(linux,windows,android,ios).

h5live不支持什么

  • h5live不支持视频采集,仅支持YUV或者RGB输入,由流媒体内部编码(针对没有自己编码器的应用),或者直接输入编码后的h264码流(针对有自己编码器的应用)

h5live技术方案

  • 1.后台服务器提供一个websocket服务器,将h264视频mux为flv流,流推送给H5播放器,H5播放器(flv.js)可以直接播放flv流
  • 2.后台服务器提供一个websocket服务器,将h264视频流推送给H5播放器,H5播放器(flv.js)封装264为mp4,进行播放,需要修改flv.js源码
  • 3.先采用方案1.

整体架构

h5整体架构 h5live内部实现

服务端编译说明

为了实现跨平台的编译服务端代码,工程采用qmake来构建

windows

  • 需要安装qt5.5+vs2012

linux

android

h5live提供了一个android jni的库和对应的java接口类,可以直接用于android嵌入式设备嵌入一个流媒体服务器.

编译步骤

jni编译步骤

编译前需要先安装ndk
cd jni
./build.bat

android demo的工程

demo工程在android/h5live_as目录下

目前存在的问题

ie浏览器从连接到视频首开需要2-3秒

firefox浏览器连接成功后,需要点击播放才能播放视频

解决方案: tab被激活或者页面载入后调用flv_start函数

有些版本的chrome浏览器在切换tab,或者切换窗口焦点后,视频会卡住不解码播放,但是视频数据还是在接收

解决方案: player.currentTime = player.buffered.end(0)-0.01; 把当前时间设置为buffer数据中最后的时间附近,定时更新时间到最后

chrome61.0.3159.5不存在

h5live's People

Contributors

byteman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.