How-To: Install FFmpeg on Debian Etch

| | Comments (5) | TrackBacks (0)

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.

pico /etc/apt/sources.list

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:

apt-get update

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:

http://www.asic-linux.com.mx/~izto/checkinstall/download.php

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 .deb package. After the download, execute the following as root:

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:

./configure --enable-gpl --enable-pp --enable-libvorbis --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 -enable-libxvid --enable-shared

So, what have we done here......

The essence of his information, and many more options, can be found by typing ./configure --help first.

(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:

make

If something goes wrong, and you need to start again, a useful command to know is:

make distclean

Make sure you do this first and then run the configure command again.

A finally:

checkinstall

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:

http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

Have fun!

(Credit for getting me started in the right direction goes to Paul Battley and his FFmpeg Ubuntu Feisty install how-to)

0 TrackBacks

Listed below are links to blogs that reference this entry: How-To: Install FFmpeg on Debian Etch.

TrackBack URL for this entry: http://stream0.org/cgi-bin/mt/mt-tb.cgi/1

5 Comments

Nice post! I was really looking for this!
I only have one problem: When I'm trying apt-get build-dep ffmpeg, It returns with the following error:
Unable to find a source package for ffmpegcvs
I've googled around a bit, and it says that I need to have the right debian repositories, only they didn't tell me wich

Here is my /etc/apt/sources.list:
# deb http://ftp.nl.debian.org/debian/ etch main

deb http://ftp.nl.debian.org/debian/ etch main
deb-src http://ftp.nl.debian.org/debian/ etch main

deb http://security.debian.org/ etch/updates main
deb-src http://security.debian.org/ etch/updates main


deb http://www.debian-multimedia.org stable main

As you can see I've already added debian-multimedia.org to my apt sources. After that I did apt-get update.

But I still got an error.
Here's the Error:
# apt-get build-dep ffmpeg
Reading package lists... Done
Building dependency tree... Done
E: Unable to find a source package for ffmpegcvs

Trying
# apt-get source ffmpeg
gave me the same error.

Am I missing something, or do I need another repository? Wich reporistories do you have more? So I can add them to my list :-)


Too easy.. never mind
deb-src http://www.debian-multimedia.org stable main

I've tried all kinds of things, but I haven't yet been able to get the ffmpeg in the debian-multimedia repositories to properly decode AAC files (found in many quicktime mp4 videos). Whenever I try to do something like this:

ffmpeg -i DuckandC1951_256kb.mp4 -ab 48 -ar 22050 -s 320x240 duckandcover.flv

I get this back:

Error while decoding stream #0.2
[aac @ 0xb7e239a8]faac: frame decoding failed: Unexpected channel configuration change

This is not the case on Ubuntu 7.10, despite the fact that the libfaac and libfaad packages are much older.

Have you had any success decoding aac audio with this compilation setup, or is it just me? If you want to see what I mean, you can grab yourself a copy of "Duck and Cover" from http://archive.org.

--enable-pp has apparently been replaced by
--enable-postproc (try doing a ./configure --help | grep "post")

this worked for me (note I had to remove --enable-libdc1394)

./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-liba52 --enable-libgsm --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-libxvid --enable-shared --enable-libfaad --enable-libfaadbin --enable-libtheora --enable-zlib --enable-liba52bin

After my last post, I ran into another problem: encoding mpeg-4 (quicktime) where I received this error:

picture size invalid (0x0)
Cannot allocate temp picture, check pix fmt


To fix it, I read this post (http://www.hiteshagrawal.com/ffmpeg/installing-ffmpeg-easily-on-linux)

where it says:
=====
For those who got an error like “error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory”, you can do the next:

cd /etc/ld.so.conf.d

add another file: custom-libs.conf

inside, put :

/usr/local/lib

save,

then do ldconfig
======

Leave a comment

About this Entry

This page contains a single entry by phillc published on January 20, 2008 4:58 PM.

How-To: Install FFMPEG on Ubuntu Gutsy is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages