用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

执行此脚本即可。

最新文章

  1. bootstrap-滚动监听
  2. 【背景建模】SOBS
  3. 自定义ActionBar
  4. Ajax异步调用使用
  5. hadoop2.1.0和hadoop2.2.0编译安装教程
  6. QT类库与Delphi类库的体系结构对比——两者十分类似!
  7. Tengine简单安装
  8. CodeForces 398B 概率DP 记忆化搜索
  9. mysql忘掉密码
  10. 十二、 Spring Boot 静态资源处理
  11. 解决:Using where; Using join buffer (Block Nested Loop)
  12. Java基础——0 前言
  13. mac下git安装与使用
  14. 使用Visual Studio 2017开发Linux程序
  15. jQuery 购物车
  16. c time类型详解
  17. 关于MySQL数据库的备份方案
  18. Redux和React-Redux的实现(二):Provider组件和connect的实现
  19. Android native层动态库注射
  20. 图书源代码下载: Modern Differential Geometry of CURVES and SURFACES with Mathematica

热门文章

  1. poj 1743
  2. [51nod1610]路径计数
  3. vue安装babel依赖报错
  4. 微信小程序初使心得【微信小程序快速入门】
  5. IE8兼容border-radius.
  6. SQL的各种连接(cross join、inner join、full join)的用法理解
  7. UILabel的顶对齐解决方法
  8. 微调数据库表结构,30 分钟搞定 WordPress 数据库查询缓慢问题
  9. python3 第二十二章 - 函数式编程之Decorator(装饰器)
  10. jinja2.exceptions.TemplateNotFound: home/index.html