视频采集服务器部署指南
2015-10-08 14:10
239 查看
1. 环境准备
安装wget:yum install wget -y
安装git:
yum install git -y
安装gcc:
yum install gcc -y
安装
2. 安装nginx
nginx使用源码方式安装,同时安装nginx-rtmp-module, http_flv_module,http_mp4_module, http_gzip_static_module, http_ssl_module2.1 安装依赖
yum -y install pcre pcre-devel zlib-devel openssl openssl-devel
2.2 下载nginx-rtmp-module
wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.7.tar.gz[/code]tar -xzvf v1.1.7.tar.gz2.3 下载nginx源码
wget http://nginx.org/download/nginx-1.9.3.tar.gz[/code]tar -xzvf nginx-1.9.3.tar.gz2.4 编译安装
cd nginx-1.9.3./configure --add-module=../nginx-rtmp-module-1.1.7 --with-http_ssl_module --with-http_mp4_module --with-http_flv_module --with-http_gzip_static_modulemakemake install3. 安装ffmpeg
3.1 安装ffmpeg依赖
yum -y install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
3.1.1 安装yasm
YASM是 libx264和ffmpeg要用到得一个汇编工具git clone --depth 1 git://github.com/yasm/yasm.gitcd yasmautoreconf -fiv./configuremakemake installmake distclean
3.1.2 安装Libx264解码包
libx264 是H.264编解码器, 编译时需指定--enable-gpl--enable-libx264git clone --depth 1 git://git.videolan.org/x264cd x264./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-staticmakemake installmake distclean3.2 安装ffmpeg
git clone --depth 1 git://source.ffmpeg.org/ffmpegcd ffmpegPKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-libx264makemake install4. 配置nginx
rtmp {server {listen 1935;application video {live on;}application hls {live on;hls on;hls_path /tmp/hls;}}}
然后,针对hls,还需要在http里面增加一个location配置location /hls {types {application/vnd.apple.mpegurl m3u8;video/mp2t ts;}root /tmp;add_header Cache-Control no-cache;}
相关文章推荐
- TCP/TP编程 - 一个简单的Linux下C写的socket服务器客户端程序
- java处理内存泄露与内存溢出的学习总结
- Oracle创建表空间、创建用户以及授权、查看权限
- 中文乱码问题
- Hibernate HQL绑定变量
- 批量反编译&生成jar
- protected访问权限
- JS联动下拉框
- oracle建表、序列、触发器
- getAttribute和getParameter区别
- getHibernateTemplate的find方法大全 HQL
- IE打印&分页打印&选择隐藏
- struts1.2之LookupDispatchAction
- Spring中配置数据库连接池
- 重现U盘文件
- MyEclipse快捷键
- 设置Eclipse、MyEclipse默认workspace路径
- javac和java命令
- 怎样去除桌面图标下的蓝底色
- jad插件安装