1 下载必要软件
  从 http://xhmikosr.1f0.de/tools/msys/下载msys:http://xhmikosr.1f0.de/tools/msys/MSYS_MinGW-w64_GCC_610_x86-x64_Full.7z
  把MSYS_MinGW-w64_GCC_610_x86-x64_Full.7z压缩包里面的MSYS解压到C盘根目录。
  
  安装windwos版本git。https://git-for-windows.github.io/
  https://github.com/git-for-windows/git/releases/download/v2.9.3.windows.1/Git-2.9.3-64-bit.exe
  
  vc2015下载地址:https://www.visualstudio.com/downloads/download-visual-studio-vs

安装perl
  http://www.activestate.com/activeperl/downloads
  http://www.activestate.com/activeperl/downloads/thank-you?dl=http://downloads.activestate.com/ActivePerl/releases/5.24.0.2400/ActivePerl-5.24.0.2400-MSWin32-x86-64int-300560.exe
  
  
  安装hg代码管理工具,下载nginx源码。需要设置环境变量PATH 加入 C:\Program Files\Mercurial。
  https://www.mercurial-scm.org/release/windows/Mercurial-3.9-x64.exe
  
2 下载编译nginx必须的源码包
   cmd.exe
   d:
   cd d:\git\
   hg clone http://hg.nginx.org/nginx
   cd nginx
   hg tags 找到最新tag是release-1.11.3
   迁出最新稳定版本代码
   hg co release-1.11.3


   
   # 修改错误级别为3级,d:\git\nginx\auto\cc\msvc的83行,把 -W4 修改为 -W3
   # 否则,编译时(nmake -f build/Makefile),会出现如下错误:
   # build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): error C2220: 警告被视为错误 - 没有生成“object”文件
   # build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): warning C4456: “sa”的声明隐藏了上一个本地声明
   # build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): note: 要简化迁移,请考虑暂时对用于生成且不引发警告的编译器版本 使用 /Wv:18 标记
   # build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(506): note: 参见“sa”的声明
   # NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"”: 返回代码“0x2”
   # Stop.
   d:\git\nginx\auto\cc\msvc
   CFLAGS="$CFLAGS -W4" ==> CFLAGS="$CFLAGS -W3"
   
   mkdir build
   mkdir build\lib
   
   # 下载 nginx-rtmp-module 代码,checkout稳定版本
   git clone https://github.com/arut/nginx-rtmp-module.git
   cd nginx-rtmp-module
   git tag
   git checkout -b b1.1.9 v1.1.9
   
   # 打开 msys 环境,下载必要的源码包。
   c:\msys\msys.bat
   
   在msys窗口输入:
   cd d:/git/nginx/build/lib/
   
   # 下载 opensll、pcre、zlib到lib目录,并解压
   wget ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1s.tar.gz
   wget http://downloads.sourceforge.net/pcre/pcre-8.39.tar.bz2
   wget http://zlib.net/zlib-1.2.8.tar.gz
   tar -xzf openssl-1.0.1s.tar.gz
   tar -jxvf pcre-8.39.tar.bz2
   tar -xzf zlib-1.2.8.tar.gz

3 编译
   cd d:/git/nginx
   # 在msys的/d/git/nginx目录下执行 auto/configure如下:
auto/configure --with-cc=cl --builddir=build --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 \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=build/lib/pcre-8.39 \
--with-zlib=build/lib/zlib-1.2.8 --with-openssl=build/lib/openssl-1.0.1s \
--with-select_module --with-http_ssl_module --with-ipv6 \
--with-http_sub_module \
--add-module=build/lib/nginx-rtmp-module

在cmd窗口运行:
d:
cd d:/git/nginx
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
nmake -f build/Makefile

运行完成后,cmd 命令行窗口显示:
已完成库搜索
        sed -e "s|%PREFIX%||"  -e "s|%PID_PATH%|/logs/nginx.pid|"  -e "s|%CONF_PATH%|/conf/nginx.conf|"  -e "s|%ERROR_LOG_PATH%|/logs/error.log|"  < docs/man/nginx.8 > build/nginx.8
'sed' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
NMAKE : fatal error U1077: “sed”: 返回代码“0x1”
Stop
这个是因为我们没有正确配置msys 和 mingw32 在windows 上面的路径产生的,不用理会。

在d:\git\nginx\build\下面,已经成功生成nginx.exe

4 配置

cd d:\git\nginx\build
mkdir logs
mkdir temp
# 修改 lib\nginx-rtmp-module\test\nginx.conf 的配置内容,指定 /path/to  为 lib
# 注意系统不要占用tcp 8080端口,和 1935 端口。nginx.conf 中默认使用了8080 作为http端口,1935 作为推流端口。
      # root /path/to/nginx-rtmp-module/test;
            root lib/nginx-rtmp-module/test;
   
      # root /path/to/nginx-rtmp-module/test/www;
            root lib/nginx-rtmp-module/test/www;

5 测试
# 启动nginx.exe   
nginx.exe -c lib\nginx-rtmp-module\test\nginx.conf

在浏览器地址栏输入一下内容,如果pc上带有可用摄像头,就可以看到录制、观看视频流:
http://127.0.0.1:8080/index.html
http://127.0.0.1:8080/rtmp-publisher/player.html
http://127.0.0.1:8080/rtmp-publisher/publisher.html
http://127.0.0.1:8080/stat/

windows10 vs2015编译 带nginx-rtmp-module 模块的32位nginx的更多相关文章

  1. Aliyun OSS Nginx proxy module(阿里云OSS Nginx 签名代理模块)

    1.此文章主要介绍内容 本文主要介绍如何利用Nginx lua 实现将阿里云OSS存储空间做到同本地磁盘一样使用.核心是利用Nginx lua 对OSS请求进行签名并利用内部跳转将所有访问本地Ngin ...

  2. ffmpeg,rtmpdump和nginx rtmp实现录屏,直播和录制

    公司最近在做视频直播的项目,我这里分配到对直播的视频进行录制,录制的方式是通过rtmpdump对rtmp的视频流进行录制 前置的知识 ffmpeg: 用于实现把录屏工具发出的视频和音频流,转换成我们需 ...

  3. nginx upload module的使用

    现在的网站,总会有一点与用户交互的功能,例如允许用户上传头像,上传照片,上传附件这类的.PHP写的程序,对于上传文件效率不是很高.幸好,nginx有一个名为upload的module可以解决这个问题. ...

  4. 开始Nginx的SSL模块

    nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/n ...

  5. nginx健康检查模块源码分析

    nginx健康检查模块 本文所说的nginx健康检查模块是指nginx_upstream_check_module模块.nginx_upstream_check_module模块是Taobao定制的用 ...

  6. nginx的ngx_http_geoip2模块以精准禁止特定地区IP访问

    要求:对网站的信息,比如某个访问节点不想国内或者国外的用户使用,禁止国内或者国外或者精确到某个城市的那种情况. 解决方式:1.Cloudfalre来实现禁止特定国家的ip访问,比较简单,但是需要mon ...

  7. 【Nginx】如何为已安装的Nginx动态添加模块?看完我懂了!!

    写在前面 很多时候,我们根据当时的项目情况和业务需求安装完Nginx后,后续随着业务的发展,往往会给安装好的Nginx添加其他的功能模块.在为Nginx添加功能模块时,要求Nginx不停机.这就涉及到 ...

  8. Win7 下用 VS2015 编译最新 openssl(1.0.2j)包含32、64位debug和release版本的dll、lib(8个版本)

    Win7 64位系统下通过VS2015编译好的最新的OpenSSL(1.0.2j)所有八个版本的链接库, 包含以下八个版本: 1.32位.debug版LIB: 2.32位.release版LIB: 3 ...

  9. vs2015编译zlib静态库步骤

    ZLIB静态库的编译 下载ZLIB源码 ZLib官网下载或者GitHub上直接 clone 下来即可 www.zlib.net 截至目前最新版本1.2.1.1本 如下图我选择从官网下载 下载完以后解压 ...

随机推荐

  1. 初次使用Bootstrap

    一.概述也好,过程也好,反正就是这样 知道这个还是从群里听到的,一个人的视野是有限,必须借助他人来扩展.好奇使我去搜索了解了一下.原来是一个网页前端框架,可以适合不同大小屏幕,自动适应正常显示.这就是 ...

  2. *SCM-MANAGER独立部署方式

    从官网获取最新版本 scm-manager 独立安装包 https://www.scm-manager.org/download/ 解压 为合适的路径 修改 services.bat 文件服务相关信息 ...

  3. js 滚到页面顶部

    一.滚到顶部,且滚动中,用户滚动鼠标无效 <style> .div1, .div2, .div3, .div4 { height: 400px; width: 400px; } .div1 ...

  4. Mysql双机热备--预备知识

    1.双机热备 对于双机热备这一概念,我搜索了很多资料,最后,还是按照大多数资料所讲分成广义与狭义两种意义来说. 从广义上讲,就是对于重要的服务,使用两台服务器,互相备份,共同执行同一服务.当一台服务器 ...

  5. python_安装第三方库

    1.有一个专门可下载安装第三方库的网址: http://www.lfd.uci.edu/~gohlke/pythonlibs/   Ctrl+f 搜索要下载的第三方库,并下载 2.库文件都是以 whl ...

  6. 目标跟踪算法meanshift优缺点

    原博主:http://blog.csdn.net/carson2005/article/details/7341051 meanShift算法用于视频目标跟踪时,采用目标的颜色直方图作为搜索特征,通过 ...

  7. (转)MapReduce Design Patterns(chapter 4 (part 2))(八)

    Binning Pattern Description 分箱模式,跟前面的类似,分类记录且不考虑记录的顺序. Intent 归档数据集中的每条记录到一个或多个类别. Motivation 分箱和分区很 ...

  8. Linux 去重 先sort再uniq

    从uniq命令的帮助信息中可以看到,该命令只过滤相邻的重复行. 如果要去掉所有重复行,需要先排序,或者使用uniq -u $ uniq --h Usage: uniq [OPTION]... [INP ...

  9. Split功能的思想实现

    using System; using System.Collections; using System.Collections.Generic; using System.Linq; using S ...

  10. Android 百度地图2.4.2版本标注动画效果

    ImageView latestMapEventImageView = null; // 更新震中位置 private void updateMapEventOverlay() { mMapEvent ...