You might try the scripts on
this page. I haven't tried them myself, but the ffmpeg options themselves seem fairly clear to me.
It should work on any input format that ffmpeg can read. Make sure you have the faac/faad packages installed for aac support.