Total Pageviews

Tuesday 12 May 2020

Free-HLS是一个免费的 HLS 视频解决方案,即所谓的视频床

一个自由的 HLS 解决方案 
本项目提供一整套集成化解决方案,囊括了各环节所需的切片、转码、上传、即时分享等套件。让你可以以更方便、更低廉的方式分享你的视频到任意地方。
本项目仅供学习交流使用,在使用过程中对你或他人造成的任何损失我们概不负责。
新版本布告:当前版本在不久后的将来将停止维护,如果你是新用户,请直接使用更加强大和稳定的 next 分支下一代 版本,如果你是老用户届时我们会释出迁移脚本。

客户端

客户端,即 up.py 入口,提供对上传视频资源的切片、转码、上传的支持。可以在你的任意机器上使用,只要你安装了必要的依赖项和作出了正确的配置。

1. 安装依赖

安装最新的 Python3,以及必要包:
apt install -y ffmpeg python3 python3-pip
pip3 install requests python-dotenv

2. 配置服务

正确施行 服务端 一节的全部内容,完成服务端的搭建。将你服务器的域名或 IP 地址修改到 .env 中的 APIURL 配置项。

3. 开始使用

准备好目标视频文件,输入如下指令开始切片、上传:
python3 up.py test.mp4               #默认标题
python3 up.py test.mp4 测试哦         #自定义标题
python3 up.py test.mp4 test 5        #自定义分段大小
python3 up.py test.mp4 test LIMITED  #限制码率(需重编码)

python3 ls.py    #列出已上传视频
python3 ls.py 3  #列出已上传视频(第3页,50每页)

服务端

服务端位于项目的 web 目录,负责向客户端提供视频发布所必要的 API 接口。以及最终目标视频的播放服务。

1. 安装依赖

安装最新的 Python3,以及必要包:
apt install -y python3 python3-pip
pip3 install Flask gunicorn python-dotenv

2. 启动服务

cd web
gunicorn app:app -b 0.0.0.0:3395 --workers=5 --threads=2 -D

相似服务


from https://github.com/sxyazi/free-hls
----

A hls.js plugin to offload bandwidth from expensive traditional CDNs,while also maximizing a user’s viewing experience. 

English | 简体中文

cdnbye logo

Boost Your Stream using WebRTC.

npm jsdelivr size
CDNBye hlsjs-p2p-engine implements WebRTC datachannel to scale live/vod video streaming by peer-to-peer network using bittorrent-like protocol. The forming peer network can be layed over other CDNs or on top of the origin server. Powered by hls.js, it can play HLS on any platform with many popular HTML5 players such as video.js, JWPlayer and Flowplayer. BTW, you can view how much traffic has been saved here!

Features

  • WebRTC data channels for lightweight peer-to-peer communication with no plugins
  • Support live and VOD streams over HLS protocol(m3u8)
  • Support encrypted HLS stream
  • Very easy to integrate with an existing hls.js project
  • Seamlessly fallback to normal server usage if a browser doesn't support WebRTC
  • Highly configurable for users
  • Support most popular HTML5 players such as video.js、Clappr、Flowplayer
  • Efficient scheduling policies to enhance the performance of P2P streaming
  • Use IP database to group up peers by ISP and regions
  • API frozen, new releases will not break your code

Playground

Getting Started

Quick Start Demo

Put the quick-start.html in your web page, run it. Wait for a few seconds,then open the same page from another browser. Now you have a direct P2P connection between two browsers without plugin! The first web peer will serve as a seed, if no one else in the same channel.

Integrate to Your Hls.js Project

Simply replace the hls.js script tag like:
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
with
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest"></script>
That's it!

Integrate to HTML5 Players

See demos.

Browser Support

WebRTC has already been incorporated into the HTML5 standard and it is broadly deployed in modern browsers. The compatibility of CDNBye depends on the browser support of WebRTC and Hls.js. Please note that iOS Safari "Mobile" does not support the MediaSource API.
CompatibilityChromeFirefoxmacOS SafariAndroid Wechat/QQOperaEdgeIEiOS Safari
WebRTC Datachannel
Hls.js
CDNBye

Include

Include the pre-built script of latest version bundled with hls.js(recommended):
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest"></script>
Or include the latest version without hls.js:
<script src="https://cdn.jsdelivr.net/npm/cdnbye@latest/dist/hlsjs-p2p-engine.min.js"></script>

Usage

See Usage

Player Integration

Support almost all web players, click here for more information.
  • Add your customized player here
    • CDNBye can be integrated into any HTML5 video player that with hls.js built in.

API and Configuration

See API.md

Console

Bind your domain in https://oms.cdnbye.com, where you can view p2p-related information.

Related Projects

FAQ

We have collected some frequently asked questions. Before reporting an issue, please search if the FAQ has the answer to your problem.

Contact Us


------
 
https://github.com/TheApeMachine/sockstream
 

No comments:

Post a Comment