Steps to install FFMpeg & related modules

Steps for installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flvtool2-libogg-libvorbis-lame-mp3:

1. vi /etc/yum.repos.d/dag.repo

2. Insert the following to enable ‘dag’ repository:

name=Dag RPM Repository for Red Hat Enterprise Linux

Given below are few errors & solution which you may face during installation:

Error 1: If you get any error while running yum with key then install the gpg key
using the following command,

rpm –import

If you are still getting the error then you can try “gpgcheck=1” with “gpgcheck=0” in /etc/yum.repos.d/dag.repo (not recommended)

Error 2:

[Errno 14] HTTP Error 404 :
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository:
dag. Please verify its path and try again


Change the URL in ‘/etc/yum.repos.d/dag.repo’. You can find the correct path for the required release by going to : For the above error, changing the URL to ‘’ worked.

3. yum update (Optional/not required)

4. yum install ffmpeg*

5. yum install mplayer*

6. yum install mencoder*

7. yum install ruby ruby-libs ruby-devel amr* (flvtool needs it)

(Note : Libogg + Libvorbis + Lame mp3 will be installed automatically
for dependencies.)

8. Installing flvtool2

# wget
# tar -xzf flvtool2_1.0.5_rc6.tgz
# cd flvtool2_1.0.5_rc6/
# ruby setup.rb config
# ruby setup.rb setup
# ruby setup.rb install

9. Installing FFmpeg-PHP
# wget
# tar -xjf ffmpeg-php-0.6.0.tbz2
# cd ffmpeg-php-0.6.0/
# phpize
# ./configure
# make
# make install

Put the below two lines at the end of the php.ini file


10. Restart apache.

/etc/init.d/httpd restart

Make sure the extention was installed correctly and if not then add the extension correctly in php.ini and restart httpd.

Put a php info page to check whether ffmpeg-php loaded correctly (or)

# php -r ‘phpinfo();’ | grep ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => May 11 2011 18:09:17
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.72.2
ffmpeg libavformat version => Lavf52.64.2
ffmpeg swscaler version => SwS0.11.0
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0

Errors that may occur during installation:
[root@theplanet ffmpeg-php-0.6.0]# phpize
-bash: phpize:

phpize command needs php-devel


yum install php-devel

If the above command fails with below error, install the rpm for correct php-devel version:
php-devel-5.1.6-27.el5_5.3.i386 from base has depsolving problems
–> Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package
php-devel-5.1.6-27.el5_5.3.i386 (base)
Error: Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package
php-devel-5.1.6-27.el5_5.3.i386 (base)

for the above error install rpm
rpm -ivh

Error while configuring ffmpeg-php

….error ‘PIX_FMT_RGBA32’ undeclared…


Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

#vi ffmpeg_frame.c

replace every instance of ? PIX_FMT_RGBA32 ? with ? PIX_FMT_RGB32 ? in
the file by executing



replace ?PIX_FMT_RGBA32 ? ?PIX_FMT_RGB32 ? ? ffmpeg_frame.c

Save the file and compile ?ffmpeg-php? again using the following steps

#make clean
#make install

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: