I have to say, that the video manipulation program FFMPEG, while very powerful, is not very user-friendly when it comes to installation. While many Linux programs can be happily installed from either a pre-compiled package, or downloading source and compiling yourself, this isn't necessarily the case with FFMPEG. The ease of FFMPEG installation largely depends on how many different video codecs and containers you want to be able to input or output. The greater the number, the exponential increase in installation difficulty. My main need was for FFMPEG to accept a wide range of input formats, while outputting H.264 encoded QuickTime (MOV) files. Here's how I achieved this on a Debian Etch server........
I'm going to assume that you are familiar with using the Linux command prompt, moving between directories, editing text files and have at least some experience compiling programs.
The first thing I would recommend doing is making an addition to your source repository lists.
Add the following line:
deb http://www.debian-multimedia.org stable main
This repository contains some essential libraries for xvid and x264 (an open source H.264 codec) amongst other things. You'll need to install some software from here. The software may well be available from other repositories too, that are already in your sources.list file, but add this one to be safe.
Next rebuild your sources:
I would also recommend installing checkinstall. This program can be used instead of a regular "make install" command and produces a deb package file that will make re-installation or multiple machine installs much easier. If checkinstall isn't already on your machine download it from:
Maybe navigate here with lynx, maybe use wget once you've found the actual file you need, maybe download it with a GUI based web browser and then copy it to your desired directory. It's your choice. I grabbed the latest
dpkg -i checkinstall_1.6.1-1_i386.deb
Checkinstall should have happily installed on your system. Now it's time to really get into FFMPEG.
Build the dependencies:
apt-get build-dep ffmpeg
Next we're going to install a whole lot more useful software that will allow FFMPEG to output many more than just the minimal file types.
apt-get install liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev build-essential subversion,
We've also ensured that you have the necessary tools installed to compile from source (build-essential) and obtain files from the Subversion version control repositories.
We're ready to checkout FFMPEG itself:
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg,
At the time of writing the latest revision was 11212. If you'd feel more comfortable not using the lastest bleeding edge version of FFMPEG, issue the Subversion command as follows:
svn checkout -r 11212 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
This will ensure that you are also downloading the 11212 revision. Once downloaded, move into the ffmpeg directory (cd ffmpeg) and configure:
So, what have we done here......
- gpl - allow use of GPL code, the resulting libav* and ffmpeg will be under GPL
- pp - enable GPLed postprocessing support
- libvorbis - enable Vorbis encoding via libvorbis (http://www.vorbis.com/)
- liba52 - enable GPLed liba52 support (http://liba52.sourceforge.net/)
- libdc1394 - enable IIDC-1394 grabbing using libdc1394 and libraw1394 (http://sourceforge.net/projects/libdc1394/)
- libgsm - enable GSM support via libgsm (http://packages.debian.org/testing/sound/libgsm-tools)
- libmp3lame - enable MP3 encoding via libmp3lame (http://lame.sourceforge.net/download.php)
- libfaad - enable FAAD support via libfaad (http://www.audiocoding.com/faad2.html)
- libfaac - enable FAAC support via libfaac (http://www.audiocoding.com/faac.html)
- pthreads - use pthreads (http://en.wikipedia.org/wiki/POSIX_Threads)
- libx264 - enable H.264 encoding via x264 (http://www.videolan.org/developers/x264.html)
- libxvid - enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists (http://www.xvid.org/)
The essence of his information, and many more options, can be found by typing
(You might also consider including libtheora in your configuration, but I forgot at the time)
We're now ready to make the installation files so at the command prompt:
If something goes wrong, and you need to start again, a useful command to know is:
Make sure you do this first and then run the configure command again.
You will be asked a few questions, which should be straightforward enough to answer - yes to creating the documentation, choose a name, select D for Debian package, lastly select number 3 and type a version name that means something to you. Mine was svn11212-etch-20071213. Checkinstall will now create a Debian package of FFMPEG, bespoke for your system with the configuration options you've selected earlier. Checkinstall WILL NOT install the package, so don't forget to do that:
dpkg -i ffmpeg_svn11212-etch-20071213-1_i386.deb
With some small amount of luck, you should now have a working version of FFMPEG installed on your Debian Etch server. You will be able to output H.264 encoded files in a variety of containers.
Now the fun part really begins as you spend days tinkering with commands to output the best possible files. Documentation for using FFMPEG can be found at:
(Credit for getting me started in the right direction goes to Paul Battley and his FFMPEG Ubuntu Feisty install how-to)