Encoding AAC/MP4 audio files on OS X

·
  1. Install libmp4v2.
  2. Install FAAC (if the MP4-specific options show up in faac -h, then MP4 support is enabled).
  3. Optionally compile FAAD with ./configure --with-mp4v2 for AAC playback.
  4. Encode files on the command line with faac [options] infile.

Or use afconvert --verbose --file "m4af" --data "aac" INFILE OUTFILE, though that doesn't seem to work with data piped through FIFO from mplayer (mplayer crashes).

Update: faac seems to be producing strange artifacts in the audio. Maybe it's better to save WAV files and convert them to AAC with afconvert at the end.