使用nginx和nginx-rtmp-module模块配置RTMP直播服务器

一、下载/安装nginx、nginx-rtmp-module

1.1 下载nginx-rtmp-module


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

1.2 下载并安装nginx


    http://nginx.org/download/nginx-1.9.12.tar.gz
    
    tar zxvf nginx-1.9.12.tar.gz
    cd nginx-1.9.12
    ./configure --with-http_ssl_module --add-module=/opt/software/nginx-rtmp-module-master
    make
    make install

二、配置

2.1 添加rtmp配置


        rtmp {
            server {
                listen 1935;
                chunk_size 4096;
        
                application live {
                    live on;
                }
            }
        }

2.2 http/server中添加配置


        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }

        location /stat.xsl {
            root  /opt/software/nginx-rtmp-module-master;  #the path of nginx-rtmp-module
        }

三、推拉流测试


3.1 ffmpeg推流


    /usr/local/bin/ffmpeg -re -i /root/dwc.flv -vcodec copy -acodec copy -f flv rtmp://192.168.220.128:1935/live/test

3.2 VLC拉流


    VLC -->“媒体”-->“打开网络串流”--> rtmp://192.168.220.128:1935/live/test

3.3 查看流信息

    http://192.168.220.128/stat

 

参考资料:

使用nginx-rtmp-module搭建RTMP直播服务器

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值