Page 1 of 1

[RESOLVED] AV out of sync using Avisynth/DGDecNV/DGIndex

Posted: Sat Mar 17, 2012 11:59 am
by davidhorman
Hi all,

This is something I noticed a long time ago, but I never discovered an explanation. I use either DGDecNV or DGIndex to work with DVD rips with Avisynth/Virtualdub (falling back to DGIndex when I start getting CUDA errors from having too many sources!), both of which demux the audio which I then dub in with nicac3source. What I find is that the audio always seems to be two frames (80ms) in advance of the video. I also seem to have a hazy memory of some of my DVD rips starting with two B-frames, then an I-frame (is this an "open GOP"?)

Is it these two B-frames being dropped that causes the audio and video to be out of sync?

David

PS If it helps, or matters, all of the clips I'm currently working with have generated AC3 files with "DELAY 0ms", apart from one which has "DELAY -216ms" but also shows the same desync.

Re: Audio/video out of sync using Avisynth/DGDecNV/DGIndex

Posted: Sat Mar 17, 2012 10:04 pm
by admin
I can't help without your stream that I can use to duplicate the issue.

Re: Audio/video out of sync using Avisynth/DGDecNV/DGIndex

Posted: Sun Mar 18, 2012 9:55 am
by davidhorman
I've just tried opening the original stream in AviDemux and saving out an MJPEG/MP3 AVI, then loading that into VirtualDub - the audio/video sync is "wrong" as before, so maybe it's not anything specific to DGIndex, but perhaps just DVD in general.

Still, I've demuxed a few short sections which show this apparent desync (http://horman.net/sync.zip). Regarding the clip from Star Wars, I once went to the trouble of filming the DVD playing on my DVD player/TV and then on my old laptop (using WinDVD, if I recall correctly) with a camcorder, and the resulting footage showed the discrepancy - when played on the TV the music started on the same frame as the logo appears, but played on the laptop the audio was two frames early. That was what made me wonder whether there was some undocumented convention that DVD audio should be 2 frames in advance. I noticed something similar at some scene changes on the PotC DVD and in fight scenes in the The Matrix (both PAL), and I think it was The Matrix, once ripped, which had those two B frames at the start of the stream (I can't remember what I used to see that though, it was a long time ago; the rips I'm playing with now all show the first frame as an I frame in VirtualDub-MPEG2).

Maybe there is just some convention that sound effects work better if they are played slightly in advance of the action? I did find one scene change in the Doctor Who episode where ambient audio switched at the same moment as the cut, but still most sound effects (those that are sudden and sharp enough to examine easily) are in advance.

David

Re: Audio/video out of sync using Avisynth/DGDecNV/DGIndex

Posted: Sun Mar 18, 2012 11:58 am
by davidhorman
Sorry, I completely misunderstood how demuxing video and creating project files works. The d2v files in my upload are broken.

I'll go back to the drawing board on this one...

Re: Audio/video out of sync using Avisynth/DGDecNV/DGIndex

Posted: Sun Mar 18, 2012 3:13 pm
by admin
Theoretically DGDecNV corrects for any leading B frames, but if it doesn't appear to be working I'm happy to have a look at it. For the sample, just cut your source stream using DGSplit. Don't cut anything away from the beginning! Make it big enough so that there is a recognizable sync event, like a door slam, or somebody talking. Thanks, David.

Re: Audio/video out of sync using Avisynth/DGDecNV/DGIndex

Posted: Fri Sep 21, 2012 1:50 pm
by admin
Marking resolved as problem was apparently due to user misunderstanding.