这是我想要ffmpeg输出的内容:
这是我到目前为止所拥有的。它有点有效。
ffmpeg \
-f lavfi \
-re \
-i 'color=s=320x240:r=30:c=red' \
-thread_queue_size 512 \
-i 'rtmp://localhost/stream/iphone' \
-c:v libx264 \
-f flv \
-filter_complex "\
[1:v]scale=320:240[stream]; \
[0:v][stream]overlay=0:0:eof_action=pass[output] \
"\
-map '[output]' \
-tune zerolatency \
'rtmp://localhost/stream/output'
会发生什么:它启动并开始流式传输我的iPhone输出没问题。当我断开连接时,它会挂起很长时间,也许是20秒。然后它开始输出红色,好吧。但是,如果我重新连接手机,它就不会恢复。它仍然是红色的。两个问题:
Full verbose output, if that's helpful。我在2016-03-18使用最新的gf版本的ffmpeg在Ubuntu Wily上。 RTMP服务器为nginx-rtmp。