1. 下载源码
http://hg.nginx.org/nginx
nginx-c74904a17021.zip https://github.com/arut/nginx-rtmp-module
nginx-rtmp-module-master.zip https://www.openssl.org/source/
https://www.openssl.org/source/openssl-1.0.2r.tar.gz https://ftp.pcre.org/pub/pcre/
https://ftp.pcre.org/pub/pcre/pcre-8.43.zip http://www.zlib.net/
http://www.zlib.net/zlib-1.2.11.tar.gz 2. 源码部署
nginx-rtmp-module-master.zip 解压到 nginx-c74904a17021/nginx-rtmp-module
nginx-c74904a17021 目录下创建目录 libs
openssl-1.0.2r.tar.gz pcre-8.43.zip zlib-1.2.11.tar.gz 解压到 nginx-c74904a17021/libs 3. 启动 MSYS 进入 nginx-c74904a17021 目录
最新版本 nginx 的 configure 在 auto 目录下
./auto/configure \
--prefix=/usr/opt/nginx-1.15.9 \
--with-pcre=/usr/build/libs/nginx-c74904a17021/libs/pcre-8.43 \
--with-openssl=/usr/build/libs/nginx-c74904a17021/libs/openssl-1.0.2r \
--with-zlib=/usr/build/libs/nginx-c74904a17021/libs/zlib-1.2.11 \
--add-module=/usr/build/libs/nginx-c74904a17021/nginx-rtmp-module \
--with-http_ssl_module 4. 修改源码
nginx-c74904a17021\nginx-rtmp-module\ngx_rtmp.h
#if (NGX_WIN32)
//typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
#endif
Note: int8_t 已经在 gcc 里定义过 nginx-c74904a17021\objs\ngx_auto_config.h
#ifndef NGX_PREFIX
//#define NGX_PREFIX "/usr/opt/nginx-1.15.9/"
#define NGX_PREFIX "./"
#endif
Note: NGX_PREFIX 定义成 /usr/opt/nginx-1.15.9/ 时 windows 系统无法正确地找到目录 nginx-c74904a17021\objs\Makefile
//CC = cc
CC = gcc
Note: MSYS 没有 cc //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
-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
Note: MSYS 不支持 advapi32.lib ws2_32.lib 5. 编译安装
make
make install opt\nginx-1.15.9\sbin\nginx.exe 移到 opt\nginx-1.15.9\nginx.exe
opt\nginx-1.15.9 目录下创建 nginx-1.15.9\temp\hls 修改 nginx.conf 文件
nginx-1.15.9-v2\conf\nginx.conf worker_processes 1;
error_log logs/error.log info;
events {
worker_connections 1024;
} rtmp {
server {
listen 1935;
application live {
live on;
}
application hls {
live on;
hls on;
hls_path temp/hls;
hls_fragment 8s;
}
}
} http {
server {
listen 8080;
location / {
root html;
} location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
} location /stat.xsl {
root html;
} location /hls {
#server hls fragments
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias temp/hls;
expires -1;
}
}
} 运行 nginx.exe 6. 测试
安装 Screen Capturer Recorder v0.12.10
https://sourceforge.net/projects/screencapturer/files/ 创建 streaming.cmd
@echo off
set bitrate=1200
set maxrate=2400
set x264=-look_ahead 0 -ac 2 -c:v h264_qsv -profile:v high -level 3.1 -preset:v veryfast
set ki=-keyint_min 72 -g 72 -sc_threshold 0
set br=-b:v %bitrate%k -minrate %bitrate%k -maxrate %maxrate%k -bufsize %maxrate%k -b:a 128k
set vf=-vf crop=854:480:1920-854:0,fps=fps=24
set deskdev=-f dshow -i video="screen-capture-recorder" -f dshow -i audio="virtual-audio-capturer" ffmpeg -threads 4 -hide_banner -rtbufsize 512M -re %deskdev% %ki% %vf% %x264% %br% -f flv rtmp://localhost:1935/live/ pause 创建 pull.cmd
@echo off
ffplay.exe rtmp://localhost:1935/live/ 执行 streaming.cmd 后 执行 pull.cmd
如果能正常播放说明成功了 下载编译好的程序包
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. Photoshop入门教程图解版

  2. 一入OI深似海 1 —— 偶然遇见,命运选择

    记得还是三年级(还是四年级?人老了都忘了)吧, 那时候我还是个愣头青, 学校的编程班在每个班强制招人, 我就屁颠屁颠被赶去去上课了. 一开始的课完全听不懂, 导致没过多久我同班的人一个个走了, 我为了 ...

  3. this.$router.push、replace、go的区别

    1.this.$router.push() 描述:跳转到不同的url,但这个方法会向history栈添加一个记录,点击后退会返回到上一个页面. 用法: 2.this.$router.replace() ...

  4. yarn 在Vue框架中的常用命令

    初始化项目 yarn add init 安装vue yarn add vue 安装webpack,webpack-dev-server(是一个小型的Node.js Express服务器) yarn a ...

  5. Maven版本不一致的时候,使用指定版本进行编译

    最近用Maven打包项目(本地jdk11)后放到服务器(jdk8)后,报[java.lang.UnsupportedClassVersionError]版本不一致错误. 网上资料说是修改Intelli ...

  6. 有这iconfont.woff文件 为什么还报404

    解决方法1.打开服务器IIS管理器,找到MIME类型. 2.添加MIME类型 添加三条: 文件扩展名 MIME类型 .svg image/svg+xml.woff application/x-font ...

  7. miui 系统铃声

    MIUI7-8系统铃声和通知铃声等,从miui system.img中提取出来的: 链接:http://pan.baidu.com/s/1bpH5N5P 密码:tz7p

  8. DRF 商城项目 - 购物( 购物车, 订单, 支付 )逻辑梳理

    购物车 购物车模型 购物车中的数据不应该重复. 即对相同商品的增加应该是对购买数量的处理而不是增加一条记录 因此对此进行联合唯一索引, 但是也因此存在一些问题 class ShoppingCart(m ...

  9. (十三)事件分发器——event()函数,事件过滤

    事件分发器——event()函数 事件过滤 事件进入窗口之前被拦截 eventFilter #include "mywidget.h" #include "ui_mywi ...

  10. Vue学习笔记四:跑马灯效果

    目录 跑马灯原理 HTML 箭头函数 计时器 跑马灯效果 跑马灯原理 先讲讲跑马灯的原理,就是一行字,会滚动,思路是这样的,使用substring方法,一个获取字符串的第一个字,一个获取1后面所有的字 ...