环境
系统环境:opensuse 12
需求
利用nginx和ffmpeg搭建流媒体服务器(直播流),其他流后续会有所更新
关于
用
Nginx
搭建
flv,mp4,hls
流媒体服务器
的技术干货!
模块
:nginx_mod_h264_streaming
(支持
h264
编码
MP4
格式的视频)
模块
:http_flv_module
(支持
flv
)
模块
:http_mp4_module
(支持
mp4
)
模块
: nginx-rtmp-module
(支持
rtmp
协议,也支持
HLS
)
步骤
(
1
)模块下载和解压
wget http://nginx.org/download/nginx-1.6.0.tar.gz
wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
wget http://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
wget -O nginx-rtmp-module.zip
https://github.com/arut/nginx-rtmp-module/archive/master.zip
将所有模块统一放置在/usr/local/nginx_sources目录下,方便管理
安装步骤:openssl-->zlib-->pcre
1.openssl
./config
--prefix=/usr/local/openssl -->make -->make install
2. zlib
./configure --prefix=/usr/local/zlib-->make -->make install
3.pcre
./configure ==prefix=/usr/local/pcre -->make -->make install
(
2
)配置命令,会生成
makefile
文件
cd /usr/local/nginx-1.6.0
./configure \
--prefix=/usr/local/nginx \
--add-module=
/usr/tmp
/nginx_mod_h264_streaming-2.2.7 \
--add-module=
/usr/tmp
/nginx-rtmp-module
-master
\
--with-http_flv_module \
--with-http_mp4_module \
--with-http_stub_status_module \
--with-http_ssl_module \