美文网首页
基于Nginx的RTMP服务器搭建

基于Nginx的RTMP服务器搭建

作者: 水木年华1987 | 来源:发表于2021-02-13 02:08 被阅读0次

    1.下载nginx源码

    http://nginx.org/en/download.html
    

    2.下载nginx-rtmp-module

    https://github.com/arut/nginx-rtmp-module
    

    3.下载openssl

    https://github.com/openssl/openssl.git
    

    4.配置nginx make文件

    ./configure --prefix=/usr/local/nginx --add-module=path/to/nginx-rtmp-module --with-openssl=path/to/openssl
    

    5.编译nginx

    make -j 4
    

    6.安装nginx

    make install
    

    7.修改nginx配置文件(/usr/local/nginx/conf/nginx.conf),在http服务同级别位置添加如下代码

    #rtmp 服务
    rtmp {
        server {
            #指定端口号
            listen 1935;
            chunk_size 4000;
    
            #指定流应用
            application myapp { 
               live on;
               allow play all;
            }
       }
    }
    

    8.启动nginx服务器

    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    

    相关文章

      网友评论

          本文标题:基于Nginx的RTMP服务器搭建

          本文链接:https://www.haomeiwen.com/subject/uvxsxltx.html