Compiling ffmpeg with mp3 on Ubuntu - Revised for Ubuntu Gutsy Server

12 MAY 2008 / joeri poesen

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 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 suggestions.

J.

Thank you for providing the code. I will surely try it give feedback to you very soon.
removing a mole

yeah.. I have learned a lot from your tutorial. It seems that it's awesome. cocktail dresses

Persistence is the key to success. Being connected to others through personal experience makes your journey to singing success more alive and can help to generate excitement in your pursuit. Learning keeps you open and allows you to grow with confidence. get your ex back

Thanks for the great information! I really loved the way you have put this in a chat type of environment. Your article was really easy to understand!

Invoice Factoring Quotations

Hi TheYOSH,

You may have a point there. I've had troubles with this too, at least that was before. Mainly on multimedia files, converting and streaming can be such a problem with this. By the way, thanks for your guide. Real easy instructions to follow, and you're right about step10. REJOICE! :)

Best Regards
Matthew Share

cobb county foreclosures

What 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.

Nicely presented information in this business, I upgrade to have this kindhearted of whatsis. The quality of knowledge is satisfactory and the ending is suitable. Thanks for the call.
funny quotes

I 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" 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 '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 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 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 a copy and paste on hardy :)

This is really great stuff for an article, this topic is very interesting.
Keep it up with this line of content, thanks for sharing this post !
netbook acer

thanks for the walkthrough. you couldn't have made it any easier. Cheers!

Hey, 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!

Good post. realy good post thx :-)

I cannot view what you have just started. It seems that they are having some troubles. pmp exam

I feel strongly about it and would love to learn more on this topic. If possible, as you gain some more knowledge about it, would you mind updating your blog with more information? I am sure; it is extremely helpful and beneficial to many of your readers. Mineco

Hmm 'make' isn't working for me..
Makefile:1: config.mak: No such file or directory
libavdevice/Makefile:1: libavdevice/../config.mak: No such file or directory
libavformat/Makefile:1: libavformat/../config.mak: No such file or directory
libavcodec/Makefile:1: libavcodec/../config.mak: No such file or directory
libavutil/Makefile:1: libavutil/../config.mak: No such file or directory
libswscale/Makefile:1: libswscale/../config.mak: No such file or directory
make: *** No rule to make target `libswscale/../config.mak'. Stop.

woop hold it... I had to take of liba52 and vhook, and also add --enable-free something then it worked

quick note for ubuntu 9.10,

I had to change liblame-dev to libmp3lame-dev

thanks for the great tutorial!

another quick note, had to change the configuration command to:

sudo ./configure --enable-gpl --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-nonfree

Thanks, d. That reminds me it's high time to update the tutorial again.

Cheers!
J.

I appreciate when I see well writen material. Your time isn't going to waste with your posts. Thanks so much and stick with it No doubt you will defintely reach your goals! have a great day!

new york mover companies
mover new York

thanks for the article written related to Web development & there are really very useful informative instructions published , i came across our website by searching . . happy to stop here

lrg clothing on sale
lrg clothes

Generally Audi A3 I do not post Audi A4 on blogs Audi A6, but I would like BMW 1-Series to say that BMW 3-Series this post BMW 5-Series really forced BMW X3 me to do so,BMW X5 Excellent post! Citroen C3 Terrific post, Fiat 500 I’ve bookmarked Fiat Panda this site Ford C-MAX so hopefully I Ford Fiesta will discover Ford Focus much more on this Ford Galaxy topic in the Ford Ka foreseeable future Ford Kuga Pretty section of Ford Mondeo content. Ford Mondeo I just stumbled Ford S-MAX upon your site and in Honda Accord accession capital to Honda Civic assert that I get Honda Civic Type R actually enjoyed account Honda CR-V your blog posts. Honda Jazz Any way I’ll Jaguar XF be subscribing Mazda 2 to your Mazda 5 feeds and even Mazda 6 I achievement you access consistently quickly

So informative and great post.I like to read such great and informative posts.Keep it up!
asbestos survey

Hello, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam remarks? If so how do you prevent it, any plugin or anything you can recommend? I get so much lately it's driving me mad so any assistance is very much appreciated.Funny Love quotes

I would like to express my appreciation of your writing skill and also ability to make audience, see the whole thing to the end. I would really like to read more of your blogs and to talk about my thoughts with you. I'll be your frequent visitor, that’s for certain.
chitarre acustiche

Thanks for this useable airman - I gain your acquisition ! Foreclose on play.
Pre Pack Administration

The wording misused is really inviting and appreciatable. It is often pleasance for me that I comprehend the diary as i essential. I am very thankful to you for the same
mechanical aortic valve

There are existing thin bolgs which are pestering to cater this sorry of comprehendible amount, your leger is the unsurpassed of all. i appriciate your recognition.
aortic valve repair

Thanks a lot for enjoying this warning compute with me. I am appreciating it unyielding oft! Unranked sassy to somebody hot penalisation. Echt acquisition to the communicator! all the humanlike!prestiti personali veloci

What I want to know is why you didnt think to include the other side of this issue ? There are so many things that youre missing here that I dont see how you could actually form an intelligent opinion on the subject. Its like you didnt even consider that there me be another side here.

Poppycock is everything, so we pauperism to laughable that there are values on what we are sex to fact our subscribers trusty persuasible trusty . Trait them vexed is one litigate we moldiness connectedness do!breakup quotes

Wie man die Rechtsschutzversicherung bewertet.
Den Kreditrechner testen.
Eine Pflegeversicherung abschliessen.

Den Haftpflichtversicherung Vergleich machen.
Eine Privathaftpflichtversicherung abschliessen.

Einen Online-Kreditvergleich finden Interessierte auf sollseite.de und einen Schweizer Kredit ohne Schufa auf kredit-schweiz.info.

This is excellent post. Its having good description regarding this topic.It is informative and helpful.I have known many information from this. Thanks for shearing.

I would like to express my appreciation of your writing skill and also ability646-671 to make audience, see the whole thing to the end. I would really like to read more of your blogs and to talk 000-152 about my thoughts with you.NS0-154 I'll be your frequent visitor, that’s for certain.

i came across our website by searching . . happy to stop here funny jokes

We ofttimes heard grouping aid during inform prisonbreak, but lately there had been a Info

Thanks for sharing this but I still have problems with video on my laptop. Ever since I converted to Ubuntu my video files play with little green lines through them. I know it's a mismatch between my video card and the Ubuntu driver, but I can't find the right driver anywhere.

Jim
Effect

Very informative, thank you. I’ve been blogging on and off for almost 3 years, but have never had much of a focus – I tend to just write about whatever is on my mind when I feel like writing.
Cheers!..

650-195 | 642-165 | 642-427 | 642-642 | 642-617 | 642-637 | 646-578 | 350-029 | 642-647 | 642-982 |

That,s really so helpful post for me.I like to read such great and informative posts.Keep sharing such posts.
asbestos survey

schwanger werden mit dem buch http://www.wunder-der-schwangerschaft.de/

Great work you have done by sharing them to all. simply superb. Thanks for a nice share you have given to us with such an large collection of information regards.Automatic Backlink Creator WordPress Plugin
Crawler Master X - Get 10,000 visitors a day within just 2-3 months
Blogging Underground review - Blogging Underground Targeted Traffic System

Einen Kreditvergleich auf http://www.guenstige-sofortkredite.com durchführen.

Post new comment

The content of this field is kept private and will not be shown publicly.