PDA

View Full Version : Audio Out of Sync when saving to .mkv or .ogm


Yo
29th January 2006, 23:17
Goal--to convert an .AVI movie I had to either .OGM or .MKV, in order to add chapters to it.

I opened the .AVI file in Vdubmod, added the chapters, set both video and audio to "direct stream copy" (no need for recompression), and saved it as a .MKV file.

I was surprised that the audio was at times way out of sync in the resulting .mkv video, at least when played back in Media Player Classic. (I checked with the original .avi file, and the audio is in sync in the .avi file.)

I tried saving to an .ogm file, and had the same problem--resulting video out of sync.

What caused the audio-video synchronization problem? No changes were made to the video or audio at all. Only saved to a different container, with chapters added.

I would greatly appreciate it if someone could help with this, perhaps letting me know how to do this without the sync problem. Thank you.

madoka
30th January 2006, 07:24
Try using MKVtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/) instead and see if you still have the same problem.

Yo
30th January 2006, 15:43
I later found out what the problem was--not actually related at all to saving to .ogm or .mkv, like I thought it was.

The original .avi file was created from a DVD using AutoGK. The settings for audio were left at the default for AutoGK, MP3 128kbps VBR. (As written, no problem with sync playing back that audio.)

There is a problem when opening such files in Vdubmod, as it thinks there is a problem with the VBR MP3 sound. As soon as one opens the file, there is a dialog suggesting that the sound be changed to CBR, by rewriting the header, although it warns this could skew the audio out of sync. A yes answer to that question will put the audio out of sync. The correct answer to that question is always "NO". (I hope someone changes VDubmod so that question is no longer asked, that the audio be left as is, without the suggestion to change to CBR.)

I have encountered this before, and have always answered "No", and the video came out fine. This time, I must have not paid attention to that dialog at all, not read it, the mouse by default goes to the yes box, I must have inadvertently clicked yes to continue, without reading the question. That messed up the audio to the file opened in vdubmod (not to the original .avi on disk), and any file saved from there would have the audio messed up. In fact, I tried saving to .avi with a different filename, and the saved 2nd .avi had the same audio sync problem.

I closed vdubmod, re-opened the .avi file, this time making sure to answer "NO" to that audio header re-write question. THen when I saved to .ogm or .mkv, no problem at all with audio sync.

So, it serves as a good reminder to everyone, always pay attention to that question about re-writing the VBR header to CBR, and always answer NO to it. And if anyone reading is involved in programming vdubmod (I hope there will be updates to it, a very useful program), please remove that dialog altogether. It has probably caused problems for many, and I doubt the rewriting of the VBR header to CBR is useful to anyone.)

Another thing I learned--make any changes to chapters in the text file, not within vdubmod itself. In ripping the DVD with DVDDecrypter (IFO mode), I chose to have it rip the chapters(OGG format), which it saved as a text file. It had the times of the chapters, but not the titles of them. After opening the avi file in vdubmod I imported the chapters from the text file, and then put the chapter names into it in vdubmod itself. But, vdubmod has no function to re-export the chapters as a text file.

Before closing Vdubmod, in order to re-open the .AVI file without the audio header change, knowing that all the 36 title names (some long) that I typed in would be lost, as I could not save them anywhere (another suggestion for change in vdubmod--saving as .txt any chapter changes made in the program), I manually cut and pasted the chapter names one by one from the vdubmod dialog into the chapter .txt file. Then, when I re-opened the .avi without the audio header change, I imported the chapter .txt file, and it now contained all the chapter names. (It would have been much simpler however, if I started by typing the chapter names into the text file to start with, rather than entering them in Vdubmod.)



So, unlike what I thought in writing the OP, the problem had nothing to do with saving to .OGM or .MKV.