Incase you are not aware of FFmpeg, it’s a very powerful tool to record, convert and stream audio and video. Its a very rich tool almost supporting every format out there in the world. In fact FFmpeg is the only viable open source variant of its kind. FFmpeg is a must have if you are planning to run a video website with streaming with conversion of video files to different video formats. And once you have FFmpeg you should(if you are PHP user) also add ffmpeg-php, which is an extension for PHP that provides a rich library to access info about audio and video files. It’s not necessary for FFmpeg to function, it’s just ease PHP users’ FFmpeg operations.
This installation/deployment instruction target to Centos users, however will work as well for most Redhat distro as well.
Installing FFmpeg
Using RPM installation is best, but its seems default RPM package installation for FFmpeg don’t work. So to avoid misery installing from source RPM advisable. So lets hit it–
Step One : ‘rpmbuild’ check, install if necessary
check if ‘rpmbuild’ install using following command
# rpm -q rpmbuild
If installation missing, use this command to install ‘rpmbuild’
# yum install rpmbuild
Step Two : prepare for dag packages installation
You will need to add couple of lines in the yum repository for dag packages installation to work. Create a file named dag.repo in /etc/yum.repos.d with the following command
# vi /etc/yum.repos.d/dag.repo
Now add following contents in the file:
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1
Step Three: Install FFmpeg
Once you have done so, do the following as root user to deploy / install FFmpeg
yum install ffmpeg ffmpeg-devel
Installation could take from a minute to 10 minutes. This should be painless without incident, except in some cases you might face rpmforge GPG key warning. Here is how you will resolve it (don’t forget to update the rpmforge-release version to the latest, which you will find under http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS)-
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-VERSION.rpm
Step Four: Troubleshooting
You may Experience missing dependency error like shown below, in the course of FFmpeg installation.
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package xvidcore Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faac Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faad2 Error: Missing Dependency: libgif.so.4 is needed by package imlib2 ...
To resolve dependency error open up your /etc/yum.repos.d/rpmforge.repo and make sure rpmforge packages are same version class to the release of your existing CentOS version. Meaning the URL contain el<CentOS version number>. For example if your CentOS is 5.1 the URL should contain el5 not el4
Install FFmpeg’s PHP extension ffmpeg-php
To install ffmpeg-php from source bundle, first check if ‘php-devel’ is installed.
# rpm -q php-devel
If ‘php-devel’ is missing, install it using:
# yum install php-devel
Now download the current version of ffmpeg-php from here.
wget /path/to/this/file/ffmpeg-php-0.5.2.1.tbz2 tar -xjf ffmpeg-0.5.2.1.tbz2 phpize ./configure make make install
If you are done with above, open ‘/etc/php.ini’ and add a line ‘extension=ffmpeg.so’ under the category ‘Dynamic Extensions’. Now install your apache:
# service httpd restart [Enter] (do as root)
Now your phpinfo() should show the FFmpeg, if the installation was successful.


Comments are closed.