
This is a revised edition of my original post on compiling ffmpeg on Ubuntu.
update: seems to work in Hardy too.
The excellent Flashvideo module in Drupal uses ffmpeg to convert uploaded video to Adobe Flash Video format (.flv).
However, we’re using Ubuntu based servers and Ubuntu has a strict policy not to include non-free software. This means that the ffmpeg version in the repositories is not built with essential functionality, like mp3 support for audio conversion.
Solution: compile from source. Don’t run away screaming. It’s real easy.
1. enable universe and multiverse repositories
UbuntuGuide » general notes » how to add extra repositories
2. get your tools
sudo apt-get install checkinstall build-essential subversion
3. get the latest ffmpeg sources
cd /usr/local/src sudo svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
4. get the necessary dependencies
sudo apt-get install liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev
5. configure
cd ffmpeg sudo ./configure --enable-gpl --enable-liba52 --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --disable-vhook
6. compile
sudo make
7. go have a snack
8. create the .deb package
sudo checkinstall
note: just press [return] each time when asked for a configuration option
9. install the .deb package
sudo dpkg -i [ffmpeg_your_version.deb]
10. rejoice
Comments
Hi Step 5 should be done
by TheYOSH (not verified) on May 27, 2008 - 08:27Hi
Step 5 should be done inside /usr/src/ffmpeg. So 'cd ffmpeg' in step 6 is to late :P
And because you do a sudo svn action, all actions after that should also have sudo in front.
That's all.
Thanks. Updated as per your
by jpoesen on June 9, 2008 - 09:42Thanks. Updated as per your suggestions.
J.
What about medibuntu ?
by gvincke (not verified) on May 28, 2008 - 12:48What about medibuntu ? ....
Hi Joeri,
I had the same problem, but not the same solution.
I choose to add the medibuntu repository (as founded on http://www.medibuntu.org/ or http://doc.ubuntu-fr.org/depots) were you can find a .deb file to intall or update ffmpeg including the mp3 support.
As this ffmpeg is updated including the mp3 support, wich I guess is not the case with compilation.
Good to know.
See you ;-)
Gregoire.
I followed the instructions
by Raymond (not verified) on May 30, 2008 - 14:54I followed the instructions without a hitch, but still get the following error when attempting to trasnscode from avi to wmv, using the mp3 codec.
(I am using Ubuntu Gutsy)
stream_out_transcode debug: creating audio transcoding from fcc=`mpga' to fcc=`mp3 '
main debug: looking for decoder module: 25 candidates
main debug: using decoder module "mpeg_audio"
main debug: looking for encoder module: 8 candidates
ffmpeg debug: libavcodec already initialized
ffmpeg error: cannot find encoder MPEG Audio layer 1/2/3
stream_out_transcode error: cannot find encoder ((null))
main debug: removing module "mpeg_audio"
stream_out_transcode error: cannot create audio chain
main error: cannot create packetizer output (mpga)
Am I wrong that "cd ffmpeg"
by an anonymous wimp named Christoph (not verified) on May 31, 2008 - 18:03Am I wrong that "cd ffmpeg" should be at the beginning of step 5 "configure", not 6 "compile"?
When i tried the ./configure ... thing in /usr/local/src, it said that the command was not found, so i guessed i might cd ffmpeg...
Right now my computer is "make"ing, so I'll be back in a while (after step 7 "snack"), to tell you if it is working for me
(c:
You're absolutely right. The
by jpoesen on June 9, 2008 - 09:44You're absolutely right. The 'cd ffmpeg' should have been mentioned in step 5, not step 6. This is now corrected.
Thanks.
J.
Steps 5 and 6 are a little
by Mark Anderson (not verified) on June 4, 2008 - 15:57Steps 5 and 6 are a little confusing.
Also, if you sudo svn checkout, you'll have to sudo to configure and build, so I'd submit the following changes
3:
cd /usr/local/src
sudo (mkdir ffmpeg; chown $USER ffmpeg)
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
5:
cd ffmpeg
./configure ....
6:
make
Thanks for this, it works in
by jonne (not verified) on June 24, 2008 - 09:38Thanks for this, it works in Hardy too.
Hint: look up the current version numbering scheme that Ubuntu uses to avoid having software update overwriting your custom ffmpeg. I used 3:0.cvs20080624 . If you keep the default version number ( 20080624 today ), software update will offer you an 'updated' ffmpeg version.
Great, thank you! Works like
by DeepDown (not verified) on July 26, 2008 - 14:02Great, thank you!
Works like a copy and paste on hardy :)
heyas all. my 40 gig drive is
by warhammer online gold (not verified) on October 1, 2008 - 08:21heyas all.
my 40 gig drive is going to good use now. I have installed UBUNTU and have ordered KUBUNTU.
I dont know how to install the driver for my ati radeon 9600xt.
Actually i dont know if i am meant to be downloading and installing XFREE86 or the XORG version of the driver. I am downloading them both but i dont know how to do anything in Linux really.
I dont know where I am meant to set up my modem or set up a net account. (no INETWIZ.EXE)
So yeah, can someone help me out with getting my ATI driver installed?
and does anyone know of a good long PDF file i can read and wrap my brain around.
I’m still a Windows user, but I want to use Linux as much as possible.
thanks for the walkthrough.
by warhammer online (not verified) on October 15, 2008 - 00:50thanks for the walkthrough. you couldn't have made it any easier. Cheers!
Hey, AWESOME tutorial,
by Aaron (not verified) on October 22, 2008 - 23:47Hey, AWESOME tutorial, thanks!
Having a problem with step 5. Here's what I get:
Unknown option "--enable-liba52".
See ./configure --help for available options.
When I do, ./configure --help, it doesn't show the option for --enable-liba52. I ran across this site,http://xbmc.org/trac/ticket/4774, and wasn't sure if it was XBMC specific or applied to ALL FFMPEG.
Either way, it worked like a charm after I removed "--enable-liba52"
Cheers!
Post new comment