NGINX 添加MP4、FLV视频支持模块

简介: 由于公司网站需要放置视频,但是默认的服务器环境是没有编译这个支持的模块,视频文件只能缓冲完了在播放,非常麻烦。   之前呢也安装了一个nginx_mod_h264_streaming来支持,效果很不错,但是服务器最近系统更新后出了点问题,只好从新编译,今天在nginx官网看到了nginx在新版本中已经支持了--with-http_mp4_module --with-http_flv_module这2个模块。

由于公司网站需要放置视频,但是默认的服务器环境是没有编译这个支持的模块,视频文件只能缓冲完了在播放,非常麻烦。

 
之前呢也安装了一个nginx_mod_h264_streaming来支持,效果很不错,但是服务器最近系统更新后出了点问题,只好从新编译,今天在nginx官网看到了nginx在新版本中已经支持了--with-http_mp4_module --with-http_flv_module这2个模块。所以就来自己编译吧。
 
编译之前我们需要看看之前编译的参数,使用nginx -V查看得到如下参数
 
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
 
接下来就进入之前安装的目录,我用的是lnmp1.0的脚本安装的,文件地址在/root/lnmp1.0-full
 
当然我的nginx是我后来更新过的,版本是1.4.3,再次进入nginx-1.4.3这个目录
 
备份之前的程序配置
 
 
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
 
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module
等待结束,查看是否报错(应该不会报错,因为用的都是nginx默认支持的模块,不是外挂的)正常文件如
 
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
 
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
编译
 
 
make
nginx -t
如果提示如下命令就证明没有问题,就可以升级了
 
 
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
 
make install
 
nginx version: nginx/1.4.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module
目录
相关文章
|
2月前
|
负载均衡 应用服务中间件 API
Nginx:location配置模块的用法(一)
Nginx:location配置模块的用法(一)
361 2
|
17天前
|
应用服务中间件 nginx C++
nginx的cgi模块
nginx的cgi模块
17 0
|
2月前
|
缓存 应用服务中间件 nginx
安装nginx-http-flv-module模块
本文介绍如何为Nginx安装`nginx-http-flv-module`模块。此模块基于`nginx-rtmp-module`二次开发,不仅具备原模块的所有功能,还支持HTTP-FLV播放、GOP缓存、虚拟主机等功能。安装步骤包括:确认Nginx版本、下载相应版本的Nginx与模块源码、重新编译Nginx并加入新模块、验证模块安装成功。特别注意,此模块已包含`nginx-rtmp-module`功能,无需重复编译安装。
145 1
|
2月前
|
负载均衡 应用服务中间件 Linux
在Linux中,常用的 Nginx 模块有哪些,常来做什么?
在Linux中,常用的 Nginx 模块有哪些,常来做什么?
|
2月前
|
缓存 前端开发 应用服务中间件
Nginx:location配置模块的用法(二)
Nginx:location配置模块的用法(二)
71 2
|
3月前
|
应用服务中间件 Linux nginx
FFmpeg开发笔记(四十)Nginx集成rtmp模块实现RTMP推拉流
《FFmpeg开发实战》书中介绍了如何使用FFmpeg向网络推流,简单流媒体服务器MediaMTX不适用于复杂业务。nginx-rtmp是Nginx的RTMP模块,提供基本流媒体服务。要在Linux上集成rtmp,需从官方下载nginx和nginx-rtmp-module源码,解压后在nginx目录配置并添加rtmp模块,编译安装。配置nginx.conf启用RTMP服务,监听1935端口。使用ffmpeg推流测试,如能通过VLC播放,表明nginx-rtmp运行正常。更多详情见书本。
102 0
FFmpeg开发笔记(四十)Nginx集成rtmp模块实现RTMP推拉流
|
2月前
|
Ubuntu 前端开发 JavaScript
如何在 Ubuntu 14.04 上为 Nginx 添加 gzip 模块
如何在 Ubuntu 14.04 上为 Nginx 添加 gzip 模块
24 0
|
5月前
|
Ubuntu 应用服务中间件 nginx
ubuntu编译安装nginx及安装nginx_upstream_check_module模块
以上是编译安装Nginx和安装 `nginx_upstream_check_module`模块的基本步骤。根据你的需求和环境,你可能需要进一步配置Nginx以满足特定的要求。
225 3
|
5月前
|
应用服务中间件 数据库 nginx
nginx 第三方模块 与变量
nginx 第三方模块 与变量
|
5月前
|
应用服务中间件 nginx Python
nginx-upload-module模块实现文件断点续传_nginx upload module 断点续传 进度(1)
nginx-upload-module模块实现文件断点续传_nginx upload module 断点续传 进度(1)