These two days to do the video things found Nginx no MP4 video streaming module, today I added a bit, because before is compiled good, so I directly added!
Download
Copy Code code as follows:
#下载解压
wget wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
Tar zxf nginx_mod*.tar.gz
Configuration add
Copy Code code as follows:
#查看编译参数
/usr/local/nginx/sbin/nginx-v
#进入nginx (tengine) Source directory
CD tengine*
./configure--add-module=. /nginx_mod_h264_streaming-2.2.7 \
--user=www--group=www \
--prefix=/usr/local/nginx \
--with-pcre
#只需make不需要make Install
Make
Configuration
Copy Code code as follows:
Mv/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.old
CP Objs/nginx/usr/local/nginx/sbin/nginx
#配置配置文件
Vim/usr/local/nginx/conf/nginx.conf
Location ~ \.mp4$ {
mp4;
}
#测试
/usr/local/nginx/sbin/nginx-t
#平滑重启
/usr/local/nginx/sbin/nginx-s Reload
Need to modify the configuration of the place is quite a lot of small partners to look at carefully, do not miss out.