nginx+rtmp+ffmpeg,windows下編譯

nginx:1.15.7(http://nginx.org/en/download.html)

note:單獨下載的源碼包裏包含makefile,但是還需要下載最新的源碼,因爲官方download給的鏈接下載的文件裏面會缺少很多源碼。vs編譯的時候會提示無法生成相應.o文件。所以要下載最新源碼覆蓋進去。

nginx-rtmp-moudle:1.1.4(https://github.com/arut/nginx-rtmp-module)

pcre:pcre-8.42(http://www.pcre.org/)

zlib:zlib-1.2.11(http://www.zlib.net/)

openssl:openssl-1.0.2p(http://www.openssl.org/)

步驟:

  1. 在nginx文件目錄中新建objs,然後在其內再新建lib文件夾,把上面4個源碼包放進去。
  2. 然後用mingw32,或msys2的mingw32,cd到nginx目錄進行配置生成文件會放置到objs目錄下。

./configure \
--with-cc=cl \
--with-debug \
--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-8.42 \
--with-zlib=objs/lib/zlib-1.2.11 \
--with-openssl=objs/lib/openssl-1.0.2p \
--with-openssl-opt=no-asm \
--with-select_module \
--with-http_ssl_module \
--add-module=objs/lib/nginx-rtmp-module
 

  1. 打開vs2015的命令行窗口,用x64和x86兼容的,開始編譯

nmake -f objs/Makefile

  1. 編譯後在objs下生成的exe目錄下增加tmp,temp,conf,logs,html文件夾,並把nginx下的conf中的配置文件拷到objs下的conf中,配置好後就可以啓動nginx.exe了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章