基于Nginx的RTMP服务器搭建

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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容