The original idea was to build ffmpeg with AAC support, but then I’ve found some other problems with mp3 codec, so I needed to apply a patch and rebuild everything.
So, I’m writing all the procedures in this post in a few steps, hoping that I’m not forgetting anything. I know that some steps could be avoided (e.g. building ffmpeg twice), but I’ll just transcribe everything the way that worked for me (as I remember).
First edit your aptitude sources list
Add the following repositories
Remove current ffmpeg (if installed)
Install necessary packages for the build. Note that I’ve removed libvpx-dev from the original Ubuntu thread.
Build and install x264.
Build and install ffmpeg. Note that I’ve removed the option –enable-libtheora and –enable-libvpx from the original Ubuntu thread.
Ok, everything works perfectly until I try to convert a video and I get the following error:
lame: output buffer too small
After a bit of googling, I’ve found a patch in this post, with an interesting discussion regarding to whom should fix the problem (ffmpeg vs. lame). It is also suggested to downgrade the lame library, but I’ve tried that and didn’t worked for me, so in summary, let’s simply apply this ffmpeg patch and everything will be fine.
Go to the ffmpeg source directory and get the patch