对nginx-rtmp中拉流的一个选项一直不明白,今天被指点,记录之:


nginx-rtmp拉流是的live选项的含义:
pull rtmp://103.249.128.5:1935/live/avatar live=1 name=avatar static;

live=1:
rtmp的play包,有几个参数:
-2:猜这个流类型,先试live,然后vod。
-1:live类型,若这个流是点播,就失败。
0:vod类型,若这个流是直播,就失败。
有些服务器要求有这个。

因为rtmp播放时,例如: rtmp://xx/app/stream ,无法判断该rtmp流是直播还是点播,所以需要加这个选项进行区分。
static:
默认情况下,nginx-rtmp切hls的时候是要求用户访问才会切片,加static后,只有有流接入就会切片


nginx-rtmp作者的答复:


If you pull from another nginx-rtmp-module you may just omit this.
When the option is active rtmp client send a special "live" flag. Certain servers make use of this flag but nginx-rtmp-module does not.
It may have sense for stream disambiguation between live and vod streams on those servers.