如何在centos7系统上搭建Nginx-RTMP流媒体服务器
时间: 2024-04-18 20:30:17 浏览: 208
在CentOS 7系统上搭建Nginx-RTMP流媒体服务器的步骤如下:
1. 安装依赖库:
```
sudo yum install epel-release
sudo yum install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
```
2. 下载Nginx源码:
```
wget http://nginx.org/download/nginx-1.19.10.tar.gz
tar -zxvf nginx-1.19.10.tar.gz
cd nginx-1.19.10
```
3. 编译安装Nginx:
```
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module
make
sudo make install
```
4. 下载Nginx-RTMP模块源码:
```
git clone https://github.com/arut/nginx-rtmp-module.git
cd nginx-rtmp-module
```
5. 配置Nginx:
```
sudo nano /usr/local/nginx/conf/nginx.conf
```
在http块中添加以下配置:
```
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
}
}
}
```
6. 启动Nginx:
```
sudo /usr/local/nginx/sbin/nginx
```
现在,你已经成功在CentOS 7系统上搭建了Nginx-RTMP流媒体服务器。你可以使用RTMP协议将音视频流发布到服务器,并通过RTMP播放器进行播放。
阅读全文
相关推荐













