I have tried several times to extract the .h264 video stream, audio and a subtitle track from any given .mkv file in order to mux them to an AVI (with the video quality as in tact as possible) for cutting and upload to a streaming site. I use MKVextractGUI and extract all the necessary files. Then I use the AVC2AVI GUI to encode the .h264 to an AVI file w/o audio. Finally I open the AVI in AVIDemux and add the audio. The audio problem usually becomes apparent at this point. I notice the when I add the audio in AVIDemux it's severely out of sync. This same problem also occurs when I try to open the MKV file in VDM w/ avisynth (directshowsource) and save it as an Xvid AVI; the audio/video are out of sync.
+ Reply to Thread
Results 1 to 13 of 13
-
Last edited by Eva-Unit01; 28th Aug 2010 at 11:39.
-
I tried that and it didn't work. Even when trying to play the original MKV file in avidemux, the audio was still only slightly corrected at -1200 miliseconds, if at all. Are there any other methods for fixing the audio/video sync issue? would it be easier to just cut the clip out of the original MKV file? If the latter, which program would be best?
-
Not sure why you want to put H264 in an AVI container but for the sync issues, I've found this to work best for me.
Convert MKV to MP4 with Yamb (no re-encoding)
Open MKV in Virtualdub, find where you need to make your cut and make a note (00:00:10.000 - 1:56:49.205)
Open Yamb and pick Editing > Cllick to Split MP4 File
Open MP4 file and tick Split From
Type in the time noted in Virtualdub and click next
You should have an MP4 file which plays with no sound but not to worry.
Open mkvmergegui and drag in the mp4 file and click next. When finished, you should have an MKV file that is pretty close to where you cut and is in sync. -
Does anyone know how to cut a 2-5 minute segment of a 23 min. mkv in mkvtoolnix without quality loss?
-
I've seen a lot of people recommend using mkvtoolnix to cut MKV but I haven't heard anyone say how to do it and I can't see any way to do it myself which is why I posted my way of doing it. Same goes with MyMP4Box GUI. People say you can cut MP4 with it but I can't see any way to do it even though, like Yamb, it is a frontend for MP4box.
MKVmerge is the part of mkvtoolnix that is supposed to work. If you can figure it out, maybe you could post the answer.
Good luck finding a simple program to do it without paying for it. Avidemux is the only free program that comes close but as you can see, it's not perfect and causes sync issues.
Both MKVmerge and MyMP4Box GUI seem to only split files by size or duration. Not from place to place. -
Last edited by Eva-Unit01; 23rd Aug 2010 at 08:30.
-
You're sure the original MKV is not out of sync? Can you post a media Info text of the file?
You don't need to demux. Just drag the MKV into Yamb. Make sure the framerate is set the same as the MKV. -
Yes. The audio/video are in perfect sync when I watch the file in media player classic homecinema.
Are there any programs that come with mediainfo or an equivalent function, I'd rather not DL it seperately?
I am using my mp4box gui, not yamb. I don't intend to use yamb as it has a substantially poor rating on this site and apparently doesn't split files as is claimed.
I found out that the video is somehow at 29.97 fps even though there are no combing artifacts. Either the file info is wrong or the encoder deinterlaced instead of IVTC. The video is animation so it should have been inverse telecined.
EDIT:
I changed the fps settings accordingly to 29.97 (in box mymp4boxgui and mkvmergegui) and STILL everyresulting file suffers the same audio/video being out of sync problem.
I have waited several posts now and tried almost every conceivable method to fix the problem but the problem is still occurring. This leads me to believe that either:
1. The current MKV support for windows is not enough to accomplish the purpose stated in my OP post.
or
2. Some individual is in fact remotely hacking my computer and these otherwise nonexistant problems are happening intentionally.
So if the one or two people who have posted in this thread so far cannot help, I suggest they either give solid, conclusive advice or kindly stop wasting my time and allow for someone else to reply, if that would even make much of a difference.Last edited by Eva-Unit01; 23rd Aug 2010 at 14:47. Reason: Lack of helpful/useful/effective advice.
-
OK. I have fixed the problem completely. Here is how to definitively cut MKV files using MKVtoolnix/MKVmergeGUI.
1. Open up MKVmergeGUI.
2. Add the mkv file you want to cut.
3. Make sure that only the tracks you want in the finished files are checked.
4. Go to the "Global" tab and check "enable splitting".
5. To make cuts at specific times, select the timecode bubble and type in the desired times, using a comma and no spaces in between times. So to cut at 5:50 and 7:03 you type 00:05:50,00:07:03. Note, the splits occur 1 sec. or so after the time codes you type.
Similar Threads
-
MKV to MP4 encoding_hardsubbing and audio sync problems.
By Alcatraz in forum Newbie / General discussionsReplies: 11Last Post: 16th Mar 2012, 15:34 -
MKV stream extraction causing audio sync problems
By PlanetIndigo in forum Video ConversionReplies: 18Last Post: 29th May 2011, 22:07 -
Video + Audio (.mkv) sync with...?
By highend in forum EditingReplies: 3Last Post: 7th Apr 2011, 17:35 -
Sync problems after merging mkv video with mp3 audio
By billman1234 in forum Video ConversionReplies: 5Last Post: 29th Jun 2010, 15:00 -
Audio Sync problems with MKV file using WMP
By jradams76 in forum Software PlayingReplies: 0Last Post: 23rd Jul 2007, 11:51