下载ffmepg源码包和ffmpeg-php包,如下:

#wget http://www.ffmpeg.org/releases/ffmpeg-export-snapshot.tar.bz2
#wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=ncu


首先安装ffmepg

#tar -jxvf  ffmpeg-export-snapshot.tar.bz2

#cd ffmpeg

#./configure --prefix=/usr/local/ffmpeg --disable-yasm --enable-shared

#make && make install

#echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf

#ldconfig -v

#/usr/local/ffmpeg/bin/ffmpeg

FFmpeg version SVN-r22144-snapshot, Copyright (c) 2000-2010 the FFmpeg developers  
 built on Mar 30 2010 23:53:53 with gcc 4.1.2 20080704 (Red Hat 4.1.2-46)  
 configuration: --prefix=/usr/local --enable-shared  
 libavutil     50. 9. 0 / 50. 9. 0  
 libavcodec    52.55. 0 / 52.55. 0  
 libavformat   52.54. 0 / 52.54. 0  
 libavdevice   52. 2. 0 / 52. 2. 0  
 libswscale     0.10. 0 /  0.10. 0


安装ffmepg-php

#tar -jxvf ffmpeg-php-0.6.0.tbz2

#cd ffmepg-php

#/usr/local/php/bin/phpize

#./configure --with-php-config=/usr/local/php/bin/php-config  --with-ffmpeg=/usr/local/ffmepg

#make && make install

报错情况

make: *** [ffmpeg-php.lo] 错误 1

解决:

# mv ffmpeg-php.loT ffmpeg-php.lo


make: *** [ffmpeg_movie.lo] 错误 1

解决:

# mv ffmpeg_movie.loT ffmpeg_movie.lo


make: *** [ffmpeg_frame.lo] 错误 1

解决:

# mv ffmpeg_frame.loT ffmpeg_frame.lo


make: *** [ffmpeg_errorhandler.lo] 错误 1

解决:

# mv ffmpeg_errorhandler.loT ffmpeg_errorhandler.lo


make: *** [ffmpeg_tools.lo] 错误 1

解决:

# mv ffmpeg_tools.loT ffmpeg_tools.lo


在php.ini中加入extension=ffmpeg.so