I\'ve been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck. Ideally, I\'d have a snippet of code that I could call from my
I've had good luck using mplayer (which I believe uses ffmpeg...) and lame. To the point that I've wrapped it up in a script:
#!/bin/sh
TARGET=$1
BASE=`basename "${TARGET}"`
echo TARGET: "${TARGET}"
echo BASE: "${BASE}" .m4a
# Warning! Race condition vulnerability here! Should use a mktemp
# variant or something...
mkfifo encode
mplayer -quiet -ao pcm -aofile encode "${TARGET}" &
lame --silent encode "${BASE}".mp3
rm encode
Sorry for the security issues, I banged this out on the train one day...
My mplayer and lame come from fink