Git Product home page Git Product logo

free-hls's Introduction

Free-HLS

这是一个免费的 HLS 视频解决方案,即所谓的视频床。本项目提供一整套集成化解决方案,囊括了各环节所需的切片、转码、上传、即时分享等套件。让你可以以更方便、更低廉的方式分享你的视频到任意地方。

本项目仅供学习交流使用,在使用过程中对你或他人造成的任何损失我们概不负责。

视频教程:只需 10 分钟搭建出一款属于自己的视频床:https://sxyz.gitee.io/free-hls/usage.html

客户端

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

1. 安装依赖

安装最新的 Python3,以及必要包:

apt install -y ffmpeg python3 python3-pip
pip3 install shellescape python-dotenv

2. 配置语雀

.env.example 更名为 .env,修改其中的 YUQUE_CTOKENYUQUE_SESSION 配置。操作步骤:

  1. 登录语雀 yuque.com;
  2. 打开 Chrome 的开发者工具(Command+Shift+I),切换到 Network 面板;
  3. 刷新页面,从 Cookie 中抓取 ctoken_yuque_session,复制并替换到 .env 文件中;

3. 配置服务

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

4. 开始使用

准备好目标视频文件,输入如下指令开始切片、上传:

python3 up.py test.mp4         #默认标题
python3 up.py test.mp4 测试哦   #自定义标题
python3 up.py test.mp4 test 5  #自定义分段大小

服务端

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

1. 安装依赖

安装最新的 Python3,以及必要包:

apt install -y python3 python3-pip
pip3 install Flask gunicorn

2. 启动服务

cd web
gunicorn app:app -b 0.0.0.0:3395 -D

free-hls's People

Contributors

gizmo-ds avatar sxyazi avatar

Watchers

 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.