View Full Version : Audio out of sync from MKV to MP4
Ortix
4th January 2009, 19:45
I have an MKV file which i recently re-encoded with meGUI to MP4, the only problem is that the audio keeps getting out of sync. I use VBR for audio with NERO AAC. As i'm typing this, i'm re-encoding it again but this time with ABR and force directshow enabled.
Anyway, what basically happens is that the video file plays fine but the weird thing is that the video seems to be shorter than the audio, actually it IS shorter than the audio. Basically the audio ends as it should at the end and the video is just cut off... and there are some parts where the video plays slow. Any ideas?
The video is encoded in h.264! Forgot to say that, sorry! and the audio is AAC
tetsuox
4th January 2009, 20:03
I have an MKV file which i recently re-encoded with meGUI to MP4, the only problem is that the audio keeps getting out of sync. I use VBR for audio with NERO AAC. As i'm typing this, i'm re-encoding it again but this time with ABR and force directshow enabled.
Anyway, what basically happens is that the video file plays fine but the weird thing is that the video seems to be shorter than the audio, actually it IS shorter than the audio. Basically the audio ends as it should at the end and the video is just cut off... and there are some parts where the video plays slow. Any ideas?
You haven't once mentioned MPEG4-AVC or H.264 in your post, container-related questions should be posted in http://forum.doom9.org/forumdisplay.php?f=74
Ortix
4th January 2009, 20:10
whoooops my bad! it's h.264, i posted that but then edited my post and probably removed that!
Sorry!
setarip_old
4th January 2009, 22:58
Hi!
1) Does your original source material, from which you created the MKV, behave the same way?
2) Why don't you re-encode from your original source material instead of the MKV?
Ortix
5th January 2009, 00:08
The MKV does not behave in the same way. The Video stream is for some reason shorter than the audio. I've gone through the log of meGUI and the video get's encoded at 23.976 fps but wmpc shows that the video is 23.98 fps. In other words: MKV and MP4 BOTH show 23.98 fps in properties but the log file says that it's encoded at 23.976.. probably nothing to do with this.
I can't encode the original because it's a short film i made at school with an HD camera, after editing i muxed everything to mkv for maximum quality and subs as i need dutch subs for my english movie. So i took the finished movie home with me on my flash drive. But no one told me that after a project is finished that the original files are removed from the HDD connected to the editing computer (at school). The only thing i have left is the Movie in MKV and the tape. I want it in MP4 to have it on my site, to upload to youtube and stuff. But that's not gonna work as for some reason the video stream is shorter than the audio.
[P]ako
5th January 2009, 00:26
Did you use directshowsource, dss2 or ffmpegsource?
Ortix
5th January 2009, 00:36
good question... I think it's directsoursce but how can i be sure? I know that the subtitles show up in the mp4 even though they are embeded. I read somewhere that can only be done with vsfilter and directshow... but i can be wrong. How can i check? sorry i'm kinda new to encoding.
[P]ako
5th January 2009, 00:51
What does your avs script look like?
setarip_old
5th January 2009, 00:53
I've gone through the log of meGUI and the video get's encoded at 23.976 fps but wmpc shows that the video is 23.98 fps. In other words: MKV and MP4 BOTH show 23.98 fps in properties but the log file says that it's encoded at 23.976..
1) At what framerate did you shoot this movie?
2) What's the brand and model number of the HD camera?
(Trying to establish possible reasons for timing difference)
Ortix
5th January 2009, 02:38
1) At what framerate did you shoot this movie?
2) What's the brand and model number of the HD camera?
(Trying to establish possible reasons for timing difference)
The movie was shot in 30 fps but i don't know how it would matter as it was simply exported at 23.98 fps. ( I don't know what the original exported file was because i didn't actually put it in MKV, the editors did) I don't remember the camera model from the top of my head but it was a Panasonic HD camera.. (doesn't help much does it?) The movie was btw edited in Final Cut pro and shot on a minidv tape... but still doesn't really relate to the issue as the export file is already completely different from the original footage
When i convert the video with videora it converts fine and everything is right. Subs, a/v sync... It seems to be something with megui.
setarip_old
5th January 2009, 08:23
Glad to hear you found a way to resolve your dilemma ;>}
BTW - I'm still smiling at:after editing i muxed everything to mkvversusI don't know what the original exported file was because i didn't actually put it in MKV, the editors did
Ortix
5th January 2009, 21:02
well yeah i said that to keep a long story short... you know :P quickly to the point.
But i actually did NOT solve the problem as videora encodes it to huuuuge files with crap quality, so i'm still wondering what the reason could be?... I'll try it with other mkv files and tell you how that worked out.
It's weird though, don't you know what might be cutting off the video stream.. aka why the video stream get's shortened?
EDIT:
Okay so i've download little mkv files around 1 minute each. These are smaller, non hd mkv video's with subs. This one ALSO has a delay when encoded, i can't really tell if the video stream is SHORTER but i know that the audio is longer. So I think the video is just played too fast but or the audio too slow. In my MKV movie the end is just simply cut off and it also PLAYS slower at the end, probably to fill up the last frames which were cut off of the original video stream
EDIT2:
After reviewing the encoded mp4 file i see that there is a scene where the video moves very slow and the audio simply keeps going. It's EXACTLY<<<< one scene where the video moves slowly. It looks really normal nothing strange going on. No FX, no fast movements, just a guy standing up and walking over to a pole...
[P]ako
6th January 2009, 01:01
Could you upload a sample of the video? Split a section with mkvmerge, please.
Ortix
6th January 2009, 01:16
HMMM mkv merge is not loading it... it stays blank...
EDIT:
MAJOR BREAKTHROUGH!! ZOMG ZOMG! I can't believe that a simple re-install of the CCCP codec pack and megui did the trick... lol. Everything runs smoothly now! wh00t! thank you soo much for your time guys! appreciate it :)
Ortix
6th January 2009, 23:44
Alright so basically i'm bringing this thread back for a reason...
Installing actually didn't fix it... I actually encoded the wrong file which was an xvid file encoded with videora (like i said before). So the reinstalling didn't do a thing...
BUT!
I found out what the problem is... AVISYNTH! wh00t! What i did was I sliced up the part where the video slows down (from the mkv file) and encoded that 2 times. 1 with avisynth and one without (in videora). Without, it works perfect! with: the video slows down again. So it's basically avisynth. Muahahah i'm the man. In Videora there is a function to ConfertFPS. It would be neat to have that in megui. It actually FIXES the problem... haha. I just encoded that part again and it works flawlesly WITH avisynth. (with videora though).
setarip_old
7th January 2009, 00:46
Now that you seem to be sure that you've gotten it right, please be good enough to post two screen captures back here:
1) The initial .MP4 you created per your first posted in this thread loaded into GSpot and
2) The most recent .MP4 that you created, according to post #15 here, also loaded into GSpot
Ortix
7th January 2009, 01:13
yes sir! BRB!
with convert fps
http://img128.imageshack.us/my.php?image=convertfpsox7.jpg
http://img128.imageshack.us/my.php?image=convertfpsox7.jpg
without convert fps
http://img113.imageshack.us/my.php?image=noconvertfpswa7.jpg
http://img113.imageshack.us/my.php?image=noconvertfpswa7.jpg
I looked at the original mkv file and it was VERY obvious that it was a higher framerate for some reason. I don't know what the editors did with the video but the film has variable framerate.
The images btw don't show up on my pc for some reason, i included the links just in case it doesn't show up at all.
setarip_old
7th January 2009, 01:53
You seem to have provided screen captures of info regarding 1 minute clips (both just created) of each video, rather than of each full video.
Bye...
Ortix
7th January 2009, 02:48
is that a problem? i mean, i thought you wanted the vids of the 'affected' area.
setarip_old
7th January 2009, 05:38
I wanted to see the video and audio info regarding the two full length videos...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.