Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

emmgunn

macrumors member
Original poster
Jul 7, 2008
94
0
Hello!
I just recently found this forum in my search for people trying to convert mkv videos for use on Apple TV (or PS3 or Xbox 360 for that matter). I have an application called MKVtools that I know some here have used, and I'm looking for feedback on the latest beta. There is a video related forum that I frequent, but there doesn't seem to be much interest in converting MKV files there, and the feedback I've gotten via e-mail, though very useful, has been limited. So when I saw an 11 page (at last count) post on converting mkv movies into mp4, I thought that this might be a good place to post.

I'm not sure how to do this without coming across as trying to pimp my software, because that is not my intention, so please let me know if I've crossed any boundaries. I'm just trying to finish a project that I naively started as something fun to try, but which has reached a kind of state of limbo, though I think it would of interest to many people here. Specifically, after receiving numerous requests, I started working on expanding the capabilities of MKVtools (it originally had the awful name of MoKgVm2DVD) to include the ability to convert MKV to MP4 for various devices like the iPhone, Apple TV, PS3 and Xbox 360. The problem is that, other than the iPhone/iPod, I don't have the other devices to test with, and so conversion presets for Apple TV, PS3 and Xbox 360 are still very much beta.

So if you have one of these devices, and if you're interested in giving the most recent beta of MKVtools a try, it can be found at http://www.emmgunn.com/betadownload.html. Note you'll get a nag screen when you run the software, but it is fully functional without registering. You can post comments here or you can e-mail me at emmgunnbeta@gmail.com and I'll try to incorporate the feedback into a working final release.

You should know that MKVtools is an application that controls a number of UNIX command line applications (the "tools") like mencoder and the suite of tools from mkvtoolnix. This means that its capabilities and limitations are directly related to the UNIX applications it controls. Also, I'm not enough of a UNIX expert to build distributable binaries from source, so MKVtools is limited to using UNIX applications that have pre-compiled binaries available for Mac OS X.

Some of the known issues/limitations inlude:
  1. The "tool" mp4box has issues with muxing large files (2GB seems to be the magic number). Apparently there is a patch to fix this issue, but I can't find a pre-compiled Mac OS X version of mp4box with this patch. The current work around would be to split the mkv file, process the parts, and then join the resulting mp4 files (all new capabilities of the MKVtools beta).
  2. Mp4box can't mux AC3 audio into an mp4 file. I don't know of any command line application that will do this. If you know of one, and pre-compiled binaries are available, let me know and I can probably add it to the tools controlled by MKVtools.
  3. The "tool" mencoder can't decode DTS. This is one of many limitations of the version of mencoder used by MKVtools. It's about two years old and I'd love to use a newer pre-compiled version of both mencoder and mplayer.
  4. 5.1 audio is converted to stereo. If anyone knows of a pre-compiled command line tool that will convert 5.1 audio into 5.1 aac, it could be incorporated into MKVtools.
  5. Can only mux one video track and one audio track into the mp4 file. This should be expanded in the next release, and will probably be in an upcoming beta.
Thanks in advance for any feedback/comments!
 
Hi,

Just wanted to say thanks for making this program because i really need something simple to convert my mkvs to something my ps3 can play. I tried a small test file and it seemed to work well so i am giving a large 4gb movie a try now. hopefully this will be as good as mkv2vob for pc.

It would be nice if you are able to include a progress bar or time remaining feature in the job window.
 
Hi,

Just wanted to say thanks for making this program because i really need something simple to convert my mkvs to something my ps3 can play. I tried a small test file and it seemed to work well so i am giving a large 4gb movie a try now. hopefully this will be as good as mkv2vob for pc.

You're welcome. Be sure to check "keep log files" in the help menu when you try the 4GB movie. The log files are generated by the UNIX apps controlled by MKVtools and so if anything goes wrong, you'll want to check these files. I'm guessing that mp4box will stall at around 98% completioin with this size file (see the known issue with workaround mentioned in my above post).

It would be nice if you are able to include a progress bar or time remaining feature in the job window.

It would be a nice feature, but very difficult to implement. Most processes require multiple steps using multiple tools with different methods of indicating progress.

BTW, there is a brand new beta just posted which fixes a bug that prevented mp4 files from being joined (something you'll probably need to do with 4GB movies) unless MKVtools was registered. All functionality (other than adding more than one job to the queue) is supposed to work in unregistered versions.
 
Yeah it stalled on the 4gb file, didn't find out at exactly what point though.

I broke the file down into 1gb pieces but when i converted the first file the audio was out of sync so i didn't bother with the others.
 
I've given it a shot, converting to mp4 is quite painless. but it seems to have issues with subtitles, not putting them in when i tell it to embed them.

If it makes any difference the subs are in the ASS format
 
Checked it out as well, looks like a pretty good start..its very easy to use.
I think you may need to add .mov to your output format as I think most people with AppleTV's will want to preserve 5.1 that comes in most MKV's.
And yes DTS to AC3 would be impressive and sell you a bunch of copies..
 
if you can make mkvtools do this: MKV (H.264 + DTS 5.1) to an MP4 (H.264 + AAC5.1)

that would be perfect :p

I agree. Ideally 5.1 sound should be preserved, but for now I'm not aware of any commandline tools that will do this. I'd love to include it if anyone can point me in the right direction.


Yeah it stalled on the 4gb file, didn't find out at exactly what point though.

I broke the file down into 1gb pieces but when i converted the first file the audio was out of sync so i didn't bother with the others.

Bummer. I'm assuming that you are passing through the video. How badly out of sync? Did you notice the fps field when you set up your conversion? MKVtools reads the fps of the video, but I've seen instances where it was wrong, and since the fps is used when muxing the video and audio it can throw the sync off by a lot. That might be the problem if the sync is way off.

Another thing to check would be the 1GB mkv files. Are they still in sync or did the splitting for some reason throw the sync off?

Also, is this an anime? I've run across a few anime, that no matter what I tried, I couldn't use pass through for the video and still maintain sync, and eventually had to recode the video.


I've given it a shot, converting to mp4 is quite painless. but it seems to have issues with subtitles, not putting them in when i tell it to embed them.

If it makes any difference the subs are in the ASS format

Were you passing through the video? If so then it's an issue that I just haven't had a chance to correct yet. MKVtools originally only converted mkv movies to avi, and so, what in hindsight was poor wording, the embed button for subtitles was understood to mean "burning" the subtitles into the video track, which requires re-coding the video. This poor wording has carried over to the mp4 conversion and will be fixed soon. Right now there is no way of muxing selected subtitle tracks into the mp4 file as individual tracks, but that will also be fixed soon.
 
I'm just following stomers method in the conversion thread...if there was a way to automate the audio extraction that would be awesome...if I knew how to write a script, I would try and help out.

Great job so far though.
 
Hi emmgunn

First of all thanks for these tools! I have two MKV files that would not convert to ATV in VisualHUB - they just stutter on the ATV although they play beautifully in VLC and QTP with Perian.

Your tool converted the first file very well indeed but with the second it crashes out with the error: media_tools/media_import.c:3712: failed assertion `nal_start'

For both files it asked for the length of the file and the frame-rate, it said it was unable to determine.

Cheers
Dave
 
Hi emmgunn

First of all thanks for these tools! I have two MKV files that would not convert to ATV in VisualHUB - they just stutter on the ATV although they play beautifully in VLC and QTP with Perian.

Your tool converted the first file very well indeed but with the second it crashes out with the error: media_tools/media_import.c:3712: failed assertion `nal_start'

For both files it asked for the length of the file and the frame-rate, it said it was unable to determine.

Cheers
Dave

Thanks for the feedback. Is there any chance you could e-mail (or post on some place like rapidshare and send me the URL) a clip of the second video, assuming you still get that same error message with the clip. I've never encountered that error message before. Also, I'd like a video for which MKVtools can't find the length or fps so I could maybe improve on that capability. My e-mail would be emmgunnbeta@gmail.com. Thanks!
 
Hi, i just tried the new beta version and encountered a problem. I am trying to passthrough the video and just convert the audio for use with my ps3. When i try and convert the file i get this error.

Code:
MEncoder dev-CVS-060307-04:23-4.0.1 (C) 2000-2006 MPlayer Team
Mac OSX static build for ffmpegX
CPU: Intel  (Family: 6, Stepping: 11)
FIXME:Hardenabling SSE and SSE2 without detection
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

success: format: 0  data: 0x0 - 0x2a49265
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_DTS), -aid 0, -alang und
[mkv] Will play video track 1
[mkv] Will play audio track 2
Matroska file format detected.
VIDEO:  [avc1]  1280x544  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31  fourcc:0x31637661  size:1280x544  fps:23.98  ftime:=0.0417
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Cannot find codec 'dts' in libavcodec...
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
No accelerated IMDCT transform found
hwac3: switched to DTS, 1536000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, ac3, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [hwdts] afm: hwac3 (DTS through S/PDIF)
==========================================================================
Ignoring video stream!
videocodec: framecopy (1280x544 24bpp fourcc=31637661)
[format] Sample format big-endian AC3 not yet supported 
[libaf] Reinitialization did not work, audio filter 'format' returned error code -2
Couldn't find matching filter/ao format!

Exiting...

When i try and play the file in mkvtools i get the video but the audio is just static.

Also out of curiosity do i have to use the ps3 settings to change the avc level of passed thru h264 videos to 4.1? Thanks
 
When i try and play the file in mkvtools i get the video but the audio is just static.

Also out of curiosity do i have to use the ps3 settings to change the avc level of passed thru h264 videos to 4.1? Thanks

You've come across one of the big limitations of the version of mencoder and mplayer used by MKVtools. They were not built with support for DTS. I'd love to find newer versions but haven't had any luck so far. If you're somewhat comfortable with the command line you could use macports to build your own version of mencoder/mplayer with DTS, and use them to replace mencoder/mplayer inside MKVtools' "package contents". I know of at least one person who has done this. Unfortunately, your build will not work on other peoples computers.

Both the AppleTV and Xbox 360 presets will change the avc level of passed through video.
 
Thanks for the feedback. Is there any chance you could e-mail (or post on some place like rapidshare and send me the URL) a clip of the second video, assuming you still get that same error message with the clip. I've never encountered that error message before. Also, I'd like a video for which MKVtools can't find the length or fps so I could maybe improve on that capability. My e-mail would be emmgunnbeta@gmail.com. Thanks!

Hi

It's a 2GB file so getting the whole thing to you might be a challenge. How could I get a part of it, how to edit without changing the file type/properties etc?

Dave
 
Hi

It's a 2GB file so getting the whole thing to you might be a challenge. How could I get a part of it, how to edit without changing the file type/properties etc?

Dave

The newest beta of MKVtools will let you split the MKV file into:
  1. identical sized chunks where you select the file size, or
  2. one isolated clip of the video where you specify the start and end time of the section you want to isolate.
You could use the second option to create a 1 minute long clip, though this functionality is still in beta so we'll see how it goes :).
 
The newest beta of MKVtools will let you split the MKV file into:
  1. identical sized chunks where you select the file size, or
  2. one isolated clip of the video where you specify the start and end time of the section you want to isolate.
You could use the second option to create a 1 minute long clip, though this functionality is still in beta so we'll see how it goes :).

OK I'll take a look
 
This looks really good, any chance you'll be adding the ability to convert to vob/mpg containers?
 
This looks really good, any chance you'll be adding the ability to convert to vob/mpg containers?

I don't know much about vob/mpeg containers, so we'll see. Right now I just want to get this version out.

Lycanthrope: There is a new MKVtools beta that uses a different method to find video properties and should fix the issue where MKVtools asks for the videos duration and frame rate. Perhaps it also fixes the error you were getting.
 
I don't know much about vob/mpeg containers, so we'll see. Right now I just want to get this version out.

Lycanthrope: There is a new MKVtools beta that uses a different method to find video properties and should fix the issue where MKVtools asks for the videos duration and frame rate. Perhaps it also fixes the error you were getting.

Ok, Have you tried MKV2VOB on Windows? Thats the functionality I was meaning, give it a go. Tis perfect for converting files to a PS3 compatible format.
 
Time to convert file?

Hi I stumbled upon this thread and I'm having a problem that nobody else seems to be having. Or maybe it's just not an issue for anyone else. When I used MKV tools to convert a mkv file to avi and to include subtitles it took about 4 hours to convert it. That isn't a normal time frame to convert is it? The file was about 250mb. Anything I should be aware of to optimize the conversion time? Thanx for any help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.