FFmpeg with libaacplus and fdk-aac support on CentOS

While working on a project for a client I needed to extend ffmpeg’s functionality and add a couple of features it doesn’t have out of the box. Needed to enable additional aac codecs.

I created a src folder under root’s home directory and did all the magic there.

mkdir /root/src && cd /root/src

For the build to go right, you’ll need a couple of packages:

yum install yasm yasm-devel gcc-c++ autoconf automake libtool git unzip

Now let’s install the codecs:

Fdk-AAC

Pretty simple:

wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master  
unzip fdk-aac.zip  
cd mstorsjo-fdk-aac-9a32340  
autoreconf -fiv  
./configure  
make && make install

Link the library:

ln -s /usr/local/lib/libfdk-aac.so.0.0.4 /usr/lib64/libfdk-aac.so.0

libaacplus

Just as simple:

wget http://ffmpeg.gusari.org/uploads/libaacplus-2.0.2.tar.gz  
tar xf libaacplus-2.0.2.tar.gz  
cd libaacplus-2.0.2  
./autogen.sh -enable-shared -enable-static  
make && make install

Link the library:

ln -s /usr/local/lib/libaacplus.so.2.0.2 /usr/lib64/libaacplus.so.2

Ffmpeg

git clone git://source.ffmpeg.org/ffmpeg.git  
cd ffmpeg/  
./configure -enable-gpl -enable-nonfree -enable-libaacplus -enable-libfdk_aac  
make && make install

Building ffmpeg takes a bit of time.

Once it’s done, link the binary:

ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg

Check how it works like this

ffmpeg -i input.wav -c:a libfaac -b:a 192k output.m4a

or like this:

ffmpeg -i input.wav -c:a libfdk_aac -vbr 3 output.m4a