И так, качаем все это ПО:

cd /usr/local/src/
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
wget http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.2.0.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.tar.gz
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget http://ffmpeg.org/releases/ffmpeg-0.6.tar.gz
wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2


Розархивируем:

tar xvzf flvtool2-1.0.6.tgz
tar xvzf lame-3.98.4.tar.gz
tar jxvf ffmpeg-php-0.6.0.tbz2
tar xvzf libogg-1.2.0.tar.gz
tar xvzf libvorbis-1.3.1.tar.gz
tar jxvf essential-20071007.tar.bz2
tar jxvf mplayer-export-snapshot.tar.bz2
tar xvzf ffmpeg-0.6.tar.gz

Создаем директорию для кодеков

mkdir /usr/local/lib/codecs/

Ставим нужные пакеты

yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++  ncurses-devel

Копируем кодеки к mplayer

mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

Устанавливаем Lame

cd /usr/local/src/lame-3.98.4
./configure
make && make install

Устанавливаем Libogg

cd /usr/local/src/libogg*
./configure
make && make install

Устанавливаем Libvorbis

cd /usr/local/src/libvorbis*
./configure
make && make install

Устанавливаем flvtool2

cd /usr/local/src/flvtool*
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Устанавливаем Mplayer

cd /usr/local/src/mplayer*
./configure
make && make install

Если требует Git тогда мануал по установке можно найти здесь https://unix.yourmir.info/stavim-git-na-centos-5/
Если требует yasm, тогда подключаем репозиторий и ставив
Для 32 битной системы

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Для 64 битной системы

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum install yasm

Устанавливаем ffmpeg

cd /usr/local/src/ffmpeg-*
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make && make install

Если выдает ошибку

Unable to create and execute files in /tmp.  Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
Sanity test failed.
 
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

экспортируем /tmp в другую директорию

export TMPDIR=/root/tmp

Создаем символические линки

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

Ставим ffmpeg экстэншин

cd /usr/local/src/ffmpeg-php*
phpize
./configure
make && make install

Если выдает ошибки:

 gcc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -I/usr/include/php -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c  -fPIC -DPIC -o .libs/ffmpeg_frame.o
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_toGDImage':
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_ffmpeg_frame':
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: 'PIX_FMT_RGBA32' undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1

тогда нужно отредактировать файл ffmpeg_frame.c. Заменить PIX_FMT_RGBA32 на PIX_FMT_RGB32

replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- ffmpeg_frame.c

или так

vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:wq!

проверяем или ffmpeg.so находится правильной extensions_dir

php -i | grep extensions

Результат:
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20060613 => /usr/local/lib/php/extensions/no-debug-non-zts-20060613

ls -la /usr/local/lib/php/extensions/no-debug-non-zts-20060613

если в extensions_dir есть ffmpeg.so, тогда добавляем экстэншин в php.ini

echo 'extension=ffmpeg.so' >> /usr/local/lib/php.ini
echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> /etc/bash.bashrc
echo "export LD_LIBRARY_PATH" >> /etc/bash.bashrc
ldconfig

Рестартуем Apache

service httpd restart

Проверяем или ffmpeg установлен корректно (как PHP модуль)

php -m | grep ffmpeg
ffmpeg