FFmpeg + FFmpeg-PHP + Mplayer + Mencoder + flv2tool + LAME MP3 Encoder + Libog[PHPMOTION_PHP5,Video Share Enterprise]在网上的一个视频分享整站程序,需要上边的环境才能正常运行.最近我正好做了这个环境.所以记录了一个文档,方便大家参考.安装简介:请先准备及安装下列需要1.) MySQL (version 4 or higher)2.) PHP (version 4.2.3 or higher)3.) FFmpeg (http://ffmpeg.mplayerhq.hu)4.) FFmpeg-PHP (http://ffmpeg-php.sourceforge.net)5.) Mplayer + Mencoder (http://www.mplayerhq.hu/design7/dload.html )6.) flv2tool (http://inlet-media.de/flvtool2)7.) LAME MP3 Encoder8.) Libogg + Libvorbis (http://www.xiph.org/downloads)上传后运行http://***/install/安装完成后修改config.php里$config['ffmpeg'] = "/usr/local/bin/ffmpeg"; // FFmpeg path$config['mplayer'] = '/usr/local/bin/mplayer'; // Mplayer path$config['mencoder'] = '/usr/local/bin/mencoder'; // Mencoder path$config['metainject'] = '/usr/local/bin/flvtool2'; // Path where the flvtool2 is installed改成你实际环境.-----------------------------------------------------------------------------------------Author : ecoreWebsite: http://ecore.ishacker.orgDate : 2007-12-241.[root@fc8 ~]# wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz2.[root@fc8 ~]# wget http://cn2.php.net/distributions/php-5.2.5.tar.gz3.[root@fc8 ~]# wget http://ftp.plusline.de/mysql/Dow ... mysql-5.0.51.tar.gz4.[root@fc8 ~]# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg5.[root@fc8 ~]# wget http://jaist.dl.sourceforge.net/ ... mpeg-php-0.5.1.tbz26.[root@fc8 ~]# wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz7.[root@fc8 ~]# wget http://nchc.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz8.[root@fc8 ~]# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz9.[root@fc8 ~]# wget http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz210.[root@fc8 ~]# wget http://www1.mplayerhq.hu/MPlayer ... al-20071007.tar.bz211.[root@fc8 ~]# wget http://www.mplayerhq.hu/MPlayer/ ... cs-20040703.tar.bz212.[root@fc8 ~]# wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz下载了所有要用到的包.接着我们来编绎安装.----------------------------------------------------------------------------------第一步安装,mysql[root@fc8 ~]# groupadd mysql[root@fc8 ~]# useradd -g mysql mysql[root@fc8 ~]# tar -zxvf mysql-5.0.51.tar.gz[root@fc8 ~]# cd mysql-5.0.51[root@fc8 mysql-5.0.51]# ./configure --prefix=/usr/local/mysql[root@fc8 mysql-5.0.51]# make;make install[root@fc8 ~]# cp support-files/my-medium.cnf /etc/my.cnf[root@fc8 ~]# cd /usr/local/mysql[root@fc8 ~]# bin/mysql_install_db --user=mysql[root@fc8 ~]# chown -R root .[root@fc8 ~]# chown -R mysql var[root@fc8 ~]# chgrp -R mysql .[root@fc8 ~]# bin/mysqld_safe --user=mysql &[root@fc8 ~]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.0.51-log Source distributionType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> show datebase;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'datebase' at line 1mysql> show databases;+--------------------+| Database |+--------------------+| information_schema | | mysql | | test | +--------------------+3 rows in set (0.00 sec)mysql> exitByemysql到此安坟完毕.-------------------------------------------------------------------------------------------------第二步安装apache.[root@fc8 ~]# tar -zxvf httpd-2.2.6.tar.gz[root@fc8 ~]# cd httpd-2.2.6[root@fc8 httpd-2.2.6]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite[root@fc8 httpd-2.2.6]# make;make install[root@fc8 apache2]# /usr/local/apache2/bin/apachectl start[root@fc8 apache2]# netstat -anp|grep httpdtcp 0 0 :::80 :::* LISTEN 19294/httpd [root@fc8 apache2]# apache完装完毕.--------------------------------------------------------------------------------------------------安装flvtool[root@fc8 flvtool2_1.0.5_rc6]# yum install ruby[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb config[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb setup[root@fc8 flvtool2_1.0.5_rc6]# ruby setup.rb install安装lame[root@fc8 ~]# tar -zxvf lame-3.97.tar.gz[root@fc8 ~]# cd lame-3.97 [root@fc8 lame-3.97]# ./configure [root@fc8 lame-3.97]#make;make install安装libogg[root@fc8 software]# tar -zxvf libogg-1.1.3.tar.gz [root@fc8 software]# cd libogg-1.1.3[root@fc8 software]# ./configure;make;make install安装libvorbis[root@fc8 ~]# tar -zxvf libvorbis-1.2.0.tar.gz [root@fc8 ~]# cd libvorbis-1.2.0[root@fc8 libvorbis-1.2.0]#./configure;make;make install安装ffmpeg[root@fc8 software]# cd ffmpeg[root@fc8 ffmpeg]# ./configure --enable-shared[root@fc8 ffmpeg]# make;make install安装mplayer[root@fc8 ~]# mkdir -p /usr/local/lib/codes[root@fc8 ~]# mkdir -p /usr/local/lib/win32codcs[root@fc8 ~]# tar -jxvf essential-20071007.tar.bz2[root@fc8 ~]# cp -rf essential-20071007/* /usr/local/lib/codes/[root@fc8 ~]# tar -jxvf win32codecs-20040703.tar.bz2 [root@fc8 software]# cp -rf win32codecs-20040703/* /usr/local/lib/win32codcs/[root@fc8 ~]# tar -jxvf MPlayer-1.0rc2.tar.bz2 [root@fc8 MPlayer-1.0rc2]# ./configure --prefix=/usr/local/mplayer --enable-gui --enable-freetype --codecsdir=/usr/local/lib/codes --win32codecsdir=/usr/local/lib/win32codcs[root@fc8 MPlayer-1.0rc2]# make;make install安装ffmpeg-php.X.XX.tar.gz1. Unpack the archivetar -xjf ffmpeg-php.X.XX.tar.gz2. cd into the ffmpeg extension directorycd ffmpeg-php.X.XX/3. Run phpize (included with your php install) to build configuration filesphpize//这里要用到phpize程序,机子里可能没有,没关系先编绎一个出来,然后用完再删除.4. Configure and build./configure && make5. Install the shared extension make install (as root)6. Unpack the archive and copy the ffmpeg extension directory into your the php sources extensions directory# cp /usr/local/bin/ffmpeg /path/to/php_sources/extcp /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so /path/to/php_sources/ext7. Run autoconf to rebuild the php configure script and add the --with-ffmpeg optioncd /path/to/php_sourcesautoconf8. 第三步安装php.(使用最新版apache+php整合时,有可能会出现问题,这个时候换低版本的测试.)[root@fc8 ~]# tar -zxvf php-5.2.4.tar.gz [root@fc8 php-5.2.4]# cd php-5.2.4[root@fc8 php-5.2.4]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql \--with-config-file-path=/usr/local/php5/etc --with-ffmpeg=yes[root@fc8 php-5.2.4]# make;make test;make install[root@fc8 php-5.2.4]# cp php.ini-dist /usr/local/php5/etc/php.ini安装完毕后,会在apache2的moudle目录下生成一个php*.so文件.检查httpd.conf文件是否自动加入php相关配置。如果没有手工加入.LoadModule php5_module modules/libphp5.soAddType application/x-httpd-php .php .php4 .php5AddType applicatoin/x-httpd-php-source .phps然后在apache的htdocs目录下,写一个test.php文件内容如下:重启apache.然后访问http://ip/test.php -------------------------------------------------------------------------------------------extension = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so把这面这一句加入php.ini把ffmpeg-php-0.5.1目录下的test_ffmpeg.phptests目录都cp到apache的htdocs下边.重启apache测试.http://192.168.0.2/test_ffmpeg.php-----------------------------------------------------------------------------------------将论论上传,然后运行安装程序.[ 本帖最后由 Ecore 于 2007-12-25 14:22 编辑 ]-----好复杂的啊,先顶起来再说-----这是配波客吗?----- 首先多谢分享经验.我搜了下你说的那个程序.没找到..是否拼错了或者是别的名字?----- found-----没想到网上到处都有转载.呵呵.