This is just an update to the script I posted a while ago over here. It works the same, has the same requirements, it's just a bit more user friendly. Refer to the original post for details, grab the script below.
#!/bin/sh if [ $# -lt 3 ]then echo Usage: $0 \<infile\> \<outfile\> \<bitrate\> else mplayer -quiet -vo null -vc null -ao pcm:waveheader:file="/tmp/$$.wav" -af resample=48000:0:1 "$1" normalize-audio --peak "/tmp/$$.wav" aacplusenc "/tmp/$$.wav" /tmp/$$.aac "$3" MP4Box -new -no-sys -sbrx -add /tmp/$$.aac "$2" rm -f /tmp/$$.aac /tmp/$$.wav fi