I've got a bunch of dvr-ed HD mkv movies (h.264 + AC3) which I now want to change into an mp4 container with aac audio. So I basically want to just change the ac3 audio track to acc and keep the video stream as it is now. While I imagined this to be quite easy, I unfortunately haven't been able to do this for HD movies (sd works fine). I've already tried a couple of tools on my mac, but the result is always a not properly working mp4 file.

For example, here are the MediaInfo logs for an HD movie which I've tried to transcode with "MKV Tools". When I try to play back the resulting mp4 file in VLC, the picture stutters, audio is out of sync and the picture has added black borders to the top and bottom which weren't present in the souce file. Also note how the stream length has doubled during the transcoding process.

Source mkv file:

* * * MediaInfo Mac 0.7.33.4 file analysis report.
* * * MediaInfo Mac is �2010 by Diego Massanti - http://mediainfo.massanti.com
* * * MediaInfoLib by Jerome Martinez - http://mediainfo.sourceforge.net
Created on: 11.09.2010 19:50:30 MESZ
Report for file: Moonraker.mkv

General / Container Stream #1
Total Video Streams for this File.................1
Total Audio Streams for this File.................1
Video Codecs Used.................................AVC
Audio Codecs Used.................................AC3
File Format.......................................Matro ska
Play Time.........................................2h 1mn
Total File Size...................................8.22 GiB
Total Stream BitRate..............................9 723 Kbps
Encoding Library..................................Haali DirectShow Matroska Muxer 1.10.262.12
Video Stream #1
Codec (Human Name)................................AVC
Codec (FourCC)....................................V_MPEG 4/ISO/AVC
Codec Profile.....................................Main@L 4.0
Frame Width.......................................1 440 pixels
Frame Height......................................1 080 pixels
Frame Rate........................................25.000 fps
Total Frames......................................181624
Display Aspect Ratio..............................16:9
Scan Type.........................................Inter laced
Scan Order........................................TFF
Color Space.......................................YUV
Codec Settings (Summary)..........................CABAC / 4 Ref Frames
QF (like Gordian Knot)............................0.239
Codec Settings (CABAC)............................Yes
Codec Settings (Reference Frames).................4
Video Stream Length...............................2h 1mn 4s 960ms
Video Stream BitRate..............................9 273 Kbps
Bit Depth.........................................8 bits
Video Stream Size.................................7.84 GiB (95%)
Video Stream Title................................PID 2362 Video
Color Primaries...................................BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer Characteristics..........................BT.709-5, BT.1361
Matrix Coefficients...............................BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Audio Stream #1
Codec............................................. AC-3
Codec (FourCC)....................................A_AC3
Audio Stream Length...............................2h 1mn 4s 940ms
Audio Stream BitRate..............................256 Kbps
Audio Stream BitRate Mode.........................CBR
Number of Audio Channels..........................2
Audio Channel's Positions.........................Front: L R
Sampling Rate.....................................48.0 KHz
Audio Stream Delay................................59ms
Audio Stream Size.................................222 MiB (3%)
Audio Stream Title................................AC3
Audio Stream Language.............................English

Transcoded mp4 file:

* * * MediaInfo Mac 0.7.33.4 file analysis report.
* * * MediaInfo Mac is �2010 by Diego Massanti - http://mediainfo.massanti.com
* * * MediaInfoLib by Jerome Martinez - http://mediainfo.sourceforge.net
Created on: 11.09.2010 20:19:03 MESZ
Report for file: Moonraker.mkv.mp4

General / Container Stream #1
Total Video Streams for this File.................1
Total Audio Streams for this File.................1
Video Codecs Used.................................AVC
Audio Codecs Used.................................AAC LC
File Format.......................................MPEG-4
Play Time.........................................4h 2mn
Total File Size...................................8.00 GiB
Total Stream BitRate..............................4 731 Kbps
Video Stream #1
Codec (Human Name)................................AVC
Codec (FourCC)....................................avc1
Codec Profile.....................................Main@L 4.0
Frame Width.......................................1 440 pixels
Frame Height......................................1 080 pixels
Frame Rate........................................25.000 fps
Total Frames......................................363246
Display Aspect Ratio..............................16:9
Scan Type.........................................Inter laced
Scan Order........................................TFF
Color Space.......................................YUV
Codec Settings (Summary)..........................CABAC / 4 Ref Frames
QF (like Gordian Knot)............................0.122
Codec Settings (CABAC)............................Yes
Codec Settings (Reference Frames).................4
Video Stream Length...............................4h 2mn 9s 841ms
Video Stream BitRate..............................4 730 Kbps
Video Stream BitRate Mode.........................VBR
Bit Depth.........................................8 bits
Video Stream Size.................................8.00 GiB (100%)
Video Stream Title................................/Users/familiemiller/Desktop/Moonraker/Moonraker.mkv.v1.h264 - Imported with GPAC 0.4.6-DEV (internal rev. 5)
Date of Original Encoding.........................UTC 2010-09-10 17:59:34
Audio Stream #1
Codec............................................. AAC
Codec (FourCC)....................................40
Audio Stream Length...............................23s 744ms
Audio Stream BitRate..............................158 Kbps
Audio Stream BitRate Mode.........................VBR
Number of Audio Channels..........................2
Audio Channel's Positions.........................Front: L R
Sampling Rate.....................................48.0 KHz
Audio Stream Size.................................457 KiB (0%)
Audio Stream Title................................/Users/familiemiller/Desktop/Moonraker/Moonraker.mkv.tempAudio.t0.aac:lang=English - Imported with GPAC 0.4.6-DEV (internal rev. 5)
Audio Stream Language.............................English
Date of Original Encoding.........................UTC 2010-09-10 18:05:08