CentOS 5.x 上配置 FFmpeg, Lame,Mplayer, Mencoder, FFmpeg-PHP

0
518

买vps用来做什么呢?Youtube这么火,youtube clone的script网上一搜一大堆有同学想过自己建个视频分享的网站吗?那么,怎么让vps支持流媒体呢?

以下安装的过程来自互联网,经测试可行,我就偷偷懒了 :oops, 不过后面我修改了一下让他更好的运行在Kloxo下:

首先做下准备工作:

yum update
yum upgrade
yum install libjpeg-progs libjpeg62 libjpeg62-dev libsdl1.2-dev php5-dev build-essential unzip


一. 安装所需程序库的RPM包到 centos 5.x

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran
yum install subversion ruby ncurses-devel

二. 安装 ffmpeg, mplayer, mencoder 等模块

yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2

三. 安装 Lame

cd /usr/local/src
wget http://sourceforge.net/projects/lame/files/lame/3.98.2/lame-398-2.tar.gz/download
tar zxvf lame-398-2.tar.gz
cd /usr/local/src/lame-398-2
./configure
make && make install

==========================================
CentOS 5: Make Command not Found
make Installation through SSH.

yum -y install gcc automake autoconf libtool make

================================================

四. 安装 FFMPEG-PHP

cd /usr/local/src
wget http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar jxvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure
make
make install

然后在etc/php.d文件夹下新建一个ffmpeg.ini文件

vi /etc/php.d/ffmpeg.ini

在ffmpeg.ini文件加上这句

extension=ffmpeg.so

然后重新启动lighttpd

service lighttpd restart

运行

php -m | grep ffmpeg 检查一下是否成功!