muxkv is a command line wrapper for mkvextract, ffmpeg and sublerCLI on OS X.
It will pass the video track through and convert the audio from ac3 to aac.
This script relies on SublerCLI, mkvtoolnix(mkvextract) and ffmpeg on your system.
SublerCLI is available from https://code.google.com/p/subler/downloads/detail?name=SublerCLI-0.19.zip&can=2&q=
mkvtoolnix is easiest to install through homebrew with the command "brew install mkvtoolnix" though is also available from http://www.downloadbestsoft.com/MKVToolNix.html
ffmpef is also available through homebrew with "brew install ffmpeg" though can be found at http://www.evermeet.cx/ffmpeg/
Once these programs have been installed this script can be downloaded through git with "git clone https://github.com/TheProphetOfRa/muxkv.git" and then added to your system path like the above.
Open a terminal in the directory containing the file you wish to remux and enter the command: "muxkv -s 'source-file.mkv' -d 'destination-file'"
The -i or --interactive flag specifies interactive mode which will ask for direction based on the codecs found in the mkv file
The -s or --source flag specifies the path for the source mkv file.
The -d or --destination flag specifies the desired name of the resultant file.
The script will create and delete several files as it runs and output some text to your console.
Once the script has completed it will display "Done." and there will be a file marked .mp4 in the folder.
During the "Merging the resulting audio and video." stage it may display "Error decoding sei message". This message will not impact upon the playability of the final file and is something to do with the frame packing of the h.264 video file.
Jamwillinob for supplying the regular expressions used in parsing mkvinfo output.