Fixing ffmpeg on Ubuntu Edgy

Ubuntu 7.04 (Feisty) users might be interested in a newer version.

Some things have changed since I wrote my original instructions for getting a fully-functional ffmpeg on Ubuntu Linux over a year ago. Based on comments and tips there, I’ve updated the instructions to work with the latest release of Ubuntu, 6.10 (a.k.a. ‘Edgy’).

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, open a terminal, and type this:

sudo apt-get build-dep ffmpeg
sudo apt-get install liblame-dev libfaad2-dev \
libfaac-dev libxvidcore4-dev liba52-0.7.4 \
liba52-0.7.4-dev libx264-dev checkinstall \
build-essential
apt-get source ffmpeg
cd ffmpeg-*
./configure --enable-gpl --enable-pp --enable-vorbis \
--enable-libogg --enable-a52 --enable-dts \
--enable-dc1394 --enable-libgsm --disable-debug \
--enable-mp3lame --enable-faad --enable-faac \
--enable-xvid --enable-pthreads --enable-x264
make

Before proceeding, find the currently-available ffmpeg version:

apt-cache show ffmpeg | grep Version

You’ll get something like this:

Version: 3:0.cvs20060823-3.1ubuntu1

You can then use a newer version number for the custom-built version you’re about to install. In this case, just increment the last number to get 3:0.cvs20060823-3.1ubuntu2.

sudo checkinstall

The program 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, as discussed earlier (I used 3:0.cvs20060823-3.1ubuntu2).

After that, you should have a system-recognised, fully-loaded version of ffmpeg. As ever, please leave a comment if you have any problems.

Comments

  1. Laust M. Ladefoged

    Wrote at 2006-12-31 20:20 UTC using Firefox 2.0 on Linux:

    Brilliant, I enjoyed your first guide and this is a nice followup.

    One minor thing, I also had to do ’
    sudo apt-get checkinstall ’ before I could perform the install.
  2. Paul Battley

    Wrote at 2006-12-31 20:51 UTC using Firefox 2.0.0.1 on Mac OS X:

    Thanks for the tip: I’ve added that. (I assume that you meant ‘sudo apt-get install checkinstall’, by the way.)
  3. Mannus Pavlus

    Wrote at 2007-01-02 03:49 UTC using Firefox 2.0 on Linux:

    Hm, Paul… something strange happening.
    After performing all guided steps (copy/paste) and everything went fine, I ended with the following msg:

    file.mp3: Unknown format

    as output for:
    ffmpeg -i file.mp3 file.amr

    The switch -acodec mp3 doesnot help…

    Could you?

    BR
  4. Tim Newsome

    Wrote at 2007-01-13 20:52 UTC using Opera 9.02 on Linux:

    Cool! That worked perfectly. Thank you so much for putting this together.

    Tim
  5. rich

    Wrote at 2007-01-23 20:46 UTC using Firefox 2.0.0.1 on Linux:

    I’m using Edgy 6.10. I followed it through, fine, the final command finished “OK”, but:
    $ ffmpeg -i test.fvl out.avi

    complains that:
    [flv @ 0×8491b88]Unsupported video codec (4)

    Any clues?
  6. Peter Arien

    Wrote at 2007-01-25 20:38 UTC using Firefox 2.0.0.1 on Linux:

    Thank you Paul! You realy made my day with this one. And using one of the mirrors of the repository at http://www.debian-multimedia.org/ I was able to create a fixed ffmpeg on Debian stable using your guidelines.

    Peter
  7. Chris D

    Wrote at 2007-02-08 18:42 UTC using Firefox 2.0.0.1 on Linux:

    Thank you,

    This info has helped me a great deal.

    One note; immediately after I completed the install, I tried running ffmpeg to transcode a file to mp3 and got an error about the ffmpeg executable being in the wrong place. Closing my current terminal window and opening a new one resolved the problem.
  8. Cadoo

    Wrote at 2007-02-10 18:06 UTC using Firefox 2.0.0.1 on Linux:

    I was getting the following:
    The following packages have unmet dependencies:
    libfaac-dev: Depends: libfaac0 (= 1.24clean-0ubuntu4) but 1.24+cvs20060416-0.1 is to be installed
    libfaad2-dev: Depends: libfaad2-0 (= 2.0.0+cvs20040908+mp4v2+bmp-0ubuntu3) but 2.0.0+cvs20060416-0.0 is to be installed
    E: Broken packages

    To fix I removed libfaad2-0 and then tried again.
    sudo apt-get remove libfaad2-0

    Thanks for the guide!
  9. Cadoo

    Wrote at 2007-02-10 18:40 UTC using Firefox 2.0.0.1 on Linux:

    I had to do a couple more things to get this working.
    sudo apt-get remove libfaac0
    BE CAREFUL that removed a bunch of programs
    The following packages will be REMOVED:
    acidrip faac gstreamer0.8-faac libfaac0 mencoder mplayer
    Then I did the steps in the guide
    To get back uninstalled programs
    sudo apt-get install acidrip faac gstreamer0.8-faac mencoder mplayer

    Also make errored in x264.c
    So i removed—enable-x264 from ./configure
    make clean
    make
    I’m running feisty fawn by the way.
  10. Thynnus

    Wrote at 2007-02-14 17:20 UTC using Firefox 2.0.0.1 on Windows XP:

    Brilliant! Worked for me where others had failed, and is quite a bit simpler. Thanks!

    Built on bog-standard Ubuntu 6.10 Edgy-Eft LAMP server.

    Solved a frustrating “Unsupported codec for output stream #0.1” problem while trying to use ffmpeg to transcode/downsample .avi to .mp4 with mpeg4 video and mp3 audio to play on Treo 700p phone. (Mentioned to help other seekers find this)
  11. Xalior

    Wrote at 2007-02-15 08:13 UTC using Firefox 2.0.0.1 on Linux:

    check-install requires dpkg-dev which isn’t a dependancy, so easiest way around for all is to install build-essential during the first apt-get install to solve all the later problems….

    -Dx
  12. rich

    Wrote at 2007-02-15 09:56 UTC using Firefox 2.0.0.1 on Linux:

    Hi again.(see above post)

    Does this work for everyone except me? Can anyone offer any help getting the flv codec to work?

    thank you,
  13. Paul Battley

    Wrote at 2007-02-15 12:03 UTC using Firefox 2.0.0.1 on Mac OS X:

    That’s a good tip, Xalior. It hadn’t occurred to me that someone might not have build-essential installed. I’ve added that to the list of packages.
  14. Bryant O'Hara

    Wrote at 2007-02-16 04:50 UTC using Firefox 2.0 on Linux:

    I’m trying to use ffmpeg’s imlib2 video hook:

    Example:
    ffmpeg -i input.avi -vhook ’/usr/lib/vhook/imlib2.so -c PowderBlue -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello’ -acodec copy -sameq output.avi

    I keep getting the following error message:

    undefined symbol: imlib_context_set_direction

    What does this error mean, and how can I fix it?
  15. Obif

    Wrote at 2007-02-26 08:48 UTC using Firefox 1.5.0.4 on Windows 98:

    Officially VP6 is supported by ffmpeg, though after following your instructions and trying to transcode a VP6-encoded file, I get this error repeated about ten thousand times:

    [flv @ 0×874c3c8]Unsupported video codec (4)

    Obviously yours is not a fully functional ffmpeg.
  16. Paul Battley

    Wrote at 2007-02-26 10:58 UTC using Firefox 2.0.0.1 on Mac OS X:

    Obif: don’t be an ass.

    It looks like VP6 was added to ffmpeg in September 2006, but the Edgy sources have ffmpeg from late August, pre-dating VP6 support.

    If you want a bleeding-edge ffmpeg, you should be able to grab the latest source and compile it as above: just skip the ‘apt-get source’ line. Good luck.
  17. Jaisen

    Wrote at 2007-03-02 06:43 UTC using Firefox 1.5.0.4 on Windows XP:

    Thanks for the tutorial. I was unsure how to get this working on Ubuntu. Had it working on several Gentoo servers. Followed this exactly as you said and audio magically began appearing :).

    Thanks!
  18. Eugenia

    Wrote at 2007-03-16 09:18 UTC using Firefox 2.0.0.2 on Linux:

    There is an open bug report about this:
    https://launchpad.net/bugs/6366
    It is still not fixed…
  19. j.jordan

    Wrote at 2007-03-18 16:29 UTC using Konqueror 3.5 on Linux:

    Need to add ”—enable-shared” to the config line for K3b version 1.0 to compile with ffmpeg support.

    Thanks for the great howto and thanks Konsole for allowing copy and paste (love those ./configure lines).

    -j
  20. Michael

    Wrote at 2007-03-20 17:51 UTC using Firefox 2.0.0.2 on Windows XP:

    Works prefectly, you saved me a lot a time!!
    Thanks
  21. Nathan Ziarek

    Wrote at 2007-03-22 20:32 UTC using Firefox 2.0 on Linux:

    I wanted to install ffmpeg-php, which said that ffmpeg needed to be installed with ”—enabled-shared”

    Since it wasn’t configured that way, I added it to the configure switches. Without it, I can get ffmpeg to work fine. With it, I get the error:

    ffmpeg: error while loading shared libraries: libavformat.so.50: cannot open shared object file: No such file or directory

    Any suggestions? As far as I can tell, libavformat-dev and libavformat0d are installed.

    Thanks!
  22. Nathan Ziarek

    Wrote at 2007-03-22 21:09 UTC using Firefox 2.0 on Linux:

    I hate comment-hijacking jerks like me:

    http://www.twelvestone.com/forum_thread/view/33460

    Edit /etc/ld.so.conf and add the line
    /usr/local/lib
    then save and exit.

    Now run this command (or close and reopen Terminal)
    ldconfig -v

    seemed to work for me!

    Nate
  23. Edgy User mach II

    Wrote at 2007-04-01 18:22 UTC using Firefox 2.0.0.3 on Linux:

    Hi, nice tutorial, the fiorst that just worked for me, except one thing, I can no longer take screenshots, it says:
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ’/home/myfolder/1.mov’:
    Duration: 00:03:16.2, start: 0.000000, bitrate: 267 kb/s
    Stream #0.0(eng): Audio: aac, 24000 Hz, stereo
    Stream #0.1(eng): Video: mpeg4, yuv420p, 640×480, 5.00 fps®
    Unable for find a suitable output format for ’/home/myfolder/9.jpg’

    It used to work, any obvious solution?

    Cheers
  24. james

    Wrote at 2007-04-06 05:09 UTC using Firefox 2.0.0.3 on Linux:

    i built ffmpeg using steps above but after completing the procedures my system can’t find the new ffmpeg build.

    after installation i run the command on terminal:

    apt-cache show ffmpeg | grep Version

    i still get the same version i used before i rebuilt ffmpeg using steps outlined above. i also renamed the version as set out above.

    uninstalling the old ffmpeg ver. doesnt fix the problem either.
  25. Adam

    Wrote at 2007-04-17 14:39 UTC using Firefox 2.0.0.3 on Mac OS X:

    problems with flac:

    ffmpeg -i 1_test.wav test.flac
    ffmpeg version CVS, build 3276800, Copyright© 2000-2004 Fabrice Bellard
    configuration: --enable-gpl --enable-pp --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-pthreads --enable-x264 --enable-codec=flac
    built on Apr 17 2007 16:30:11, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
    Input #0, wav, from ‘1_test.wav’:
    Duration: 00:01:11.4, start: 0.000000, bitrate: 1411 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, 1411 kb/s

    Unable for find a suitable output format for ‘test.flac’

    process:
    i followed above, adding libflac-dev to the apt-get install list and --enable-codec=flac to the configure list.

    If i install from the svn head i am able to convert to flac though cant get mp3 and swf conversions to work.

    look forward to your comments.
  26. trevelyn

    Wrote at 2007-04-21 05:55 UTC using Firefox 2.0.0.2 on Linux:

    thanks man, i was worried when i got the failure messages from the howto on the ubuntu forum.. This how to worked perfectly.
    thanks a 10^6. – trev
  27. David Harrigan

    Wrote at 2007-04-25 11:53 UTC using Firefox 2.0.0.3 on Linux:

    Hi,

    If you’re building this in Ubuntu Feisty and you get an error whilst building libavcodec/x264.c, you need to change line 147 from

    x4->params.rc.i_rf_constant = avctx->crf

    to

    x4->params.rc.f_rf_constant = avctx->crf

    (notice the f instead of the i)

    -=david=-
  28. tmill

    Wrote at 2007-04-27 21:20 UTC using Internet Explorer 7.0 on Windows XP:

    Ok I am having the same problem as Cadoo and David Harringan with the enable-x264 giving an error during the make process. As Cadoo stated disabling x264 will fix the problem and is what I am currently doing, however I kind of want to figure it out and get it working. Unlike Cadoo and David Harringan I am running Edgy instead of feisty. The error is in the 152 line of the currently downloaded version and reads.

    x4->params.rc.f_rf_constant = avctx->crf

    Harringan mentioned changing this line but the version I am looking at already has his changes incorporated. The error message is as shown below:

    x264.c: In function âX264_initâ:
    x264.c:152: error: âstruct â has no member named âf_rf_constantâ
    make1: *** [x264.o] Error 1
    make1: Leaving directory `/home/tmill/ffmpeg/ffmpeg/libavcodec’
    make: *** [lib] Error 2

    Can anyone propose a solution to this problem…?

    Thanks,
    -Tmill
  29. pierrick

    Wrote at 2007-04-28 09:40 UTC using Firefox 1.5.0.11 on Windows XP:

    I had the same error i fixe it using :

    rm -f /bin/sh
    ln -s /bin/bash /bin/sh

    Hope It’ll work !
  30. anon

    Wrote at 2007-05-01 06:18 UTC using Firefox 2.0.0.3 on Linux:

    Thanks for the guide. I just used it on Feisty, and all went well except for the snag when compiling x264.c. The fix provided by David Harrigan worked – changing the shell from dash—> bash (which you can also achieve by running “sudo dpkg-reconfigure dash” and answering “No” – no need to mess with symlinks manually) didn’t. Also, I had to install a few additional packages:
    libdts-dev
    libgsm1-dev
    libvorbis-dev
    libdc1394-13-dev
  31. David Harrigan

    Wrote at 2007-05-01 13:39 UTC using Firefox 2.0.0.3 on Linux:

    For those interested, I’ve made some deb’s available of ffmpeg + x264 for fiesty on my website:

    http://www.harrigan.info

    -=david=-
  32. Feisty

    Wrote at 2007-05-08 10:11 UTC using Firefox 2.0.0.3 on Linux:

    Hi, so close…. Used this tut earlier on edgy… but now.. arghh. I get the following during checkinstall and im totally stumped…

    install -d ”/usr/local/bin”
    install -c -s -m 755 ffmpeg ffserver ffplay ”/usr/local/bin”
    install: setting permissions for `/usr/local/bin/ffmpeg’: No such file or directory
    strip: could not create temporary file to hold stripped copy of ’/usr/local/bin/ffmpeg’
    install: strip failed
    make: *** [install-progs] Error 1

    anyone? And btw thx for the tutorial :-)
  33. Chalain

    Wrote at 2007-05-10 18:26 UTC using Firefox 2.0.0.3 on Linux:

    I’m running Kubuntu 7.04 Feisty Fawn. Make failed, but removing x264 fixed the problem, as per the comment above.

    Thanks for this guide!
  34. Paul Battley

    Wrote at 2007-05-11 22:30 UTC using Firefox 2.0.0.3 on Mac OS X:

    I got the latest development version of ffmpeg to build on Feisty, complete with x264 support! More here.
  35. Nighto

    Wrote at 2007-06-27 21:13 UTC using Firefox 2.0.0.4 on Linux:

    something that might help:

    with ffmpeg-svn, i’ve to use:
    ./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-dc1394 --enable-libgsm --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-libxvid --enable-pthreads --enable-libx264

    instead of the mentioned.
  36. Fury

    Wrote at 2007-10-11 16:18 UTC using Firefox 2.0.0.6 on Linux:

    I just tried to run this under Feisty, but get the following error messages when calling
    sudo checkinstall:

    In file included from ffmpeg.c:21:
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:228: warning: ‘AVFrac’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:378: warning: ‘AVImageInfo’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:381: warning: ‘AVImageInfo’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:386: warning: ‘AVImageFormat’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:391: warning: ‘AVImageFormat’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:392: warning: ‘AVImageInfo’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:393: warning: ‘AVImageFormat’ is deprecated
    /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:393: warning: ‘AVImageInfo’ is deprecated
    ffmpeg.c:44:21: error: version.h: No such file or directory
    ffmpeg.c:91: warning: ‘AVImageFormat’ is deprecated
    ffmpeg.c: In function ‘opt_image_format’:
    ffmpeg.c:2088: warning: ‘AVImageFormat’ is deprecated
    ffmpeg.c:2090: warning: ‘first_image_format’ is deprecated (declared at /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:395)
    ffmpeg.c: In function ‘show_formats’:
    ffmpeg.c:3572: warning: ‘AVImageFormat’ is deprecated
    ffmpeg.c:3617: warning: ‘first_image_format’ is deprecated (declared at /tmp/ffmpeg-0.cvs20060823/libavformat/avformat.h:395)
    ffmpeg.c: In function ‘show_version’:
    ffmpeg.c:3921: error: expected ‘)’ before ‘FFMPEG_VERSION’
    ffmpeg.c: In function ‘show_banner’:
    ffmpeg.c:4112: error: expected ‘)’ before ‘FFMPEG_VERSION’
    make: *** [ffmpeg.o] Error 1

    **** Installation failed. Aborting package creation.

    Any ideas?
  37. Cliff

    Wrote at 2007-10-14 16:14 UTC using Firefox 2.0.0.6 on Linux:

    I am running ubuntu edgy 6.10.
    I want to play .flv files.
    The ffmpeg source from edgy does not support vp6 so I get “unsupported video codec (4)” errors.
    When I try to use SVN source (tip or the rev you used) as in your fiesty page, I get build errors.
    Has anyone got VP6 .flv files working with edgy?

    Cliff