View Full Version : MKV to MP4 in less than 1 houre?
I regularly watch 720p mkv-files with a x264 or h264 codec. Now I want to watch those files on the appleTV.
The only solution I found so far was to demultiplex the mkv file. Then I get an .ac3 and a .H264 file. This process only took me 15 minutes (4,5GB file). Now I put them in the MP4 container with MP4box. But because MP4box does not support .ac3 files, I have to convert this first. When this is done I finally capable of producing a MP4 file, but MP4box takes up to 4 hours to complete this process (4GB video, 0,5 GB audio )
I find this rather strange since the 2 containers use the same codec (h264). So I guess here is no conversion needed. Isn't there a faster way to convert from MKV to MP4? (maybe without having to convert the audio file first)
thx in advance:)
Kurtnoise
1st May 2007, 16:14
With (g)dsmux from Haali Media Splitter package...you should be able to convert directly mkv files to mp4 much more quickly.
foxyshadis
1st May 2007, 22:05
With the latest avidemux, you should be able to mux it directly into mp4. The time-line seeking doesn't seem to work at all on mkv or ogm, but at least you can change containers.
Speediakal
2nd May 2007, 00:02
try the apple tv converter (http://www.redkawa.com/blog/post.php?t=1033)
thx for answering,
I tried gdsmux but I don't seems to find any options to save as MP4? (already tried to name it .MP4 before starting to mux, didn't work)
I've also tried Avidemux (2.3.0 and 2.4 preview1): when I open a mkv this text pops up: "H264 detected, If the file is using bframe as reference, it can lead to crash or stuttering. Avidemux can use another mode which is safe but you will loose frame accuracy. Do you want to use that mode?" Whatever I choose , the output file seems to be in slow motion, with sometimes with some frames played in reverse. (I use a small sample with a driving car, suddenly it goes backwards) This is in VLC media player. In quicktime, when I choose to work in that safe mode, quicktime crashes. When I choose not to, I get a black screen with no sound for as long the sample plays.
The apple TV converter seems to work, but it took me me 14 minutes to convert a 1 minute file (best video quality , high audio quality) That's not really a solution. It works in itunes so I assume it will work on AppleTV
(by the way, this program is full of advertisements and my virus-scanner says it making connection with the internet)
Speediakal
3rd May 2007, 03:07
the speed of the encoding is not just based on the encoder, but more largely based on your CPU.
maybe try opening in MPEGStreamclip then exporting to ipod. or try SUPER.
foxyshadis
3rd May 2007, 08:18
The point is that he wants to remux, not re-encode.
You can use gdsmux for it, you just have to give the output file a .mp4 extension. You can test it in mp4box or a hex editor if you're leery, like I was, but it appears to have used mp4 correctly.
No idea whether gdsmux will allow the nero ac3-in-mp4 format, you might just have to extract & convert that track.
I tried gdsmux again. the output (.mp4) file had no audio in VLC and in quicktime he gave: " error50:unknown error. "
Then I disabled the audio track before starting to mux. VLC plays it, without audio off course, but quicktime sais: "The movie contains an incorrect duration"
So I think the audio isn't the only problem.
gdsmux is acctualy very fast. It converts a 49MB file (60sec duration) in less then 10 seconds. Other programs took up to 14 minutes (!!) to convert the same file.
(I have a Core duo T2500 (2,0ghz), fast enough if you ask me)
Kurtnoise
3rd May 2007, 13:43
1/ VLC doesn't support ac3-in-mp4. You have to reencode this stream either aac or mp3 to be compatible with this player.
2/ QuickTime is not very accurate and not the "must to have" to play mp4 files.
3/ yes, dsmux is fast coz it doesn't (re)encode your streams, just (re)mux them.
I use quicktime because it is my only indicator that it will work on AppleTV.
I converted the AC3 track to AAC but it didn't make a difference. The output file isn't playable (used MP4box to mux) . It seems MP4box isn't capable of converting raw H264 file into a working MP4 file.
For me it seems that MKV to MP4 is just not possible without encoding the whole file.
Kurtnoise
3rd May 2007, 16:22
I use quicktime because it is my only indicator that it will work on AppleTV.
In this case, don't retrieve mkv files but avi instead...
I converted the AC3 track to AAC but it didn't make a difference. The output file isn't playable (used MP4box to mux) .
how do you do that exactly ? which tools did you use ?
It seems MP4box isn't capable of converting raw H264 file into a working MP4 file.
It seems that you don't know how to use this tool properly...No problem with this here.
In this case, don't retrieve mkv files but avi instead...
yeah, but then I can't enjoy HD files on my HD screen
How do you do that exactly ? which tools did you use ?
actually, I dont' know...I trying to figure out with which program i did use.
I tried BeLight (http://www.doom9.org/index.html?/belight-ac3toaac.htm) but he keeps outputting a .MP4 file.
It seems that you don't know how to use this tool properly...No problem with this here.
very good possible:p . I silmply add the H264 file into MP4box(with Yamb 1.6 ) and I start to mux.
you can also use mp4creator from mpeg4ip to mux from .264 to .mp4
Speediakal
5th May 2007, 23:56
yeah, but then I can't enjoy HD files on my HD screen
they don't need to be in an .mkv, they could be in an .avi DivX (or am i missing something here?)
Yes, but you will not find HD files in AVI, there all in MKV.
Is x264 much different then H264 ? I have a mkv video with x264 video-codec, but MKVextract outputs a H264 file? Maybe MP4box is having trouble with this?
foxyshadis
6th May 2007, 23:33
x264 is an implementation of H.264/AVC, all implementations will use the same generic code stream. mp4box has been compatible with it for years, though.
Speediakal
6th May 2007, 23:42
Yes, but you will not find HD files in AVI, there all in MKV.
so your downloading these movies? they come in all kinds of formats, WMV and Avi
I've only found avi-files, but they are smaller in resolution and not so good in quality because they use Xvid as codec and not H264 like MKV. So I can work with AVI, but only as last option.
Speediakal
8th May 2007, 03:13
well, why don't you use MKVExtract to extract the streams. then use avc2avi to convert the .264/.h264/.avc file to an avi (make sure you add the correct framerate and codec [usually h264]) then , if needed, convert the audio file to a codec compatible with VDub, then open up VDub and open the .avi file created from avc2avi, then go to Streams then Stream List, then add the audio stream, then do a direct stream copy and save as an avi. then open up MPEGStreamclip and export to mp4.
halsboss
8th May 2007, 03:23
Does anyone have a link to documentation (command line switches) for mp4box ?
Spediakal - nice post !! :) I'll probably do that to crack mkv files for processing by avisynth/HC and demuxed audio by ffmpeg etc. Thanks ! Is there any way to specify the aspect ratio in an avi ?
Does anyone have a link to documentation (command line switches) for mp4box ?
Spediakal - nice post !! I'll probably do that to crack mkv files for processing by avisynth/HC and demuxed audio by ffmpeg etc. Thanks ! Is there any way to specify the aspect ratio in an avi ?
there is a program called YAMB to use MP4box with a user interface.
http://yamb.unite-video.com/
well, why don't you use MKVExtract to extract the streams. then use avc2avi to convert the .264/.h264/.avc file to an avi (make sure you add the correct framerate and codec [usually h264]) then , if needed, convert the audio file to a codec compatible with VDub, then open up VDub and open the .avi file created from avc2avi, then go to Streams then Stream List, then add the audio stream, then do a direct stream copy and save as an avi. then open up MPEGStreamclip and export to mp4.
So if I understand correctly, you demux your mkv and mux the H264 in an avi , and then you demux that to mux the H264 in an MP4? I don't see how this will work in the end. If I demux (mkvExtract) the H264 file I can't put it in an MP4 with MP4box, so why would it work by going via avi first?
halsboss
9th May 2007, 00:17
Thanks. Made sense once you laid it out. Found mp4box documentation at http://gpac.sourceforge.net/doc_mp4box.php
vlada
10th May 2007, 12:40
twan
h.264 = MPEG-4 AVC, it is a standard for video compression. x264 is a codec (program) to compress to this fromat. h.264 vs. x264 is like MPEG-2 vs. CCE. Once again: x264 IS NOT a format, it is a program to compress video to h.264 fromat.
To convert MKV files to MP4 use following steps:
1) Extract all audio/video streams from MKV using MKVExtract or any other application you prefer.
2) Convert audio streams to a fromat that is supported in MP4 container (AAC, MP3). It doesn't matter if it will be a raw AAC stream or if it will be in an MP4 container.
3) Mux the streams to MP4 in any tool you prefer. MP4Box never does any recompression.
QuickTime doesn't have full h.264 support. It is not a good player to test MP4 files.
thanx for the information.
I followed your steps before. They dont' work in quicktime. I use quicktime because it the only reference to get it to work on AppleTV.
I simple want to see my MKV files on AppleTV without having to re-encode the video track. I've chosen to use MP4 because I thought AVI could not support the h264 fully. (I learned now MP4 also doesn't). If someone can gives me an alternative solution without using MP4 that's fine for me too.
(thx again to any help that been given to me here. )
cyberheater
10th May 2007, 16:42
thanx for the information.
I followed your steps before. They dont' work in quicktime. I use quicktime because it the only reference to get it to work on AppleTV.
I simple want to see my MKV files on AppleTV without having to re-encode the video track. I've chosen to use MP4 because I thought AVI could not support the h264 fully. (I learned now MP4 also doesn't). If someone can gives me an alternative solution without using MP4 that's fine for me too.
(thx again to any help that been given to me here. )
I thought that Appletv only supports mp4 level 4.1 or lower. Most MKV files seem to be level 5.1
vlada
10th May 2007, 17:12
twan
It's not that MP4 doesn't support h.264. MP4 container is especially meant to support MPEG-4 audio/video. Unfortunately Apple doesn't fully support h.264 (MPEG-4 AVC). It's not a fault of MP4 container, but it's Apple's fault.
Btw. you cannot specify AR in AVI. You can do it in MP4 and MKV, also you can specify AR of a MPEG-4 video stream in AVI, but I seriously doubt Apple will support it.
The MP4 you created plays in VLC or MPC (with ffdshow or CoreAVC decoder)? If it plays in VLC but not in QuickTime, it is most probably a high profile h.264 video which Apple doesn't support. If it's true you'll have to transcode the video.
Unfortunately I don't know any tool, that would recognize, which profile of the MPEG-4 AVC standard was used in a video file.
Kurtnoise
10th May 2007, 17:57
I don't know any tool, that would recognize, which profile of the MPEG-4 AVC standard was used in a video file.
MediaInfo is able to retrieve Profiles & Levels from AVC raw files. Maybe AVInaptic too.
Found this with mediaInfo:
Codec : MPEG-4 AVC
Codec/Info : MPEG4 ISO advanced profile
is this the 'profile' that you mean?
vlada
10th May 2007, 22:02
No, this is not the profile and level you need to know. I don't know why, but MediaInfo gets the information only from RAW (demuxed) .h264 streams. It should look like this:
Video #0
Codec : AVC
Codec/Info : MPEG-4 AVC
Codec profile : High@L5.1
Width : 16 pixels
Height : 16 pixels
Aspect ratio : 1.000
from my raw H264
Codec : AVC
Codec/Info : MPEG-4 AVC
Codec profile : High@L5.1
Width : 1280 pixels
Height : 544 pixels
Aspect ratio : 2.35
PixelAspectRatio : 1.000
DisplayAspectRatio : 2.353
vlada
10th May 2007, 22:39
So this clears it up. You can't play this video in Apple QuickTime. To get more information on the profiles etc., I's suggest you to read this FAQ (http://forum.doom9.org/showthread.php?t=96059). As you can see there, QuickTime has a very poor support of MPEG-4 AVC video.
thx, I learned alot here !
now there seems only 1 solution: hacking my AppleTV to play MKV :devil:
vlada
11th May 2007, 06:35
now there seems only 1 solution: hacking my AppleTV to play MKV :devil:
That wouldn't help anyway. The problem is not in container (MKV or MP4) but in video compression (which is independent on the container).
I've read it is possible to install OSX and then VLC (I suppose with extra codecs) to play MKV. But You can be right I haven't looked into it very well.
vlada
11th May 2007, 16:55
From Apple's web page:
H.264 and protected H.264 (from iTunes Store): Up to 5 Mbps, Progressive Main Profile (CAVLC) with AAC-LC audio up to 160 Kbps (maximum resolution: 1280 by 720 pixels at 24 fps, 960 by 540 pixels at 30 fps) in .m4v, .mp4 and .mov file formats
Only main profile is supported, not high profile. Also most HD movies will have over 5 Mbps. So unless you install an OS and VLC on your AppleTV, you won't be able to play these movies. Also I'm afraid the device will have too low CPU power.
I think a regular PC is the best multimedia player you can get. ;-)
Xbox 360 can now support playing streamed H.264 at 1080 resolutions and high bitrates, so this thread should be helpful there. But yeah, Apple TV isn't really made for HD, strangely enough.
fsinapsi
15th May 2007, 10:46
MediaInfo is able to retrieve Profiles & Levels from AVC raw files. Maybe AVInaptic too.
the current released version of AVInaptic retrieves Profile & Levels (and many other informations) but don't show them.
I'm just adding these...
The next release will show these infos, too:
[ About H.264 encoding ]
SPS id: 0
Profile: Main@L1.3
Num ref frames: 2
PPS id: 0
Entropy coding type: CAVLC
Weighted prediction: No
dwallersv
23rd May 2008, 17:24
Xbox 360 can now support playing streamed H.264 at 1080 resolutions and high bitrates, so this thread should be helpful there. But yeah, Apple TV isn't really made for HD, strangely enough.
This caught my eye (a year later). I want to do this. How?
I assume we're not just talking Windows Media Sharing, as this doesn't work with our XP machine (source) sharing via WMP11. No x264-type files can be shared (mkv or mp4 containers).
Are we talking about streaming through VLC or something? If so, how do you find it and connect from the Xbox360?
Or is there some other method?
Thanks for any pointers... I tried searching, and just couldn't get a small enough set of hits to find anything.
Southstorm
23rd May 2008, 22:19
This might help: http://forum.doom9.org/showthread.php?p=1091055#post1091055
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.