I have a few MKV files are they are a little out of sync (the audio is a bit behind).
Ive spent a few hours looking around for information and so far ive been able to split the audio and video into seperate files. (using MKVExtractGUI)
my eventual aim will be to burn these onto DVD (I usually use DVDStyler to create a menu etc)
Now im a little lost on what to use and how to get these files back into 1 viewable file so that the audio is in sync.
I used VideoInspector to get some info about the MKV file:
Video Codec: MPEG4 ISO Advanced
Audio Codec: Dolby(TM) AC3
Audio Sample Rate: 48000 Hz
After splitting the audio and video I got the resulting files:
00_Chapters.txt (blank file)
Im not too sure where to go from here so any help would be much appreciated
+ Reply to Thread
Results 1 to 15 of 15
Thread: Audio out of sync in MKV file.
You could convert the mkv/h264 to dvd mpeg using avisynth and quenc or hc encoder. Then use delaycut to cut the ac3 in the beginning(the amount that it's behind). Add the mpg/m2v video and the ac3 in dvd styler.
Or use delaycut to cut the ac3 in the beginning(the amount that it's behind). Mux it back to the mkv. Convert the mkv to dvd with a converter that supports mkv.
But if the h264 has Variable Frame Rate I guess you will get major sync problems after you converted to mpg.
Thanks for the reply Baldrick
What would be a good util for muxing it back to mkv?
How do i tell if its a Variable Frame Rate, and what would I do if it was?
Sorry for the noob questions :P
i have this problem as well, except, when i play it through VLC player is syncs perfectly, but when i demux it using MKVExtractGUI and analyzed both video and audio streams i found that the audio stream itself is slightly shorter than its counterpart.
it is also when i (did not know this) convert both files for a DVD and compiled them when authoring them, i found it was or going out of sync.
is there a way to fix this?
Originally Posted by Undead Sega
Originally Posted by Undead Sega
but tha still does not help, because it does not solve the problem with the fact that one of the streams is shorter than the other thus creating a a/v syncing issue. and besides of that application there are other we would use to authoer or merge the streams back but as another format, i.e. DVD.
Originally Posted by Undead Sega
but you are also claiming of using FAVC which is not my method of compiling a DVD. My method is taking both streams, the video encoded to a DVD compilant .m2v file, and the audio stream transcoded to a DVD compilant ac3 file and from there i would use DVD-lab Pro 2 to author or compile them to a DVD. It is from there i see syncing issues, but even before that when analyzing the files, they are of diferent lengths.
Originally Posted by WascallyWabbit
It seems that mkvextract relies on the spliter currently active in the system. I had the matroska splitter active and I think the frame rate was reported wrong (23,976). Using klite codec teak tool I've disable the original matroska splitter (even on matroska.org site they addmit "it has some bugs") and then Haali spliter (recommended by cccp-projet too) became the active one. Now the frame rate is reported 30,000 fps. (I was looking also for a tool that checks for variable frame rate but I don't think this is the case). Then I've picked megui from the pile of dosen of programs installed recenlty and finally i had an avi with sinc'ed AC3 and xvid video. IT's just that this megui think creates first an avisynth script then does the actual demuxing, converting and remuxing. It takes a little too long for my taste and why the hell does it need a script? I am still looking for a better alternative, but if I can't find anything else, this will do the job.
A few more things (later edit):
1. during the playback of the mkv/h264 file with matroska splitter active, watching the info section in ffdshow video config window i see a continuously variable frame rate
while with haali splitter it is fixed
2. the h264 file that mkvextractgui outputs is CORRUPT. No matter what sofware I tried to play it, after the first few good second it goes crazy with colors all over the screen.
Also, I don't understand why the system needs a mpeg spliter (or demultiplexer) to play a h264 file. Using graphedit and regsrvgui I've messed with various splitters (Mainconcept multiplexer was default but the problem is the same in Ulead mpleg splitter). Also I've tried changing from ffmpeg h264 to core avc codec and another one (i think ulead h264 decoder) but the file is corrupt in all of them.
After disabling matroska splitter and activating haali splitter i've done a new run of mkvextractgui but the h264 file is still corrupt.
Also, I've noticed the option to save a timecode file - i did not use this first time. But even if i use it, i don't know what to do with the file. And since I suppose bsplayer or mplayerc can't load this timecode when playing the h264 file I think this might be the cause for the apparent corruption of the file (?)
THis does not make sense, because the megui still has to demux the file somehow - right? I don't know how it does ti but the final file is not corrupt.
3. I understand from the warning some programes gave me, that h264 "elementary" mpeg-4 avc stream cannot contain by itself the frame rate so this must be included in
the container somehow or in a separate timecode table (?). well, since the matroska splitter was reprting the frame rate wrong (in all the programs I've checked it was 23,97) this framerate was used for the newly encoded file
and I think the correct one was 30,000 (some programs even required the user to insert the frame rate by hand).
4. While writing the above I've done an encoding test (MKV to AVI) using xvid4psp and agina the audio is in sync with the video
This confirms one more thime that my problem was due to the matroska splitter -which was good enough for playback but not good enogh when demuxing the file.
Last LATER Edit:
from the original Seal_Exclusive_Interview[TVG00015699].mkv file (approx. 13 mb) used as test (downloaded from vuze network)
a 19 mb xvis/ac3 file from megui with incredible good quality (compared with the later alternatives) - actually indistiguishible from the original
a 15 mb file from xvid4psp with visible lower quality although I've selected XVID 2 pass extreme profile.
Also, my first failed tries were most of them with xvid or divx video plus vbr mp3 audio. I was wondering if maybe this was causing my problem?
I've done a new try with megui and selected lame mp3 vbr , also did not pres the "analyse file" in the filters tab of avs script dialoge, and also did not checked "force use of direct show decoders" in the audio codec confid dialogue.
The result is again in sync.
well... seems i scared you lol
it's either because it's my first post or maybe because 'twas too long.
nvm i junst wanted to let you know that one or two days after my previous post megui made an automatical update and after that i wasn't ablt to obtain AVI's with sync audio. I even found a temporary fix somewhere on the forum but it still didn't fix the problem.
I've reinstalled my initial megui version but after a few varios errors related to avysinth i reached the conclusion that xvid4psp is more stable and does pretty much the same thing (while it seems a little less complex).
I often demux audio from mkv with MKVextract GUI to recompress them to make them smaller to fit on DVD. Quite often some of the audio files ar 3 to 7 seconds shorter. And the delay is not fixed. It is stretched over the whole audio track. I have solved this issue by setting playback ratio - there is such option available in MKVmerge GUI. I put e.g. some 10001/10000 and everything fits. I assume the stretch ratio was put in the MKV file in the first place. But its lost when extracted. But I do not have proof of it. Also it does not solves the problem how to stretch the audio when it has to be converted to DVD. I use CoolEdit if its stereo, or I download lower resolution avi with the same sound if it is 5.1 sound.
Cann't tell it's possible don't tell anything.
I dont know if this helps but i was trying to hard burn subtitles in a video stream so i took the original MKV (flawless file) with "soft" subtitles, and re encoded it with handshake. I did this on 2 different computers with the same "handshake" encoder. On the xp machine 64 bit gateway machine running in 32 bit xp os i had audio desynch of 10 or so seconds on the encoded file. but for some reason.. windows 7 on the 6x 64 bit processor running in 64 bit mode it was a flawless handshake encode with no sync errors. So it seems with same encoder different results on different machines. Handshake is a GNU encoder that can handle mp4 and mkv's on source forge. windows 7 machine was 3x the frame rate on the encode too. MKV soft subtitles (180kb file) --> mkv burned subtitles (240kb file) ---> anyvideo (freeware) to convert to (mpg 1.3 gig file) ---> windows 7 dvd maker ---> DVD that works in any dvd player.
file == mkv
re encode mkv to mkv
software == handshake
64 bit x4 processor windows 7 == flawless
64 bit x2 (in 32 bit os) winxp == severe 10+ seconds audio desynch