nginx支持flv MP4 扩展nginx_mod_h264_streaming,nginx-rtmp-module-master,yamdi

本文介绍 Nginx 的安装配置过程,包括自定义安装路径、日志位置及加载第三方模块等步骤,适用于希望深入了解 Nginx 高级配置的读者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

复制代码

./configure \
--prefix=/usr/local/nginx \
--sbin-path=/usr/local/nginx/sbin/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--error-log-path=/usr/local/nginx/log/error.log \
--http-log-path=/usr/local/nginx/log/access.log \
--pid-path=/usr/local/nginx/var/nginx.pid \
--lock-path=/usr/local/nginx/var/nginx.lock \
--http-client-body-temp-path=/tmp/clientbody \
--http-proxy-temp-path=/tmp/proxy \
--http-fastcgi-temp-path=/tmp/fastcgi \
--http-uwsgi-temp-path=/tmp/uwsgi \
--http-scgi-temp-path=/tmp/scgi \
--user=www \
--group=www \
--with-file-aio \
--with-http_realip_module \
--with-http_ssl_module \
--with-openssl=/usr/local/src/openssl \
--with-http_gzip_static_module \
--with-zlib=/usr/local/src/zlib \
--with-http_stub_status_module \
--with-pcre=/usr/local/src/pcre \
--without-select_module \
--without-poll_module \
--without-http_ssi_module \
--without-http_userid_module \
--without-http_geo_module \
--without-http_empty_gif_module \
--without-http_map_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_flv_module \
--with-http_mp4_module \
--add-module=/usr/local/src/nginx_mod_h264_streaming-2.2.7 \ 
--add-module=/usr/local/src/nginx-rtmp-module-master  

注意第三方模块使用的是add-module指定的绝对路径
yamdi

  tar xzvf yamdi-1.4.tar.gz

                   cd yamdi-1.4

           make && make install

      使用方法:yamdi -i input.flv -o out.flv

  

/usr/local/src 所有的文件都在这个目录

 tar xzvf nginx_mod_h264_streaming-2.2.7

 tar xzvf nginx-rtmp-module-master 



即可编译的时候指定路径
--with-http_flv_module \
--with-http_mp4_module \
--add-module=/usr/local/src/nginx_mod_h264_streaming-2.2.7 \ 
--add-module=/usr/local/src/nginx-rtmp-module-master  

make
会出错

vi nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c
:set nu
158行
if (r->zero_in_uri)
{
return NGX_DECLINED;
}
注释掉
/*if (r->zero_in_uri)
{
return NGX_DECLINED;
}*/
保存
在使用配置./configure 上面的那一段↑
make
make install
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值