Fixing ffmpeg on Ubuntu

Using Ubuntu 6.10 (Edgy) or newer? There are updated instructions available here.

For various boring legal reasons, Ubuntu Linux’s various packages are separated out into different repositories based on their licensing restrictions. As a result of this, packages which are in the main repository but require packages in other repositories for additional functionality are compiled without those extra features.

Very tedious.

Here’s how to get a copy of ffmpeg to work with things like AAC, MP3, and so on. I am assuming that you have already enabled the ‘multiverse’ and ‘universe’ repositories. If not, do so first. Now, bust out a terminal, and type this:

sudo apt-get build-dep ffmpeg
sudo apt-get install liblame-dev libfaad2-dev \
libfaac-dev libxvidcore4-dev checkinstall fakeroot
apt-get source ffmpeg
cd ffmpeg-0.cvs*
vi debian/rules

Add the following lines to debian/rules, under the other confflags lines:

confflags += --enable-mp3lame --enable-faad
confflags += --enable-faac --enable-xvid

Continuing in the terminal:

fakeroot debian/rules binary
sudo checkinstall

This will take some time, after which the process asks for some details. You can accept the default choices, except for the following changes:

  • Set ‘Name’ to ‘ffmpeg’.
  • Set ‘Version’ to something newer than the currently installed ffmpeg (I called mine ‘3:0.cvs20050121-1ubuntu2’).

After that, you should have a system-recognised, fully-loaded version of ffmpeg. If you have problems, leave a comment. The above method worked for me on 5.04; it might not work on also works on 5.10 according to reports. (Thanks, Kyle.)

I’ve made a small improvement to the cd ffmpeg-0.cvs* line in the instructions: it now uses a wildcard so that they can be copied and pasted directly into the command line.


  1. kyle

    Wrote at 2005-11-05 20:32 UTC using Firefox 1.0.7 on Linux:

    Works with Breezy
  2. Garret

    Wrote at 2005-11-06 05:45 UTC using Firefox 1.0.7 on Linux:

    Exactly what I was looking for! Thanks so much for the help. I wasted days trying to get results that your tutorial got me in about an hour. Needless to say- It worked like a charm.
  3. Mohegan

    Wrote at 2005-11-23 00:29 UTC using Opera 9.00 on Linux:

    Thanks a lot for your help. It work very well.
    You should post your deb in PLF : (The PLF [Penguin Liberation Front] is a team that builds litigious packages (patents covered or copyrighted stuff). PLF provide litigious packages for Mandriva since many years. Recently a team tries to make the same thing for Ubuntu.)

    “Merci beaucoup”
  4. goki

    Wrote at 2005-11-26 12:43 UTC using Firefox 1.0.7 on Linux:

    Building on AMD64:

    You need to change item 7 in checkinstall menu to “amd64” or it will build a package for “x86_64” which then won’t install. AFAIK this is a bug in checkinstall:
  5. Michael G Schwern

    Wrote at 2005-11-28 23:08 UTC using Firefox 1.0.7 on Linux:

    It seems one can set DEB_BUILD_OPTIONS=risky to enable the missing codecs rather than editing debian/rules and building the package manually.

    sudo apt-get build-dep ffmpeg

    sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev checkinstall fakeroot

    DEB_BUILD_OPTIONS=risky fakeroot apt-get source ffmpeg—compile

    sudo dpkg -i ffmpeg-blah.dpkg
  6. Karl

    Wrote at 2006-01-28 11:15 UTC using Netscape 4.01 on Unknown OS:

    I worked through this, and it worked fine right up until it tried to compile libavcodec/i386/dsputil_mmx.c when it started chucking “incompatible type for argument errors”
    The version is cv220050918, lines 630-636.
    Any ideas?
    Cheers for the tutorial, got me a lot further than trying ‘by hand’.
  7. Whytey

    Wrote at 2006-01-28 15:09 UTC using Firefox 1.0.7 on Linux:

    Cool. Worked fine on Breezy, after I spent all night trying to compile ffmpeg myself. Thanks!

    One quick question, when I build and install things myself I believe I need to keep the folder where I copiled the code so I can do an uninstall. Do I need to do anything like that here, or can I delete the source code I downloaded, with this being a proper package?

  8. Balli John

    Wrote at 2006-04-02 03:57 UTC using Firefox on Linux:

    Great! This was exacly what I was looking for! Thanks a billion :D
  9. Chris

    Wrote at 2006-05-09 18:25 UTC using Firefox on Mac OS X:

    Any idea what is needed to enable x264 support into ffmpeg? I’ve tried to add—enable-x264 and I’ve installed x264 from svn, but I still get some errors. Anyone had luck with this?
  10. Jin

    Wrote at 2006-07-19 15:32 UTC using Firefox on Linux:

    To enable x264, you must also—enable-pthreads.

    Instead of using checkinstall, why not
    DEB_BUILD_OPTIONS=risky dpkg-buildpackage -rfakeroot -us -uc
  11. Jon Maddox

    Wrote at 2006-08-02 03:22 UTC using Safari 419.3 on Mac OS X:

    You are my hero.

    I’m redoing my mediaserver tonight with Ubuntu. Its my first go around with Ubuntu, I finally got sick of Suse.

    I was disappointed to see the half wit version of ffmpeg on Ubuntu, but your post saved the day.

  12. Claudia

    Wrote at 2006-08-19 16:09 UTC using Firefox on Linux:

    Worked for me with Dapper. Thanks alot.

    Any ideas on how to do that with amr support, to play/convert 3gp with sound?
  13. Philip Stubbs

    Wrote at 2006-08-26 16:47 UTC using Firefox on Linux:

    To get amr sound to work, I added—enable-amr_nb—enable-amr_nb-fixed—enable-amr_wb to the confflags mentioned above. Then during the config stage, it prompts you download some zip files.

    I now have sound working in playback at least. I have not tried to encode anything yet.
  14. Philip Stubbs

    Wrote at 2006-08-26 17:05 UTC using Firefox on Linux:

    Scrub my comment. It appears that with these options, the sound plays, but the video is running slow.
  15. Braden Thomas

    Wrote at 2006-09-04 09:55 UTC using Safari 419.3 on Mac OS X:

    This page is a year old, but the info is great! You saved me surely countless hours of frustration….
  16. Kevin Martin

    Wrote at 2006-10-12 16:31 UTC using Firefox 2.0 on Windows XP:

    Much appreciated. Spent days trying to get FFMPEG to compile the way I wanted. With your guide it took about a hour.
  17. Ye

    Wrote at 2006-10-15 22:55 UTC using Firefox on Windows XP:

    Install w/o any problem on my amd64 box.
    Very helpful information.
  18. Glenn

    Wrote at 2006-10-21 03:30 UTC using Firefox on Windows XP:

    Awesome. I was banging my head on my desk and couldn’t figure out why my videos weren’t converting from my website. The ffmpeg had no mp3 support! I spent all evening trying to figure this out, I almost gave up until I found this site. Thanks. It worked WONDERFULLY!
  19. k8

    Wrote at 2006-10-25 04:55 UTC using Firefox on Mac OS X:

    Thanks for your help, I have a bit of a newbie question. I used your suggestions to install my ffmpeg on Dapper. However now I want to upgrade my install of mythtv to 0.20 – a dependency of mytharchive is ffmpeg but apt doesn’t seem to think ffmeg is installed and unsuccessfully tries to reinstall it.

    I thought the point of checkinstall was that it updated your apt db? I would like to either uninstall it or tell apt I have installed it.

    Sorry if this is obvious and thanks for your help!
  20. offtza

    Wrote at 2006-10-25 14:26 UTC using Opera 9.01 on Linux:

    Dapper Drake – works fine
  21. isagani

    Wrote at 2006-11-02 16:02 UTC using Firefox 2.0 on Linux:

    I get this when I do the final command:

    install -d ”/usr/bin”
    install -c -s -m 755 ”/usr/bin”
    install: missing destination file operand after `/usr/bin’
    Try `install—help’ for more information.
    make: *** [install-progs] Error 1

    **** Installation failed. Aborting package creation.

    Cleaning up…OK

    How do I fix this?
  22. isagani

    Wrote at 2006-11-02 16:15 UTC using Firefox 2.0 on Linux:

    Ok… I’m really sorry. It was my mistake. I forgot to do a step. You can delete my comment. Thanks for this great guide. It was very enlightening!
  23. smoser

    Wrote at 2006-11-20 13:31 UTC using Firefox on Linux:

    Just thought I’d post this. I got a much more functional ffmpeg built on edgy with the following, includes x264, amr, xvid, mp3 and other support. Additionally, it “just works” to create flash video out of the ‘Export’ tag in kino. I may have missed some dependencies that need to be there for build. Only ubuntu respotitories were used.

    One thing I dont understand is that if I rebuild with the same version as the official ones, ‘apt-get upgrade’ will want to replace mine with official ones. Maybe it has to do with the fact that mine aren’t signed, or are binary only. But anyway, thats why I modified the version.

    # amr is enabled as suggested at

    sudo apt-get build-dep ffmpeg quilt
    sudo apt-get install libssl-dev libx264-dev
    sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev
    mkdir ffmpeg-src
    cd ffmpeg-src
    apt-get source ffmpeg

    mkdir dl
    cd dl
    for x in 26.204/26204- 26.104/; do
    wget -O ”${x##*/}” “$x”

    cd ..
    cd ffmpeg-0.cvs20060823
    amrext() {
    local h=”$PWD/$2” ;
    ( rm -Rf ”$1” && mkdir -p ”$1” && cd ”$1” && unzip ”$h” && unzip *.zip )
    amrext libavcodec/amrwb_float ../dl/
    amrext libavcodec/amr_float ../dl/

    ###### file start “extra-options.diff”—- debian/rules.orig 2006-11-16 22:28:16.000000000 -0500
    +++ debian/rules 2006-11-16 22:27: 11.000000000 -0500
    @ -36,6 +36,9 @
    confflags +=—enable-faac
    weak-build-deps += libxvidcore-dev
    confflags +=—enable-xvid
    +weak-build-deps += libx264-dev
    +confflags +=—enable-x264
    +confflags +=—enable-amr_nb—enable-amr_wb
    $(warning Make sure these packages are installed: $(weak-build-deps))
    endif—- debian/changelog.orig 2006-11-16 23:39:01.000000000 -0500
    +++ debian/changelog 2006-11-16 23:36:58.000000000 -0500
    @ -1,3 +1,9 @
    +ffmpeg (3:0.cvs20060823-risky-3.1ubuntu1) edgy; urgency=low
    + * Enable Risky
    +—Joe Risky Thu, 16 Nov 2006 23:36:02 -0500
    ffmpeg (3:0.cvs20060823-3.1ubuntu1) edgy; urgency=low

    * Sync with Debian
    # file end: extra-options.diff

    cat risky-patch.diff | patch -p0

    rm libavcodec/amrwb_float/26204-510.doc
    libavcodec/amr_float/26104- 510.doc

    DEB_BUILD_OPTIONS=risky dpkg-buildpackage -rfakeroot

    sudo dpkg -i ffmpeg_0.cvs20060823-risky-3.1ubuntu1_i386.deb
    libavcodec0d_0.cvs20060823- risky-3.1ubuntu1_i386.deb
  24. bob

    Wrote at 2006-11-21 22:02 UTC using Firefox on Linux:

    This was exactly what i was looking for, thanks! God bless open source. :-)
  25. sean

    Wrote at 2006-11-26 09:37 UTC using Konqueror 3.5 on Linux:

    FWIW, smooth sailing until executing:

    fakeroot debian/rules binary

    for which the following error is returned:

    make: dh_testdir: Command not found
    make: *** [build-stamp] Error 127
  26. S.M.Emami.Razavi

    Wrote at 2006-12-07 10:00 UTC using Mozilla 1.8.1b2 on Linux:

    Hi Paul,
    After all, I saw your blog. It’s my ambition to be familiar with people in the other countries intended to come to their countries as a student at university. anyway i prefer going to England more!
  27. Eric

    Wrote at 2006-12-15 15:01 UTC using Firefox 2.0 on Windows XP:

    Have you been able to find out what the problem was on Edgy yet? I know that I got this working on Dapper before and I would love to have it again.

  28. Leif Sandvik

    Wrote at 2006-12-18 02:09 UTC using Firefox 2.0 on Linux:

    I also need help with Edgy 6.10.
  29. Ken

    Wrote at 2006-12-18 02:46 UTC using Firefox 2.0 on Linux:

    I too am trying to enable lame for ffmpeg in Ubuntu Edgy Eft 6.10 to output flv from Kino (with audio).
  30. Mike

    Wrote at 2006-12-30 05:26 UTC using Firefox 2.0 on Linux:

    I managed to get this working on Edgy by following the instructions here:

    specifically the section ‘Installing ffmpeg’. I think the other important part from that page is is removing the existing faac capabilities so that they could be build with ffmpeg:

    sudo apt-get remove libmp4v2-0 libmp4v2-dev faac gstreamer0.8-faac libfaac0 libfaac-dev
  31. luh3417

    Wrote at 2007-01-04 12:33 UTC using Firefox on Linux:

  32. Lion

    Wrote at 2007-03-05 17:51 UTC using Firefox on Linux:

    Exactly what I was looking for! Thank you very much!
  33. mako

    Wrote at 2007-03-08 16:14 UTC using Firefox on Linux:

    Thanks Michael G Schwern for the perfect advice.
  34. Jalke

    Wrote at 2007-05-18 16:47 UTC using Firefox on Linux:

    Could someone tell me how and where exactly to add:

    confflags +=—enable-mp3lame—enable-faad
    confflags +=—enable-faac—enable-xvid

    I’m a complete newbie to linux. I got upto this stage but than was unable to continue. Thanks a lot.

  35. Lucas

    Wrote at 2007-06-22 06:37 UTC using Firefox on Windows XP:

    My first mistake was not checking the currently installed version of ffmpeg. So once I realized that, re-running sudo checkinstall completed with errors. Seemed to create the deb just fine but failed on install.

    Ultimately, the problem wasn’t with these instructions or my failure to follow them, it was choking on an .so from libavcodec0d which was installed. I removed that package and it worked great.

    Thanks so much!
  36. Steve Williams

    Wrote at 2007-06-30 15:24 UTC using Firefox on Linux:


    Thanks for this page mate. You would never realise how many hours I have spent pulling my hair out and finally coming across your page.

    Thanks, really.

  37. philippe

    Wrote at 2007-08-12 20:15 UTC using Safari 522.12.1 on Mac OS X:

    is it possible to add a PiP or a better watermark function than watermark.c to ffmpeg?
    i had to add a logo (png format) to my video and watermark.c has such a bad quality. any suggestions ond hints? thanks.
  38. Derek

    Wrote at 2007-08-15 23:46 UTC using Firefox on Windows XP:

    I failed to see the “newer version” notices at the top, but still… works great on Fiesty after spending a couple hours trying to get ffmpeg installed with lame. thanks!
  39. Craig in Boston

    Wrote at 2007-08-28 01:22 UTC using Firefox on Linux:

    Thanks tons! It worked fine for me.

    Now, the update manager wants to replace that version with cvs20060823-3.1ubuntu4+medibuntu2

    Do I update?
  40. Christian

    Wrote at 2007-11-23 15:13 UTC using Firefox on Windows XP:

    I get an error when trying to install libfaad2-dev and libfaac-dev. For some reason I get my error messages in norwegian and I dont know exactly what it would be in english. Its says I am trying something impossible and some core packages may not exist or are moved. And then something about dependencies and libc6-dev or libc-dev. When trying libfaac-dev I also get a refference to libmp4v2-dev.
    Anyone know how to get around this? Or what it causing these problems?
    I really want to convert my movies/tv shows on to my iphone.
  41. TheYOSH

    Wrote at 2008-01-17 19:12 UTC using Firefox on Windows XP:

    I had to change the lines from:
    confflags += --enable-mp3lame --enable-faad
    confflags += --enable-faac --enable-xvid

    confflags += --enable-libmp3lame --enable-libfaad
    confflags += --enable-libfaac --enable-xvid
  42. hiran

    Wrote at 2008-02-05 14:45 UTC using Firefox on Linux:

    on fakeroot debian/rules binary

    Unknown option ”--enable-mp3lame”.
    See ./configure --help for available options.

    what i have to do?
  43. hiran

    Wrote at 2008-02-05 14:48 UTC using Firefox on Linux:

    as yosh said, it works when lib is added

    thanks to you

    and to yosh!
  44. SyS_n0p

    Wrote at 2008-02-19 13:29 UTC using Firefox on Linux:

    You are GOD!!! Thanks a lot!!!
  45. Decoy

    Wrote at 2008-02-19 13:31 UTC using Firefox on Linux:

    Works with 6.06 LTS “Dapper Drake”. Lots of thanks! :-)
  46. Ben

    Wrote at 2009-06-15 18:41 UTC using Firefox 3.0.11 on Linux:

    In the jaunty builds, some of the codec names have changed, eg xvid->libxvid etc.

    For those wanting amr support, adding the line

    confflags +=—enable-nonfree—enable-libamr-nb—enable-libamr-wb

    to debian/rules (or more sensibly debian/confflags now?) seems to do the trick. (note the—enable-nonfree !!)

    Also, for those who like the codecs available in the ‘unstripped’ libraries, starting with apt-get source libavcodec-unstripped-52 brings down the full ffmpeg source – but with the unstripped versions of the libs ;-)
  47. Jayaraj K

    Wrote at 2012-11-27 14:30 UTC using Firefox 7.0.1 on Linux:

    Please see the link below,

    This covers ffmpeg compilation on a step by step basis. Hope this helps.