一个自由的 HLS 解决方案 https://github.com/sxyazi/free-hls/wiki
本项目提供一整套集成化解决方案,囊括了各环节所需的切片、转码、上传、即时分享等套件。让你可以以更方便、更低廉的方式分享你的视频到任意地方。
本项目仅供学习交流使用,在使用过程中对你或他人造成的任何损失我们概不负责。
新版本布告:当前版本在不久后的将来将停止维护,如果你是新用户,请直接使用更加强大和稳定的 next 分支下一代 版本,如果你是老用户届时我们会释出迁移脚本。
客户端
客户端,即
up.py
入口,提供对上传视频资源的切片、转码、上传的支持。可以在你的任意机器上使用,只要你安装了必要的依赖项和作出了正确的配置。1. 安装依赖
安装最新的 Python3,以及必要包:
apt install -y ffmpeg python3 python3-pip
pip3 install requests python-dotenv
2. 配置服务
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
相似服务
- https://github.com/sxzz/free-hls.js
- https://github.com/sxzz/free-hls-live
- https://github.com/MoeClub/Note/tree/master/ffmpeg
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. https://p2p.cdnbye.com/en/
----
A hls.js plugin to offload bandwidth from expensive traditional CDNs,while also maximizing a user’s viewing experience. https://p2p.cdnbye.com/en/
English | 简体中文
Boost Your Stream using WebRTC.
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.
Compatibility | Chrome | Firefox | macOS Safari | Android Wechat/QQ | Opera | Edge | IE | iOS 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
- android-p2p-engine - Live/VOD P2P Engine for Android and Android TV.
- ios-p2p-engine - iOS Video P2P Engine for Any Player.
- flutter-p2p-engine - Live/VOD P2P Engine for Flutter, contributed by mjl0602.
- dashjs-p2p-engine - Web Video Delivery Technology with No Plugins for MPEG-dash.
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
Email: service@cdnbye.com
------
https://github.com/TheApeMachine/sockstream
No comments:
Post a Comment