I’ve got a number of videos in Matroska MKV format that I want to play on my PS3. The video in the MKV container is MP4, so the PS3 can handle it, but it doesn’t like the container format – it wants an AVI or MP4.
There are lots of ways you can get from one format to the other, my main requirement is to do container conversion where possible and leave the data stream untouched. This isn’t 100% possible when going from MKV to MP4 as most MKV files I’ve encountered, whilst they may have h.264 or MP4 video, they generally have an AC3 (Dolby Digital) sound track. It seems that MP4 files need to have an AAC sound track instead.
Therefore, the objective is to convert from one audio format to the other whilst leaving the video stream as-is. Of all the software out there that will assist with this task, it seems that just two easily available programs are needed.
First up, you must have Perian installed. Even if you’re not doing video conversions, Perian is so useful that you need it anyway.
Once you have Perian installed, open the MKV video in QuickTime Player. This will take a fair amount of time, depending on the size of the video, as when opening an MKV in QuickTime Player, it reads the whole file in.
At this point it is trivial to convert this to a QuickTime MOV file which is close to, but not quite, an MP4 file. Simply go to File -> Save As… and make it a self-contained movie. Done.
If you want to make it an MP4, a little more work is required. Go to File -> Export and select Export: Movie to MP4. Hit the Options button and under the Video tab, select Video Format: Pass through. Under Audio, you may want to up the bitrate on the audio. Hit OK and then Save and the video will be exported using the selected settings. On my machine with a 2.8GHz CPU, exporting a 1.4GB video only took a few minutes.
Now, this method isn’t 100% optimal, as it downmixes the surround sound track into an AAC stereo sound track. I need to work out a way to keep the surround information.