Coder Social home page Coder Social logo

live's Introduction

7×24 全天候不间断无人值守循环直播推流

在荒岛博客《FFmpeg循环推流脚本》的代码基础上结合电丸科技AK的视频(https://www.youtube.com/watch?v=Ko20sPb93fo )修改而成,方便个人使用而已。

使用方法

1、新建视频文件夹,并上传你想直播的视频(FTP或其他方法,我用的FinalShell很好用。)自己动手使用Rclone挂载GoogleDrive或OneDrive也可以:

mkdir /home/Videos

2、安装依赖应用 CentOS

yum -y install screen wget

Ubuntu/Debian

apt-get -y install screen wget

2、下载live.sh并赋权,以下需要root权限使用,具体可输入su并输入密码即可:

国内服务器
wget -N https://gitee.com/kuwinet/live/raw/master/live.sh
chmod 755 /root/live.sh
国外服务器
wget -N https://raw.githubusercontent.com/KuwiNet/Live/main/live.sh
chmod 755 /root/live.sh

3、运行live.sh安装FFmpeg,选择1安装FFmpeg。

./live.sh

4、新建窗口,准备直播推流,再次运行live.sh,选择2,按提示操作就好,每次开始推流时请使用下方命令,确保在screen窗口内运行,否则ssh连接窗口不能关闭。

screen -S live
./live.sh

注意事项

a. 修改推流码率,live.sh第73行里的6000k和192k两处,6000k是视频码率,192k是音频码率,根据自己的服务器情况修改即可。
b. 解放本地电脑(如果使用Windows或MacOS自带工具连接ssh需要),新建ssh连接(必须),使用FinalShell可随时关闭窗口,不会中断推流:
查看推流窗口

screen -ls

脱离窗口,2843.live表示要脱离的窗口,根据上述查看结果写

screen -d 2843.live

c. 关闭推流进程,可运行live.sh,也可下方命令

screen -X -S 2843.live quit

live's People

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.