Batch convert MKV to MP4 using ffmpeg

I had a bunch of files in mkv format that I needed to convert to mp4 format so that minidlna could serve them to my Xbox 360. Here’s how they can be converted in batch using ffmpeg.
for f in *.mkv; do 
fn="${f%.*}"
ffmpeg -i "$fn.mkv" -vcodec copy -acodec aac -ac 2 -strict experimental "$fn.mp4";
done
I used the following pages as resources: http://askubuntu.com/questions/159708/convert-mkv-to-mp4-with-ffmpeg http://www.unix.com/shell-programming-scripting/36851-separating-filename-extension.html