配置服务 vim bin/conf.nginx.conf
#user nobody;
user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
error_log logs/error.log debug;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
application myapp {
live on;
drop_idle_publisher 5s;
}
}
}
http {
server {
listen 8081;
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /home/cd/nginx-rtmp-module-1.2.1/;
}
location /control {
rtmp_control all;
}
location /rtmp-publisher {
root /home/cd/nginx-rtmp-module-1.2.1/test;
}
location / {
root /home/cd/nginx-rtmp-module-1.2.1/test/www;
}
}
}
关闭nginx服务器
bin/sbin/nginx -s stop
启动nginx服务器
./bin/sbin/nginx
服务器地址
ip:配置的端口/配置的服务
http://192.168.13.92:8081/stat
推送地址
rtmp://192.168.13.92/myapp
播放
ffplay -i rtmp://192.168.13.92/myapp