ffmpeg - ffmpeg 直播流错误:av_interleaved_write_frame(): Broken pipe
问题描述
我正在尝试使用 ffmpeg 实时流式传输视频,输入来自 UDP 源。大多数情况下它工作正常,但我可以看到以下日志行,并且 ffmpeg 停止将转换/提要推送到 rtmp 服务器。以下几行日志供参考。这个问题与到达目的地或来源的网络有关,还是我需要在 ffmpeg 命令中更改?
Wed Jun 17 07:53:22 2020 av_interleaved_write_frame(): Broken pipe
Wed Jun 17 07:53:48 2020 Last message repeated 1 times
Wed Jun 17 07:53:48 2020 av_interleaved_write_frame(): End of file
Wed Jun 17 07:53:49 2020 Last message repeated 1 times
Wed Jun 17 07:53:49 2020 [flv @ 0x40c87c0] Failed to update header with correct duration.
Wed Jun 17 07:53:49 2020 [flv @ 0x40c87c0] Failed to update header with correct filesize.
Wed Jun 17 07:53:49 2020 Error writing trailer of rtmp://ipaddress:1935/rtmp/push/test1: Broken pipe
Wed Jun 17 07:53:49 2020 [flv @ 0x48fe140] Failed to update header with correct duration.
Wed Jun 17 07:53:49 2020 [flv @ 0x48fe140] Failed to update header with correct filesize.
Wed Jun 17 07:53:49 2020 Error writing trailer of rtmp://ipaddress:1935/rtmp/push/test2: Broken pipe
Wed Jun 17 07:53:49 2020 [flv @ 0x4ccb5c0] Failed to update header with correct duration.
Wed Jun 17 07:53:49 2020 [flv @ 0x4ccb5c0] Failed to update header with correct filesize.
Wed Jun 17 07:53:49 2020 Error writing trailer of rtmp://ipaddress:1935/rtmp/push/test3: End of file
Wed Jun 17 07:53:49 2020 [flv @ 0x4725840] Failed to update header with correct duration.
Wed Jun 17 07:53:49 2020 [flv @ 0x4725840] Failed to update header with correct filesize.
Wed Jun 17 07:53:49 2020 Error writing trailer of rtmp://ipaddress:1935/rtmp/push/test4: Broken pipe
Wed Jun 17 07:53:49 2020 video:10594389kB audio:678081kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Wed Jun 17 07:53:49 2020 [libx264 @ 0x410c540] frame I:12400 Avg QP:19.58 size: 11797
Wed Jun 17 07:53:49 2020 [libx264 @ 0x410c540] frame P:359585 Avg QP:23.19 size: 1317
在下面添加 ffmpeg 命令:
ffmpeg -err_detect aggressive -fflags discardcorrupt -i udp://230.1.1.2:11000?fifo_size=5000000&overrun_nonfatal=1 -analyzeduration 25M -probesize 50M -threads 0 -vsync 1 -filter_complex [i:0x202]yadif,setdar=16/9[1out1];[i:0x202]yadif,setdar=16/9[1out2];[i:0x202]yadif,setdar=16/9[1out3];[i:0x202]yadif,setdar=16/9[1out4] -map [1out1] -map i:0x29e -c:v libx264 -x264-params nal-hrd=cbr -b:v 200k -maxrate 200k -bufsize 300k -r 15 -g 30 -profile:v baseline -level 3.0 -pix_fmt yuv420p -c:a libfdk_aac -b:a 32k -ac 2 -ar 48000 -sc_threshold 0 -s 256x144 -tune film -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -x264opts opencl -f flv rtmp://ipaddress:1935/rtmp/push/test1-map [1out2] -map i:0x29e -c:v libx264 -x264-params nal-hrd=cbr -b:v 500k -maxrate 500k -bufsize 750k -r 25 -g 50 -profile:v baseline -level 3.0 -pix_fmt yuv420p -c:a libfdk_aac -b:a 64k -ac 2 -ar 48000 -sc_threshold 0 -s 512x288 -tune film -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -x264opts opencl -f flv rtmp://ipaddress:1935/rtmp/push/test2 -map [1out3] -map i:0x29e -c:v libx264 -x264-params nal-hrd=cbr -b:v 1000k -maxrate 1000k -bufsize 1500k -r 25 -g 50 -profile:v main -level 3.0 -pix_fmt yuv420p -c:a libfdk_aac -b:a 64k -ac 2 -ar 48000 -sc_threshold 0 -s 1024x576 -tune film -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -x264opts opencl -f flv rtmp://ipaddress:1935/rtmp/push/test3 -map [1out4] -map i:0x29e -c:v libx264 -x264-params nal-hrd=cbr -b:v 1800k -maxrate 1800k -bufsize 2700k -r 25 -g 50 -profile:v main -level 3.1 -pix_fmt yuv420p -c:a libfdk_aac -b:a 64k -ac 2 -ar 48000 -sc_threshold 0 -s 1280x720 -tune film -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -x264opts opencl -f flv rtmp://ipaddress:1935/rtmp/push/test4
解决方案
推荐阅读
- sql - POSTGRES - 超级用户无法访问 pg_authid 表
- c# - UI Automation using Selenium c# for Windows App 使用带有 CEF 框架的 WPF 应用程序开发
- django - 工人不运行时执行芹菜任务
- extjs - 创建扩展元素的新实例
- typescript - 将 chart.js x 轴标签格式化为特定时区
- android - strings.xml 中 CHAR_LIMIT 的用途是什么?
- mysql - 无法创建临时文件;errno: 2 在 Windows 上运行 Mysql 服务器时
- c++ - 这是一场数据竞赛吗?开放式
- ios - 仅针对选定/突出显示的值显示圆圈
- java - java中的字符串小数到百分比