There are some licensing issues with some components of
ffmpeg making it unpalatable to include in certain configurations for most distros, I think -- probably you are aware of this. Also, it includes a set of libraries that have been replaced some places with the libav fork.
If you are looking for static binaries, they're here. If that has not worked for you,1 it is not hard to build and install from source, in which case you can configure it anyway you want. The source tarballs are further down that page. The wiki has a page about compiling and installing on CentOS, although it is into
$HOME, which is probably not what unless you have to (because, e.g., it's not your computer). Presuming it is your computer I'll give you a alternate-parallel guide to install it system-wide, which is preferable. You must do ALL of this
su root or via
sudo. It's simpler than it looks, BTW; 5 simple steps:
Make sure you have the pre-reqs:
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel.
mkdir -p /usr/local/src. Then move the tarball into there and unpack it:
tar -xjf ffmpeg-2.1.3.tar.bz2 if you got the bzip2 ball or
tar -xzf ffmpeg-2.1.3.tar.gz if you got the gzip ball. You may need to
yum install tar (and/or
gzip) if you don't have those already. Once all that's done, move into the created directory:
The potentially complicated part is configuration. You haven't said exactly what you want this for, but if it is just recoding from one common format to another, the default should be fine; I did this recently and I think it includes everything it can, but to be sure you may want to have a look at the list of available encoders and decoders:
If there's anything there you know you want, you can make sure it gets built by including
--enable-decoder) when you configure. Presuming you are not re-distributing this, you might as well also use
--enable-nonfree,1 which is the stuff the distros definitely leave out of their builds (and, I'd guess, the static binaries). So for example:
./configure --enable-encoder=mpeg4 --enable-encoder=pcm_u8 --enable-decoder=wmv3 --enable-nonfree --enable-gpl
The last one (
--enable-gpl) isn't enabled by default but pretty much everyone will want it; for more information, look at
./configure --help | less. Don't go crazy with this by listing every single encoder; I'm pretty sure they almost all get build in anyway. Choose one or two if you want and then if something doesn't work out, you can rebuild and re-install; it is easier the second time.
Before you do the configure, have a look at the various libraries listed at the top of the wiki page under "Compilation & Installation" (x264, libfdk_aac, etc.) to see if there's anything there you want. You probably don't; if you don't recognize anything, don't worry about it. If you do:
Follow the directions there but leave out the
--bindir="$HOME/bin switches to the individual
ldconfig and make sure your $PATH is correct after that, see step #5.2 To be clear: you only need to do this now if you built third party libs.
Build, check, install. If configure does not exit cleanly, leave a comment here with the output. Otherwise go ahead and
make. If you have a multi-core system, speed that up with
make -j N where N is a number of cores (your total - 1 is good if you want to use the system during the compile, total + 1 is ideal if you don't).
If the build finished without error,
make test (if that doesn't do anything
make check -- I can't remember which is used). That should take a minute or two and finish without any failures. At that point you can do a
Set paths. The tools were installed into
/usr/local/bin, so make sure that is at the beginning of your path, e.g.:
> echo $PATH
/usr/bin and likewise with
sbin. This means if some distro version is installed, your custom one will take precedence. If your $PATH is not like that, create an
/etc/profile.d/local.sh with one line in it:
I'm not worried about
sbin since nothing from ffmpeg (or generally, anything else) ends up there. Also execute that line now in in your current terminal. Other users will have to log in again to make it effective.
Finally, you need to make sure the libraries are available to the system linker (see
man ldconfig). Check:
grep /usr/local/lib /etc/ld.so.conf.d/*
If you do not get any output, create a file
/etc/ld.so.conf.d/local.conf with one line:
You can add
/usr/local/lib64 on a 64-bit system. Ffmpeg doesn't install to there but some things do and you may end up doing this again with those somethings one day.
ldconfig. This is crucial. Without that, the system won't be able to find the libraries the
ffmpeg binary is linked to.
You can undo all this with
make uninstall. As mentioned in step #3, you can also re-built/install again later if you want to change the configuration. First
make clean then start from #3 (you don't have to
make uninstall first). At #5 all you'll have to do is
ldconfig this time.
1. See my comment about
--enable-nonfree in step #3. I haven't used the static binaries, but my guess is they do not include everything.
2. So the procedure if you are also building third party libs is to make and install all of them, then proceed with step #5, then #4, then all you have to do from #5 again afterward is run