ffmpeg命令行循环推流
2024-08-29 03:18:06
用ffmpeg循环推一个文件到rtmp服务器。
一般都是建议用-stream_loop选项。如:
ffmpeg -threads -re -fflags +genpts -stream_loop - -i "H:\video.mp4" -c copy -f flv rtmp://10.100.1.4:1935/live/12345
前提是ffmpeg版本高于2.8.4。而且是推流到Nginx-rtmp。
此方法推流到srs失效。第二次推流的时候会提示:
WriteN, RTMP send error ( bytes)B time=::35.93 bitrate= .8kbits/s speed= 1x
WriteN, RTMP send error ( bytes)
WriteN, RTMP send error ( bytes)
av_interleaved_write_frame(): Operation not permitted
[flv @ 0000000002bcf940] Failed to update header with correct duration.
[flv @ 0000000002bcf940] Failed to update header with correct filesize.
Error writing trailer of rtmp://10.100.1.4:1935/live/12345: Operation not permitted
我一般使用脚本循环推文件。
建议一个文件,如push2id12345.bat
内容如下:
for((;;)); do \
ffmpeg -re -i "H:\video.mp4" \
-c copy \
-f flv -y rtmp://10.100.1.4:1935/live/12345; \
sleep ; \
done
执行此脚本即可。
最新文章
- bootstrap-滚动监听
- 【背景建模】SOBS
- 自定义ActionBar
- Ajax异步调用使用
- hadoop2.1.0和hadoop2.2.0编译安装教程
- QT类库与Delphi类库的体系结构对比——两者十分类似!
- Tengine简单安装
- CodeForces 398B 概率DP 记忆化搜索
- mysql忘掉密码
- 十二、 Spring Boot 静态资源处理
- 解决:Using where; Using join buffer (Block Nested Loop)
- Java基础——0 前言
- mac下git安装与使用
- 使用Visual Studio 2017开发Linux程序
- jQuery 购物车
- c time类型详解
- 关于MySQL数据库的备份方案
- Redux和React-Redux的实现(二):Provider组件和connect的实现
- Android native层动态库注射
- 图书源代码下载: Modern Differential Geometry of CURVES and SURFACES with Mathematica
热门文章
- poj 1743
- [51nod1610]路径计数
- vue安装babel依赖报错
- 微信小程序初使心得【微信小程序快速入门】
- IE8兼容border-radius.
- SQL的各种连接(cross join、inner join、full join)的用法理解
- UILabel的顶对齐解决方法
- 微调数据库表结构,30 分钟搞定 WordPress 数据库查询缓慢问题
- python3 第二十二章 - 函数式编程之Decorator(装饰器)
- jinja2.exceptions.TemplateNotFound: home/index.html