下载地址:http://nginx.org/download/nginx-1.12.1.tar.gz
下载地址:https://github.com/openssl/openssl/archive/OpenSSL_1_1_0f.tar.gz
下载地址:https://github.com/arut/nginx-rtmp-module/archive/v1.2.0.tar.gz
./config --prefix=`pwd`/bin
make install
./configure --prefix=`pwd`/bin --add-module=/root/nginx/nginx-rtmp-module-1.2.0
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="OpenSSL library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
else
ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="OpenSSL library in /root/nginx/openssl-OpenSSL_1_1_0f/bin"
ngx_feature_path="/root/nginx/openssl-OpenSSL_1_1_0f/bin/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/root/nginx/openssl-OpenSSL_1_1_0f/bin/lib -L/root/nginx/openssl-OpenSSL_1_1_0f/bin/lib -lssl -lcrypto $NGX_LIBDL"
else
ngx_feature_libs="-L/root/nginx/openssl-OpenSSL_1_1_0f/bin/lib -lssl -lcrypto $NGX_LIBDL"
fi
. auto/feature
fi
yum install -y zlib zlib-devel
make install
./nginx
vi /etc/ld.so.conf
/root/nginx/openssl-OpenSSL_1_1_0f/bin/lib
ldconfig
worker_processes 1;
error_log logs/error.log debug;
events {
# 最大连接数
worker_connections 1024;
}
rtmp {
server {
# 端口
listen 1935;
application myapp {
live on;
#record keyframes;
#record_path /tmp;
#record_max_size 128K;
#record_interval 30s;
#record_suffix .this.is.flv;
#on_publish http://localhost:8080/publish;
#on_play http://localhost:8080/play;
#on_record_done http://localhost:8080/record_done;
}
}
}
http {
server {
listen 8080;
locatio_oorker_processeo /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
# 改成本地的路径
#root /path/to/nginx-rtmp-module/;
root /root/nginx/nginx-rtmp-module-1.2.0;
}
location /control {
rtmp_control all;
}
#location /publish {
# return 201;
#}
#location /play {
# return 202;
#}
#location /record_done {
# return 203;
#}
location /rtmp-publisher {
# 改成本地的路径
# root /path/to/nginx-rtmp-module/test;
root /root/nginx/nginx-rtmp-module-1.2.0/test;
}
location / {
# 改成本地的路径
# root /path/to/nginx-rtmp-module/test/www;
root /root/nginx/nginx-rtmp-module-1.2.0/test/www;
}
}
}
chmod 755 /root
systemctl stop firewalld.service
ffmpeg -re -i D:\China合伙人.flv -f flv rtmp://192.168.43.4/myapp/mystream
./nginx -s stop