国家高新企业、双软企业、科创版挂牌企业查看更多资质 全国服务热线0551-65867402 在线咨询 留言/需求提交

ubuntu14.04+nginx+rtmp搭建直播和点播流媒体服务器

【摘要】 ubuntu14.04+nginx+rtmp搭建直播和点播流媒体服务器

命令如下:

apt-get update
apt-get -f dist-upgrade
apt-get install -f
apt-get install build-essential libpcre3 libpcre3-dev libssl-dev g++  yamdi
apt-get install unzip bzip2 gcc make automake patch subversion libjpeg62-dev
apt-get install git-core checkinstall texi2html libopencore-amrnb-dev libopencore-amrwb-dev
apt-get install libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev libxvidcore-dev

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar zxvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make && make install

wget http://ffmpeg.org/releases/ffmpeg-2.7.2.tar.bz2
tar xvjf ffmpeg-2.7.2.tar.bz2
cd ffmpeg-2.7.2
./configure --enable-gpl --enable-version3 --enable-shared --enable-nonfree --enable-postproc --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libxvid
make && make install


wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
tar zxvf nginx_mod_h264_streaming-2.2.7.tar.gz

wget -O nginx-rtmp-module.zip  https://github.com/arut/nginx-rtmp-module/archive/master.zip
unzip nginx-rtmp-module.zip

wget -O ngx_cache_purge.zip https://github.com/FRiCKLE/ngx_cache_purge/archive/master.zip
unzip ngx_cache_purge.zip

wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar zxvf nginx-1.8.0.tar.gz

cd nginx-1.8.0/

./configure --user=daemon --group=daemon --prefix=/usr/local/nginx/ --add-module=../nginx-rtmp-module-master --add-module=../ngx_cache_purge-master --add-module=../nginx_mod_h264_streaming-2.2.7 --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_flv_module

make && make install

wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx
chmod +x /etc/init.d/nginx
update-rc.d nginx defaults
service nginx start
service nginx stop

资讯推荐阅读