美文网首页
在CentOS下使用nginx搭建流媒体服务器

在CentOS下使用nginx搭建流媒体服务器

作者: 往后余生9375 | 来源:发表于2017-12-25 17:32 被阅读0次

需要准备的资料

https://github.com/arut/nginx-rtmp-module
http://nginx.org/en/download.html
https://obsproject.com/
http://www.videolan.org/vlc/

官方中文文档

https://www.jianshu.com/nb/20132113

安装nginx+nginx-rtmp

nginx环境安装

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

配置文件如下

./configure --sbin-path=/usr/bin/nginx --add-module=../nginx-rtmp-module-master

#默认安装路径/usr/local/nginx

配置直播环境

cd nginx/conf
vi nginx.conf

## 在跟节点下写入以下配置
rtmp{
        server{
                listen 1935;
                application myapp{
                        live on;
                }
        }  
}

重启nginx即可。

cd /usr/local/nginx/sbin/
 ./nginx -s reload

推流测试

Image 2.png

然后点击开始推流

播放测试

Image 3.png

相关文章

网友评论

      本文标题:在CentOS下使用nginx搭建流媒体服务器

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