Installing FFMpeg and FFMpeg-PHP

Below is a step-by-step how-to on installing ffmpeg and ffmpeg-php on CentOS 5.3. The reason we (or anyone really) have not published a script to automate the process is due to the complexity of the installation and the fact that it is very prone to failures along the way, almost always requiring some sort of human intervention. We have attempted to address the most common of issues in this article, but if you find that you're stuck at one that is not mentioned, please feel free to send support an email.

We have also used very explicit versions of each of the libraries/codecs/software in this guide as we have found these to have the highest rate of success. If you need the additional functionality provided by a newer version of any of these, please note that doing so may break other parts of the installation; caveat emptor!

First start out by downloading the necessary sources. These versions are subject to change so you may want to browse each repo to find the latest version (again caveat emptor!). This also installs Ruby, which is a pre-requisite for installing Flvtool; if you already have Ruby, skip the second line in this step and the first three lines in step 7:

As of this writing, the latest version of Mplayer now requires Git to download it's own copy of the FFMpeg source. CentOS' default repos don't include the RPMs (if yours does, then lucky you!), so here's how to install the needed RPMs manually. Re-run the configure step after you've done this.

Use ./configure --help if you'd like to enable additional libraries/codecs. Many will require additional downloads & builds like those above. Note that after each library/codec install, you'll need to run ldconfig -v.