Ubuntu 14.10下基于Nginx搭建mp4/flv流媒体处事器(可随意拖动)并支持RTMP/HLS协议(含转码东西)
最近因为项目干系,收伴侣之托,想建造秀场网站,可是因为之前一直没有涉及到这方面的对象,没有什么感受可言;搜索了一些资料今后,固然有开业的实现方法,可是各人都没有完成的说明的,可能说我还没有更深入的研究到。不外让我找到了关于假设流媒体播放器的资料,不外是基于CentOS的操纵(见 CentOS6下基于Nginx搭建mp4/flv流媒体处事器 http://www.linuxidc.com/Linux/2015-08/121324.htm),那我就试做成ubuntu的step by step吧。
步调如下:
step1筹备ubuntu的情况:
sudo apt-get update
期间碰着了一些ubuntu的问题,总之就是倒腾ubuntu的依赖包。
一些指导:
sudo apt-get -f dist-upgrade
sudo apt-get "hljs-keyword">update
sudo apt-get "hljs-keyword">install -f
apt- "hljs-keyword">cache depends linux-{image,headers}-generic
apt- "hljs-keyword">cache rdepend linux-image- "hljs-number">3.16.0--generic:i386
do- "hljs-keyword">release- "hljs-keyword">upgrade 又提示 ubuntu boot空间不敷
然后就是手动的mv 一个 文件到其他处所,腾出boot的空间,然后从头启动reboot,然后再次 apt- "hljs-keyword">get "hljs-keyword">update 就可以了
step2 安装须要的一些libs:
sudo apt-get install build-essential libpcre3 libpcre3-dev
libssl-dev
sudo apt-get install gcc make automake bzip2 unzip patch
subversion libjpeg62-dev
我利用的是root用户
cd ~
mkdir working
wget http://www.tortall. "hljs-winutils">net/projects/yasm/releases/yasm-...tar.gz
tar zxvf yasm-...tar.gz
cd yasm-..
./configure
make && make install
cd ~/working
step3 卸载系统原有的ffmgeg和x.264,没有则跳过:
apt-get remove ffmpeg x264
step4 先安装一些Mplayer编码库(仅限于64位系统):
wget -c http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
tar xvjf essential-amd64-.tar.bz2
mkdir /usr/local/lib/codecs
"hljs-keyword">cp -Rvp essential-amd64-/* /usr/local/lib/codecs/
编辑下面文件
vim /etc/ld. "hljs-keyword">so.conf
添加以下两行到上面的文件里
/usr/lib
/usr/local/lib
step5 再安装一些名目转换常用的编码库:
amrnb opencore-amr amrwb libvorbis libtheora xvidcore
sudo apt-get install build-essential git-core checkinstall
texi2html libfaac-dev
libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev
libtheora-dev
libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev
libxvidcore-dev
"http://www.linuxidc.com/upload/2015_08/150808150174201.png" alt=
"图片" vspace="5">
setp6 安装x.264:
wget
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2
tar xvjf last_stable_x264.tar.bz2
cd x264-snapshot---stable/
./configure -- "hljs-built_in">enable-shared -- "hljs-built_in">enable-pic
make && make install
cd ~/working
setp7 安装libvpx:
wget http://webm.googlecode.com/files/libvpx-v1.4.0.tar.bz2
wget
https://github.com/webmproject/libvpx/releases/tag/v1.4.0
tar xvjf libvpx-v1. "hljs-number">4.0.tar.bz2
cd libvpx-v1. "hljs-number">4.0
./configure -- "hljs-built_in">enable-shared -- "hljs-built_in">enable-pic
make && make install
cd ~/working
step8 安装FFmpeg
wget http://ffmpeg.org/releases/ffmpeg-2.7.2.tar.bz2
tar xvjf ffmpeg- "hljs-number">2.7..tar.bz2
cd ffmpeg-2.7.
./configure -- "hljs-literal">enable-gpl -- "hljs-literal">enable-version3 -- "hljs-literal">enable- "hljs-literal">shared -- "hljs-literal">enable-nonfree -- "hljs-literal">enable-postproc -- "hljs-literal">enable-libfaac -- "hljs-literal">enable-libmp3lame -- "hljs-literal">enable-libopencore-amrnb -- "hljs-literal">enable-libopencore-amrwb -- "hljs-literal">enable-libtheora -- "hljs-literal">enable-libvorbis -- "hljs-literal">enable-libvpx -- "hljs-literal">enable-libx264 -- "hljs-literal">enable-libxvid
make && make install
cd ~/working
让动态链接库被系统共享
ldconfig
step9 安装mplayer and mencoder