liunx nginx 配置RTMP模块

没有下载nginx请参考这篇文章:

https://www.cnblogs.com/itcainiao2521/p/10149279.html

我这里是已经下载了nginx 

Linux 版本(centos7)

1:先下载nginx-rtmp-module

wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

解压

unzip master.zip

停止nginx

./opt/nginx-1.9.10/sbin/nginx -s stop

我这里是已经下载过了

liunx nginx 配置RTMP模块进入nginx下载目录

安装第三方插件nginx-rtmp-module-master

./configure --prefix=/opt/nginx-1.9.10 --with-http_v2_module --with-http_flv_module --with-http_mp4_module  --add-module=/opt/nginx-rtmp-module-master

./configure --prefix=(nginx 安装目录) --with-http_v2_module --with-http_flv_module --with-http_mp4_module  --add-module=(nginx-rtmp-module-master  第三方目录模块)

liunx nginx 配置RTMP模块

liunx nginx 配置RTMP模块

 

安装完以后不要急于求成,还有更重要的一步,进行编译

liunx nginx 配置RTMP模块

编译后再执行安装

 sudo make install

liunx nginx 配置RTMP模块

配置rtmp

liunx nginx 配置RTMP模块

rtmp{
   server {    
        listen 1935;  #监听的端口  
        chunk_size 4000;      
        application hls {  #rtmp推流请求路径  
            live on;    
            hls on;    
            hls_path /opt/nginx-1.9.10/html/hls;  #视频播放位置
            hls_fragment 5s;    
        }    
    }
}

rtmp跟http是同级的

比如

http{

      ........

}  

rtmp{

   ........

}

启动nginx

liunx nginx 配置RTMP模块

 

参考文章:

https://www.cnblogs.com/itcainiao2521/p/10149279.html

https://www.cnblogs.com/smallSevens/p/8191238.html

https://www.cnblogs.com/zx-admin/p/5783523.html