Ubuntu vs AAC (round 1)
For better or for worse, (generally for worse) a lot of multimedia systems seem to like making peoples lives difficult.
This is painfully obvious with AAC and the formats that use it (think mp4).
Luckally, playback can be assured by using a nice arrangement of plugins that are downloaded just in time to play the offending file on your computer (thanks ubuntu).
This help doesn’t extend to re-encoding though, so for those of you lucky enough to have an mp4 capable phone (like the sony erricsons), you can find that putting the latest Bleach on your phone to be an exercise in frustration.
The reasons for this are numerous and complexe but come down to the simple fact that if cannonicle put aac encoders in Ubuntu they’d be sued to kingdom come in the states (thank god I don’t live there
).
Help is at hand though, since even if the versions of the enncoding tools included with Ubuntu don’t come equiped, you can re-compile them so that they work as intended.
First up: ffmpeg
FFmpeg is one of the many swiss army knives used for video encoding available with Linux. It’s probably the easiest to use, and like it’s cousins, the ubuntu version comes cripled.
What to do?
First of all, make sure we have what’s needed to re-build it
sudo apt-get build-dep ffmpeg
Then add a few libraries (that add the magic support)
sudo apt-get install libfaac-dev libfaac0 libfaad-dev libfaad2-0 libfaad0
Finally, get the source code to ffmpeg
mkdir ffmpeg
cd ffmpeg
apt-get source ffmpeg
Now the fun starts, you should have 3 files and a directory before you.
Cd into the directory.
Now let’s move this thing arround a bit:
Open: debian/rules
This file tells dpkg how to build ffmpeg, we want to add a config flag so go to the lines that start with “confflags” and add on to one of them:
–enable-libfaad –enable-libfaac
Save, and quit, now all you have to do is re-build the package
dpkg-buildpackage
go have a coffee while it builds, and then install the result:
cd ..
dpkg -i ffmpeg*
To use, something like this is needed:
ffmpeg -i Source.avi -vcodec h263 -b 400 -s 352×288 -acodec aac -ab 64 -ar 48000 -ac 2 -f mp4 Dest.mp4
Update:
For the lazy, here are the debs that need installing:
Update:
For eugenia (and anyone else who also wants AMR support), here are the debs with it (supported in the ‘if it breaks you get to keep both pieces’ way since I haven’t got the means to test them atm:
July 16th, 2008 at 9:58 am
Can I ask for a big favor? Could you please provide us with new Ubuntu Hardy Heron packages that ffmpeg is configured like this
–enable-gpl –enable-pp –enable-swscaler –enable-pthreads –enable-libvorbis –enable-libtheora –enable-libogg –enable-libgsm –enable-dc1394 –disable-debug –enable-libmp3lame –enable-libfaadbin –enable-libfaad –enable-libfaac –enable-xvid –enable-x264 –enable-liba52 –enable-amr_nb –enable-amr_wb –enable-shared –prefix=/usr
instead of like this?
–enable-gpl –enable-pp –enable-swscaler –enable-pthreads –enable-libvorbis –enable-libtheora –enable-libogg –enable-libgsm –enable-libfaad –enable-libfaac –enable-dc1394 –disable-debug –enable-shared –prefix=/usr
You will find the amr-dev libraries needed to build as such at the medibuntu site: http://packages.medibuntu.org/pool/
If you do, please email me! thanks!
July 30th, 2008 at 6:23 pm
I’ll see what I can do, I’m unavailable atm due to the fact that I’m getting married.
I should have them up for 10/08 or there about.
David