Multiple FFmpeg input & output
To pipe to x264 and encode to AAC file in the same command, use

ffmpeg -i in.mp4 -map v -f yuv4mpegpipe - -map a -c:a libfaac v.aac | x264 --demuxer y4m --crf 18 --output "v.mp4" -


Then you can mux it via

mp4box -add v.mp4 -add v.aac -new va.mp4