It can be installed with APT using ' apt-get install libx264-dev ' but let's make sure we have both the latest ffmpeg and the latest x264.
X264 is a free library for encoding H264/AVC video streams. $ sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libopencore-amrnb-dev libopencore-amrwb-dev libgsm1-dev zlib1g-dev libgpac1-dev These are readily available in the Ubuntu repository, let's add them: Let's get to it!ģ) Installing AAC, MP3, Theora, Vorbis, AMR, GSM That's ok, we haven't installed the external libraries required by our ffmpeg build. It will inevitably lead to something like: $ ./ configure -prefix=/usr/local -enable-gpl -enable-version3 -enable-nonfree -enable-shared -enable-libopencore-amrnb -enable-libopencore-amrwb -enable-libfaac -enable-libgsm -enable-libmp3lame -enable-libtheora -enable-libvorbis -enable-libx264 -enable-libxvid Let's also build shared libraries, which are useful if you're running multiple copies of ffmpeg : Let's go wild and enable these additional encoders: AAC, MP3, Theora, Vorbis, x264, xvid, AMR, GSM. Chasing them all is a bit of a pain in the #$$ and hopefully this article will help! These encoders are missing because they're handled by external libraries which are not part of the ffmpeg source package. Why, oh why are they missing? Take another look at the output of the configure command: Can you live without these? Probably not. A number of major formats, like AAC, MP3, x.264 or XViD are missing.
Take a closer look at the output, especially at the ' Enabled encoders ' section. Of course, you could just go ahead with configure, make, make install and be done with it. so files.įirst of all, let's get the latest ffmpeg source: My advice is to remove all existing copies of libav* ( libavcodec and so on) which may be present in /usr/lib, either by uninstalling them with APT or by deleting the. Let's take care of it:ĭone! One final note before we start building: if you have an existing installation of ffmpeg, you may run into linking issues caused by conflicting library versions. The x264 build requires a recent version of the yasm assembler.
Just create a temporary directory anywhere you like (you'll need about 150MB). Now would be a good time to decide where you're going to build all those sources. $ sudo apt-get install build-essential nasm pkg-config Let's also add some mandatory build tools: Then, we need to make sure that git and svn are installed.
This procedure was successfully performed on a vanilla Ubuntu 12.04 system.įirst, we need to enable the 'multiverse" repository in /etc/apt/sources.list, because that's where some of our external libraries live. All you have to do is uncomment the line similar to:Īdd deb precise multiverse sudo apt-get update The purpose of this article is to show you how you can build a fresh, up to date version of ffmpeg supporting (almost) all major codecs.
Unfortunately, the default build included in Ubuntu is usually quite outdated, as well as lacking support for many codecs. Enjoy :)įfmpeg is THE audio/video conversion tool.
By popular demand (according to page view stats), I've decided to refresh the Dec'2008 post ( "HOWTO: compiling ffmpeg + x264 + MP3 + Xvid + AMR on Ubuntu 8.x") for Ubuntu 12.04.