准备:
1. 下载并安装MSYS
2. 安装Perl,并把Perl的运行路径配置到PATH中
3. 安装Mercurial,nginx用Mercurial进行代码管理,如果网络不好用的话,可以直接去官网下载源码
4. 下载PCRE , zlib , OpenSSL 的 “源码” ,这里需要的是源码而不是编译好的库
编译:
1. 打开一个MSYS 命令行
2. 切换到源码目录
3. 在源码同级创建objs/lib路径,解压 pcre , zlib , openssl 的源码包到此路径下,官方推荐使用在源码内部创建
此路径,这里为了保持源码路径的整洁,在源码同级路径下创建。
4. 运行configure
auto/configure --with-cc=cl --builddir=objs --prefix= \
--conf-path=conf/nginx.conf --pid-path=logs/nginx.pid \
--http-log-path=logs/access.log --error-log-path=logs/error.log \
--sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre \
--with-zlib=objs/lib/zlib --with-openssl=objs/lib/openssl \
--with-select_module --with-http_ssl_module \
--add-module=../nginx-http-flv-module
把文件推流到服务器上做代理
ffmpeg -re -i test.flv -c copy -f flv rtmp://127.0.0.1:1935/myapp/test_stream
拉流播放
rtmp://127.0.0.1:1935/myapp/test_stream