nginx-rtmp-module基于nginx的流媒体插件
官方源码:https://github.com/arut/nginx-rtmp-module
- 安装配置:
- 下载源码模块
Git地址:git clone https://github.com/arut/nginx-rtmp-module.git
-
- 编译安装nginx
./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module --with-http_ssl_module
make && make install
-
- 配置rtmp信息
官方wiki:https://github.com/arut/nginx-rtmp-module/wiki/Directives
Nginx.conf中配置:
# 与http同级配置
rtmp { #RTMP服务
server {
listen 1935; #//服务端口
chunk_size 4096; #//数据传输块的大小
application video{
play /tmp/video; #//视频文件存放位置。
}
application otherrtmp{
pull rtmp://ip/live/xxx; #在此插入其他rtmp流地址
}
application live {
live on; #直播字段
}
application live_hls { #hls协议配置
live on;
hls on;
hls_path /tmp/video/hls;
hls_fragment 3s;
}
}
}