1.首先下载ffmpeg和ffplay
1.1下载 Nginx
进入Nginx下载页面( http://nginx-win.ecsds.eu/download/ ),选择合适的版本下载。这里以 nginx 1.7.11.3 Gryphon 为例。下载完成后解压, 将解压后的目录重命名为“ nginx-1.7.11.3-Gryphon ”,并放到合适的路径下。
1.2下载服务器状态检查程序 stat.xsl
下载地址: https://github.com/arut/nginx-rtmp-module/
将nginx-rtmp-module-master.zip解压后复制到目录:nginx-1.7.11.3-Gryphon下,
保证stat.xls的目录为:
nginx-1.7.11.3-Gryphon\nginx-rtmp-module\stat.xsl
1.3创建配置文件 conf\nginx-win-rtmp.conf
在目录 nginx-1.7.11.3-Gryphon\conf下创建 nginx-win-rtmp.conf配置文件,内容如下:
#user nobody;
# multiple workers works !
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 8192;
# max value 32768, nginx recycling connections+registry optimization =
# this.value * 20 = max concurrent connections currently tested with one worker
# C1000K should be possible depending there is enough ram/cpu power
# multi_accept on;
}
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
# record first 1K of stream
record all;
record_path /tmp/av;
record_max_size 1K;
# append current timestamp to each flv
record_unique on;
# publish only from localhost
allow publish 127.0.0.1;
deny publish all;
#allow play all;
}
}
}
http {
#include /nginx/conf/naxsi_core.rules;
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr:$remote_port - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
#