实现结果
推流的实现:使用OBS Studio进行推流
拉流播放的实现:使用VLC进行拉流地址播放
直播服务器实现:centos系统下的nginx+RTMP模块
实现步骤:
第1步:nginx相关依赖包的安装
nginx相关依赖包的安装:
yum install -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel gcc-c++ openssl-devel cmakepcre-develnanowget gcc gcc-c++ ncurses-devel perl
其他需要用到的依赖包:
yum -y install git
yum -y install nano
yum -y install wget
第2步:nginx-rtmp-module
nginx-rtmp-module,官方github地址
// 通过git clone 的方式下载到服务器上
[root~]# git clone https://github.com/arut/nginx-rtmp-module.git
第3步:安装Nginx服务器
1.下载Nginx解压,并安装rtmp和openssl的模块
PS:add-module=/data/bak/nginx-rtmp-module 中的/data/bak是自己的下载的相关模块的存放路径
[root~]# wget http://nginx.org/download/nginx-1.10.3.tar.gz
[root~]# tar -zxvf nginx-1.10.3.tar.gz
[root~]# cd nginx-1.10.3
//添加rtmp和openssl支持
[root~]# ./configure --add-module=/data/bak/nginx-rtmp-module --with-http_ssl_module
[root~]# make && make install
第4步:查看安装模块信息:
[root@localhost nginx-1.10.3]# ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
[root@localhost nginx-1.10.3]# nginx -V
nginx version: nginx/1.10.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --add-module=/data/bak/nginx-rtmp-module --with-http_ssl_module
第5步:启动nginx,查看启动的情况
[root@localhost nginx-1.10.3]# nginx -s stop
[root@localhost nginx-1.10.3]# nginx
[root