1. 1. 下载源码
  2. http://hg.nginx.org/nginx
  3. nginx-c74904a17021.zip
  4.  
  5. https://github.com/arut/nginx-rtmp-module
  6. nginx-rtmp-module-master.zip
  7.  
  8. https://www.openssl.org/source/
  9. https://www.openssl.org/source/openssl-1.0.2r.tar.gz
  10.  
  11. https://ftp.pcre.org/pub/pcre/
  12. https://ftp.pcre.org/pub/pcre/pcre-8.43.zip
  13.  
  14. http://www.zlib.net/
  15. http://www.zlib.net/zlib-1.2.11.tar.gz
  16.  
  17. 2. 源码部署
  18. nginx-rtmp-module-master.zip 解压到 nginx-c74904a17021/nginx-rtmp-module
  19. nginx-c74904a17021 目录下创建目录 libs
  20. openssl-1.0.2r.tar.gz pcre-8.43.zip zlib-1.2.11.tar.gz 解压到 nginx-c74904a17021/libs
  21.  
  22. 3. 启动 MSYS 进入 nginx-c74904a17021 目录
  23. 最新版本 nginx configure auto 目录下
  24. ./auto/configure \
  25. --prefix=/usr/opt/nginx-1.15.9 \
  26. --with-pcre=/usr/build/libs/nginx-c74904a17021/libs/pcre-8.43 \
  27. --with-openssl=/usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r \
  28. --with-zlib=/usr/build/libs/nginx-c74904a17021/libs/zlib-1.2.11 \
  29. --add-module=/usr/build/libs/nginx-c74904a17021/nginx-rtmp-module \
  30. --with-http_ssl_module
  31.  
  32. 4. 修改源码
  33. nginx-c74904a17021\nginx-rtmp-module\ngx_rtmp.h
  34. #if (NGX_WIN32)
  35. //typedef __int8 int8_t;
  36. typedef unsigned __int8 uint8_t;
  37. #endif
  38. Note: int8_t 已经在 gcc 里定义过
  39.  
  40. nginx-c74904a17021\objs\ngx_auto_config.h
  41. #ifndef NGX_PREFIX
  42. //#define NGX_PREFIX "/usr/opt/nginx-1.15.9/"
  43. #define NGX_PREFIX "./"
  44. #endif
  45. Note: NGX_PREFIX 定义成 /usr/opt/nginx-1.15.9/ windows 系统无法正确地找到目录
  46.  
  47. nginx-c74904a17021\objs\Makefile
  48. //CC = cc
  49. CC = gcc
  50. Note: MSYS 没有 cc
  51.  
  52. //advapi32.lib ws2_32.lib /usr/build/libs/nginx-c74904a17021/libs/pcre-8.43/.libs/libpcre.a /usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r/.openssl/lib/libssl.a /usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r/.openssl/lib/libcrypto.a -lgdi32 -lcrypt32 -lws2_32 /usr/build/libs/nginx-c74904a17021/libs/zlib-1.2.11/libz.a
  53. -l advapi32 -l ws2_32 /usr/build/libs/nginx-c74904a17021/libs/pcre-8.43/.libs/libpcre.a /usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r/.openssl/lib/libssl.a /usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r/.openssl/lib/libcrypto.a -lgdi32 -lcrypt32 -lws2_32 /usr/build/libs/nginx-c74904a17021/libs/zlib-1.2.11/libz.a
  54. Note: MSYS 不支持 advapi32.lib ws2_32.lib
  55.  
  56. 5. 编译安装
  57. make
  58. make install
  59.  
  60. opt\nginx-1.15.9\sbin\nginx.exe 移到 opt\nginx-1.15.9\nginx.exe
  61. opt\nginx-1.15.9 目录下创建 nginx-1.15.9\temp\hls
  62.  
  63. 修改 nginx.conf 文件
  64. nginx-1.15.9-v2\conf\nginx.conf
  65.  
  66. worker_processes 1;
  67. error_log logs/error.log info;
  68. events {
  69. worker_connections 1024;
  70. }
  71.  
  72. rtmp {
  73. server {
  74. listen 1935;
  75. application live {
  76. live on;
  77. }
  78. application hls {
  79. live on;
  80. hls on;
  81. hls_path temp/hls;
  82. hls_fragment 8s;
  83. }
  84. }
  85. }
  86.  
  87. http {
  88. server {
  89. listen 8080;
  90. location / {
  91. root html;
  92. }
  93.  
  94. location /stat {
  95. rtmp_stat all;
  96. rtmp_stat_stylesheet stat.xsl;
  97. }
  98.  
  99. location /stat.xsl {
  100. root html;
  101. }
  102.  
  103. location /hls {
  104. #server hls fragments
  105. types{
  106. application/vnd.apple.mpegurl m3u8;
  107. video/mp2t ts;
  108. }
  109. alias temp/hls;
  110. expires -1;
  111. }
  112. }
  113. }
  114.  
  115. 运行 nginx.exe
  116.  
  117. 6. 测试
  118. 安装 Screen Capturer Recorder v0.12.10
  119. https://sourceforge.net/projects/screencapturer/files/
  120.  
  121. 创建 streaming.cmd
  122. @echo off
  123. set bitrate=1200
  124. set maxrate=2400
  125. set x264=-look_ahead 0 -ac 2 -c:v h264_qsv -profile:v high -level 3.1 -preset:v veryfast
  126. set ki=-keyint_min 72 -g 72 -sc_threshold 0
  127. set br=-b:v %bitrate%k -minrate %bitrate%k -maxrate %maxrate%k -bufsize %maxrate%k -b:a 128k
  128. set vf=-vf crop=854:480:1920-854:0,fps=fps=24
  129. set deskdev=-f dshow -i video="screen-capture-recorder" -f dshow -i audio="virtual-audio-capturer"
  130.  
  131. ffmpeg -threads 4 -hide_banner -rtbufsize 512M -re %deskdev% %ki% %vf% %x264% %br% -f flv rtmp://localhost:1935/live/
  132.  
  133. pause
  134.  
  135. 创建 pull.cmd
  136. @echo off
  137. ffplay.exe rtmp://localhost:1935/live/
  138.  
  139. 执行 streaming.cmd 执行 pull.cmd
  140. 如果能正常播放说明成功了
  141.  
  142. 下载编译好的程序包
  143. https://files.cnblogs.com/files/nlsoft/nginx-1.15.9_rtmp-module-1.2.1_bin.7z

MSYS 编译 nginx rtmp-module的更多相关文章

  1. 转:Nginx RTMP 功能研究

    看点: 1.    Nginx 配置信息与使用.  (支持 rtmp与HLS配置) 2.    有ffmpeg 编译与使用,    命令行方式来测试验证客户端使用. 转自:http://blog.cs ...

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

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

  3. Android中直播视频技术探究之---视频直播服务端环境搭建(Nginx+RTMP)

    一.前言 前面介绍了Android中视频直播中的一个重要类ByteBuffer,不了解的同学可以 点击查看 到这里开始,我们开始动手开发了,因为我们后续肯定是需要直播视频功能,然后把视频推流到服务端, ...

  4. 使用 ffmpeg nginx rtmp 搭建实时流处理平台

    环境: ubuntu 16.04 问题引入: 使用 opencv 获取摄像头数据帧, 进行处理之后(如进行 keypoint 识别), 将 opencv 中图像的 Mat类型转化为 ffmpeg 的 ...

  5. (转)Nginx+rtmp+ffmpeg搭建流媒体服务器

    (1)下载第三方扩展模块nginx-rtmp-module # mkdir module && cd module //创建一个存放模块的目录 # wget https://githu ...

  6. Windows编译Nginx源码

    Windows下的Nginx战役,人不作就不会死!就像是拿着麦当劳的优惠券去买肯德基一样,别扭啊 Nginx是一款轻量级的Web 服务器.反向代理服务器.邮件服务器等等集一大串荣誉于一身的大牌人物!他 ...

  7. 编译nginx的源码安装subs_filter模块

    使用nginx的反向代理功能搭建nuget镜像服务器时,需要针对官方nuget服务器的响应内容进行字符串替换,比如将www.nuget.org替换为镜像服务器的主机名,将https://替换为http ...

  8. How to Customize Server Header using NginX headers-more module

    http://wiki.nginx.org/HttpHeadersMoreModule#Version headers_more When you are browsing a website, yo ...

  9. nginx上传模块—nginx upload module-

    一. nginx upload module原理 官方文档: http://www.grid.net.ru/nginx/upload.en.html Nginx upload module通过ngin ...

随机推荐

  1. 放下VS2010,拥抱VS2019

    VS2019 再过几天就要正式发布了,我们还在使用 VS2010 进行软件开发.由于所处行业环境及项目类型,加之之前的代码积累,所以即使不用新的开发环境.新的语言技术也能比较好的完成工作.那究竟要不要 ...

  2. web services + soap + wsdl 学习

    什么是web services? 应用程序组件: 使用开放协议进行通信: 独立(self - contained )并可自我描述: 可通过使用UDDI来发现: 可被其他应用程序使用: XML是Web ...

  3. Nginx 过滤sub模块

    L70 通过 --with-http_sub_module 编译进nginx sub_filter 指令 Syntax: sub_filter string replacement; Default: ...

  4. Git源码管理工具使用

    注明:双击tap键为自动补全操作 1.视频地址:http://www.newbieol.com/course/index_102.html 2.sourcetree是一个拥有界面的git工具吧 下载官 ...

  5. .Net Core 环境下构建强大且易用的规则引擎

    本文源码: https://github.com/jonechenug/ZHS.Nrules.Sample 1. 引言 1.1 为什么需要规则引擎 在业务的早期时代,也许使用硬编码或者逻辑判断就可以满 ...

  6. 我的python之路

    一.基础语法 Python基础—基本语法结构 Python基础—程序控制结构 Python基础—基本数据类型 Python基础—文件的读写操作 二.函数 Python基础—初识函数 Python基础— ...

  7. wiki leaks file link url

    wiki leaks file link url XXX发表于2010-08-07 15:54:56 原始来源:http://www.wikileaks.org/wiki/Category:China ...

  8. 数据库设计很棒的参考CDM-PDM-LDM-PowerDesigner

    此页面显示了涵盖主题领域的  50 个类别中的行业特定数据模型列表,用于创建企业数据模型. 以下是我们所有 1,700 多种数据模型的字母顺序列表 1. 广告 1. 顾客 1. 派对 1.   广告中 ...

  9. opencontrail—VXLAN模式下数据包的传输过程

    在这篇文章中,我们将看到VM生成的数据包如何能够到达另一个VM或外部资源,Neutron使用OpenContrail插件的上下文中的关键概念/组件是什么. 我们将重点介绍OpenContrail,它如 ...

  10. [USACO19FEB]Mowing Mischief

    题目大意: 给定平面上的一些点,求这些点的一个\(LIS\),并且还需要满足下列式子最小: \[ \sum_{i=1}^{n-1}(a[i+1].x-a[i].x)*(a[i+1].y-a[i].y) ...