我正在运行ffmpeg对实时流进行编码。 有时(并非总是)在编码时出现此错误:“ av_interleaved_write_frame损坏的管道”
我的FFMPEG代码是这样的:
ffmpeg -re -i rtmp://localhost:587/live/test -rw_timeout 500 -http_persistent 1 -method PUT -f hls -hls_list_size 5 -hls_flags discont_start+omit_endlist -async 1 -vf "scale=640:trunc(ow/a/2)*2" -movflags +faststart -c:a libfdk_aac -ar 48000 -c:v h264 -profile:v main -crf 24 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -preset veryfast -b:v 350k -maxrate 800k -bufsize 1100k -b:a 96k -vcodec libx264 -hls_segment_filename http://serverwherepulish.com/url/var1/ts/var1_%03d.ts http://serverwherepulish.com/url/var1/1.m3u8 \
-http_persistent 1 -f hls -hls_list_size 5 -hls_flags discont_start+omit_endlist -async 1 -vf "scale=842:trunc(ow/a/2)*2" -movflags +faststart -c:a libfdk_aac -ar 48000 -c:v h264 -profile:v main -crf 24 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -preset veryfast -b:v 800k -maxrate 1200k -bufsize 1700k -b:a 128k -vcodec libx264 -hls_segment_filename http://serverwherepublish.com/url/var2/ts/var2_%03d.ts http://serverwherepublish.com/url/var2/2.m3u8 \
-http_persistent 1 -f hls -hls_list_size 5 -hls_flags discont_start+omit_endlist -async 1 -vf "scale=1280:trunc(ow/a/2)*2" -movflags +faststart -c:a libfdk_aac -ar 48000 -c:v h264 -profile:v main -crf 24 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -preset veryfast -b:v 1200k -maxrate 1900k -bufsize 2400k -b:a 128k -vcodec libx264 -hls_segment_filename http://serverwherepublish.com/url/var3/ts/var3_%03d.ts http://serverwherepublish.com/url/var3/3.m3u8
我不知道,尝试更改一些参数,但没有任何方法可以解决问题。 有什么建议吗?
谢谢!