Roshan Book

My Tech Notebook

Fixing FFmpeg

A common question is “why doesn’t the repository FFmpeg convert to mp3, aac, mpeg4, etc?”. Ubuntu doesn’t make it very clear to the general user why the repository FFmpeg is limited or how to fix this issue. This is reflected in the number of forum questions relating to this topic.

Why is FFmpeg from the repository so limited?
All application software Ubuntu installs by default must be considered free, but Ubuntu views some encoders and formats to be proprietary or commercial. Users must install these packages on their own. See the Ubuntu Licensing Policy for more details.

How do I fix FFmpeg?
There are several options:

A. Compile FFmpeg yourself
B. Install the extra libraries
C. Use the Medibuntu repository

A. Compiling FFmpeg yourself (for all Ubuntu versions)
The official FFmpeg answer is to compile it yourself, giving you the option to get what you want with the bug-fixes, enhancements, and benefits of the most recent FFmpeg revision. This is an excellent solution and is explained here:

HOWTO: Install and use the latest FFmpeg and x264

This is the option that I personally use, and although it is not too hard, compiling may not be for everyone for a variety of reasons and the next options could be considered easier.

B. Installing the extra libraries
This is the quickest and easiest option for most users. FFmpeg from the repository does not include some encoders for formats such as: H.263, aac (libfaac), mp3 (libmp3lame), H.264 (libx264), xvid (libxvid), and mpeg4. You can fix this by installing the extra FFmpeg libraries. Open up Terminal and enter:

sudo apt-get install ffmpeg libavcodec-extra-52

Note: This package does not support libfaac (an AAC encoder), AMR-NB encoding, and AMR-WB decoding. I recommend using libavcodec-extra-52 from the Medibuntu repository if you need this functionality. See option C. Medibuntu.

C. Medibuntu
Medibuntu is a third-party repository that contains packages that are unable to be included in the official Ubuntu repositories. To install FFmpeg from Medibuntu open Terminal (Applications -> Accessories -> Terminal) and run the following:

sudo wget$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update

This huge command (adapted from Medibuntu – Community Ubuntu Documentation) will install the repository information to your computer then update and authenticate the new repository. Now install FFmpeg:

Ubuntu Natty Narwhal 10.10, Ubuntu Maverick Meerkat 10.10, Ubuntu Lucid Lynx 10.04 & Ubuntu Karmic Koala 9.10

sudo apt-get install ffmpeg libavcodec-extra-52

Ubuntu Hardy Heron 8.04

sudo apt-get install ffmpeg

That’s it. Now you have a non-crippled version of FFmpeg.

Undoing Changes Made By This Guide
B. Uninstalling the unstripped or extra libraries

sudo apt-get remove ffmpeg libavcodec-*-5*

C. Uninstalling FFmpeg and the Medibuntu Repository

sudo apt-get autoremove ffmpeg medibuntu-keyring && sudo rm /etc/apt/sources.list.d/medibuntu.list && sudo apt-get update

3 responses to “Fixing FFmpeg

  1. Louis Vuitton Sale December 1, 2011 at 3:29 pm

    Amazing weblog post, plenty of useful knowledge.

  2. Balenciaga Bag December 5, 2011 at 6:52 am

    I came across your article, i think your blog is cool, keep us posting.

  3. Guy Damico September 4, 2012 at 2:28 am

    None of the suggestions worked for me. I’m using LINUX Mint11. WHen I try adding “sudo apt-get install ffmpeg libavcodec-extra-52″ I get this reply:”sudo apt-get install ffmpeg libavcodec-extra-52″ When I try the other suggestion:”sudo apt-get install ffmpeg libavcodec-extra-52″ I get this response:” sudo apt-get install ffmpeg libavcodec-extra-52″ I am too new to linux to try compiling. IF anyone has any info it is greatly appreciated.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: