Perhaps I should present this problem in audio forum, but I will start here. I have an mkv file from an old movie where the audio track is "weird" sounding, hard to describe what it does but sounds as if it was processed through some flanger or something. By coincidence I also have a DVD from the same movie where the audio is fine, old but good sounding. The problem is the audio file is shorter. It starts at the same time, and sync at first dialogue is fine, but it goes gradually out of sync. According to VLC, the mkv track is 1:39:45 and the DVD is 1:39:29. Is there a way to stretch the dvd audio track to mkv's?
+ Reply to Thread
Results 1 to 8 of 8
Thread: Adjusting audio sync in mkv file
Just to check for more exact timings, I converted both AC3 files to wav, and checked three points: first dialogue, clean dialogue closer to end and end fade finish. Start time is about the same, one 00:00:00:743 (mkv) and 00:00:00:722 (DVD). And there is a difference indeed, slight at first clean dialogue, larger with the last clean dialogue. First dialogue: 00:01:16:657 (mkv) 00:01:15:715 (dvd) Last clean dialogue: 01:38:02:755 (mkv) 01:37:45:867 (dvd)
Last edited by carlmart; 13th Feb 2013 at 04:17.
What's the frame rate of each video? Even if it's the same, it might be better to adjust the frame rate of the MKV rather than stretch the audio to get them to match. Just a tiny adjustment at a time such as 23.975 instead of 23.976 etc. MKVMergeGUI can do both, but stretching the audio can cause it to play back with glitches so my first preference would be to change the frame rate instead. It might require a little trial and error to get it right.
My second choice would be to re-encode the audio while stretching it as necessary. I think Audacity might have a time stretching plugin, or if you're familiar with eac3to I'm pretty sure it'll do it. If you re-encode it while stretching it there won't be potential problems when playing it.
Chances are, the two versions of the movie are edited slightly differently, so you can fiddle with frame rates and time stretching until the audio is perfectly in sync at the beginning and end, but it'll still be out for most of what's in-between. I've banged my head against the desk a few times after doing just that, but I guess it can't hurt to try.
I don't know anything about Sound Forge so I can't help you there. eac3to has PAL/NTSC speedup/slowdown options, so I figured you could specify something else, but after looking at the list of command line switches if it can I'm obviously not smart enough to work out how anyway.
I'm not guaranteeing stretching the audio while remuxing will cause glitches... it seems to depend on the format and how much you stretch, but I'd probably do that first just to work out if stretching will fix the sync problem and how much to stretch it in order to do so, and then do the better to be safe than sorry thing and re-encode it that way. It'll probably be quicker than having to keep re-encoding the audio while adjusting the stretch until it's right.
As it's something I've only done myself a few times, I've not played around looking for a clever way to do it, and if it's multichannel audio that may increase the degree of difficulty. It's easy enough to do with Audacity but I think you might ultimately only be able to export it as a stereo file. If you happen to have the Nero wave editor it'll do it but sometimes it spits the dummy over multi-channel audio (well the old version I have does). There's a plugin for foobar2000 called SoundTouch which can be used while converting and it does pitch and speed adjusting and multichannel audio won't be an issue, but as I said, before bothering with any of that it'd probably be an idea to get MKVMergeGUI to stretch it first just to make sure the whole re-encoding process won't be a waste of time. And you never know.... you don't need to stretch it by a huge amount so it might play fine.
Sorry I can't be of more help.
Last edited by hello_hello; 13th Feb 2013 at 22:11.
It might really be an impossible task, as I have tried two times with MKVmerge, stretching the DVD audio, and it's still out of sync.
To stretch it, what I'm doing is getting a ratio between the DVD audio (shorter) and the mkv audio (longer). Both numbers are 1 followed by two zeros and then some numbers, and that is the number I load in MKVmerge for the audio stretch.
But it's like what's said above: some parts are in sync, others are not. I don't think this can be done without an editing program, and I don't think I want to do that. A pity, because the DVD audio is quite good indeed.
Yeah, I've tried something similar a few times and it's fairly hit and miss, even when the two versions of the video appear the same. It's possibly just slight differences in the way they're edited, but unless the audio sync only changes in a few of places it'd be a tedious process trying to edit it and/or the video to match them up.
Easiest way to edit the sound file is the compare where the video scenes switch,that's usually where the audio has a longer or shorter delay in time.Just load the video into audacity and go to the spots where the delay is different and either cut or add,
You can then save as ac3 with the FFmpeg_v0.6.2_for_Audacity_on_Windows installed and setup.I think,therefore i am a hamster.