How do I install the latest development libraries of FFmpeg in my ubuntu?

Why does the Synaptic Package Manager not show the latest versions?

From Ubuntu Wiki – Stable Release Updates:

Once an Ubuntu release has been completed and published, updates for it are only released under certain circumstances, and must follow a special procedure called a "stable release update" or SRU.

This means that packages are often not kept up-to-date with active upstream sources.

Can I do something to fix it?

You can compile and install your own recent version of ffmpeg and its libraries by following a step-by-step guide: Compile FFmpeg on Ubuntu, Debian, or Mint. This guide performs a local installation, so it will not interfere with repository packages or system files, but if you are compiling something that depends on the new libraries you may have to tell it where your new ffmpeg libraries are located.

If you are compiling many programs, or need several more recent packages than what is provided, then Ubuntu may not be the most efficient distro for you in the long run.

How can I find the version of the libraries that are already installed on my system?

The major version is present in the package name, such as libavcodec53.

I am trying to delete the older version ENTIRELY and again install the new libraries from source.

If you want to perform a system installation that replaces the ffmpeg or libav-tools package and/or libraries then you can simply remove the existing packages, then compile ffmpeg, then install to system with checkinstall or some other method. See this old version of the previously mentioned guide that does all of that, but be aware that it is outdated and at the very least you may have to add --extra-libs=-ldl to your ffmpeg configure line.

If you want to perform a local installation then follow the current version of the compile guide.


Misleading package names

You should be aware that the so-called "ffmpeg" from the repository is not actually from FFmpeg, but from a fork called libav. See Who can tell me the difference and relation between ffmpeg, libav, and avconv?


This answer is to help newbies install the latest development libraries of FFmpeg and to WORK with them. I came to know it the hard way, that installing a development library is just the beginning. The real difficult part is to compile (with appropriate flags) and make an executable (successfully!) out of the source file.

  • Follow the procedure given here : Compile FFmpeg on Ubuntu, Debian, or Mint

The procedure in the above link is pretty straightforward (though it is lengthy and a little time consuming). You have to copy the commands and paste them in your terminal.

  • The above procedure creates a local installation of the FFmpeg library. It is a static library. By local installation I mean that the system doesn't know anything about the library.

The information about types of libraries and how to use them can be found with the help of Google. This is enough to get you started : Types of Libraries. You can skip reading it if you are just concerned about getting the compilation of the source code using the libraries done.

  • Now, this is the tough part. I had to try for hours, to get this part right. You need to let the compiler know about your FFmpeg library. You actually do that in the next step while giving it appropriate flags. But you need to do some preparations before the next step.

Copy all the .pc files from /home/jsp99/ffmpeg_build/lib/pkgconfig and paste them into /usr/local/lib/pkgconfig

Since copying and pasting in Ubuntu is not so easy, follow this link for instructions.

  • To actually compile the source code and form an executable, type this command in the terminal :

gcc -Wall -o module1.out -I/home/jsp99/ffmpeg_build/include -L/home/jsp99/ffmpeg_build/lib module1.c $(pkg-config --cflags --libs libavformat libavcodec libswscale)


/home/jsp99 is current user's home folder.
module1.c is the name of my source file.
module1.out is the name of the exectable file (output).