Git Product home page Git Product logo

ffmpeg-push's Introduction

24h-Streaming

24小时推流直播

推流的命令

ffmpeg -re -i 阳光电影www.ygdy8.com.侍神令.2021.HD.1080P.国语中英双字.mp4 -vcodec copy -acodec copy -f flv rtmp://192.168.123.144/live/Skn0AyEtO

本地播放命令:

ffplay rtmp://127.0.0.1/live/Skn0AyEtO
tmux new-session -t itgoyo

tmux attach-session -t itgoyo

无缝播放命令:

ffmpeg -re -f concat -safe 0 -i video.txt -vcodec copy -acodec copy -f flv rtmp://192.168.123.144/live/Skn0AyEtO

但是上面的只能执行一次,我们需要循环执行,这样子就衍生出了下面这种方式 !!! 直播地址的双引号很重要""

#!/bin/bash
###
 # @Description:自动循环推流脚本
 # @Author: itgoyo
 # @E-mail: [email protected]
 # @Github: itgoyo
###

while true

do

ffmpeg -re -f concat -safe 0 -i video.txt -vcodec copy -acodec copy -f flv "rtmp://live-push.bilivideo.com/live-bvc/?streamname=live_1276706key=0c32218670c24b8ea4bb8e45d1edule=rtmp&pflag=1"

done

如果你想终止的话,以往的命令是终止不了的,只能先 ps -ef,找到推流ffmpeg是那个端口,然后使用 kill -9端口来终止

如果是在服务器上面的话,ps找不到后台运行的端口号的话,可以使用ps -ef|grep nohup或者使用ps aux &来查看,一般都是ffmpeg的端口号干掉就可以了

加水印

#!/bin/bash
###
 # @Description:自动循环推流脚本
 # @Author: itgoyo
 # @E-mail: [email protected]
 # @Github: itgoyo
###

while true

do

ffmpeg -re -f concat -safe 0 -i video.txt -vf "movie=/Users/itgoyo/Downloads/logo.jpg [watermark]; [in][watermark] overlay=10:10 [out]" -c:v libx264 -c:a copy -f flv "rtmp://127.0.0.1/live/HyqY_aVDt"

done

.txt文本内容

格式如下,位置最好自己pwd,然后拼全,我这是因为放在了同一个根目录下

file 'magic_video1.mp4'
file 'magic_video2.mp4'
file 'magic_video3.mp4'
file 'magic_video4.mp4'
file 'magic_video5.mp4'
file 'magic_video6.mp4'

ffmpeg-push's People

Contributors

itgoyo avatar

Stargazers

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

Watchers

 avatar  avatar

ffmpeg-push's Issues

存在的问题

自己搭建的SRS直播服务器,遇到一个蛋疼的问题,推流是没有问题,虽然是循环推流,但是当一个周期结束的时候,拉流软件还是会自动停止播放,得重新点击播放才行。

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.