I am trying to build an automated solution to convert MKV files to MP4 without re-encoding on Mac OS X, using AppleScript, Automator, etc. and I need help!
Multiple times a day I get MKV container files that I need to convert to MP4 files. There is a great application for Windows called XenonMKV that can extract the individual components out of an MKV container and re-assemble them as an MP4. It does this process without re-encoding the video, which saves tons of time. A process that would normally take an hour or two can be done in three to five minutes with XenonMKV.
Unfortunately, there is apparently nothing like this application for OS X. There is, however, a little trick you can pull off using QuickTime 7 Pro and
Perian. Perian will let you open MKV files with QuickTime, which you can't normally do, and you can use the Pass Through option during export from QuickTime which achieves basically the same effect as XenonMKV.
So now that I know this process is possible, and since I have to do it multiple times a day, I want to try to automate it. It's pretty easy to slap together an AppleScript that can take a video file as input and then export it, but there are two hitches:
1. QuickTime Pro needs to use the specific Pass Through export settings no matter what the last export settings used were.
2. When you open an MKV file in QuickTime, the entire video must be indexed fully before you can run an export. This can take anywhere from a minute to three minutes or so, depending on the length and file size of the video.
The second problem seems to be the biggest because it doesn't appear there's any way to tell QuickTime to wait until a video is indexed before running a command. The best I could come up with was to parse the file size and then tell QuickTime to wait for a certain amount of time that's really just a best guess of how long it will take to index the video file based on its size. This is really not a good solution, because I'd like to share this with other people who might not have a system as fast as mine, and the numbers may be off.
So does anyone have any ideas on how I could make this process work? Ideally I'd like to see the final form as a standalone .app that can be used as a droplet and do everything automatically without any input from the user. Any help at all would be appreciated.
posted by wongcorgi at 6:45 PM on October 6