View Full Version : What do I do with the DELAY?
Vertigo1
27th February 2003, 22:03
I'm trying to rip a DVD and re-encode it to fit on a DVD-R. I created a DVD2AVI project, which produced my D2V and AC3 files as required, and I went on to use the D2V file to re-encode the video fine, but what do I do with the delay setting that DVD2AVI produced? The guide said to make a note of it, but not what to actually do with it.
trbarry
27th February 2003, 22:34
In VirtualDubMod for instance you say you have ac3 sound and select the file, making note of the delay then since you've since forgotten it. Then you select audio direct stream copy and open the Audo Interleaving section. There is a box on the panel that opens to enter the delay, including the sign.
Then encode your Xvid or whatever file.
If the audio delay needs adjustment later you can just open the created avi file in Vdubmod and this time say you have avi sound, direct stream copy (for both audio and video), and add or subtract delay adjustments. Save the file without further compression, using direct stream copy for both audio and video. Repeat as needed.
But all this assumes you are keeping the ac3 sound, as I do. Others convert it to something else for various reasons, but I like it.
- Tom
Vertigo1
27th February 2003, 22:52
Tnx for the reply, but I'm just trying to rip a DVD.
I used DVD2AVI to produce the aforementioned AC3 file, which reports a -80ms delay, and the D2V file which I then served to CCE using AviSynth.
Now I have an MPV file and an AC3 file which I need to author back to DVD, but I don't know what to do about the delay.
I also have another major problem in that the lengths of the MPV and AC3 files don't appear to match, but I've posted that in another forum :)
Fun & games... :)
Toti
28th February 2003, 03:00
I was asking my self the same question when I read the guide. If you browse through the programs to download on doom9. First make sure you click where it says "all programs" or something like that since after clicking it will show all the programs and not some of them.
Download AC3 Delay corrector, this will fix the delay on the AC3 file and ready for the authoring program.
aquabubble
28th February 2003, 14:53
Hmm... I'm still not convinced of the need to butcher the AC3 file.
As far as I can tell, Scenarist syncs your audio automatically by using the time code embedded in the stream. I'm not sure how these delay correctors work, but I'm pretty sure they only chop frames off or add frames on - which of course would have no effect since the time code is still embedded. For the vast majority of cases, nothing needs to be done to the audio stream.
However, some PAL users have reported problems with audio sync. My perception of the issue is that frames are being dropped in the d2v and hence mpv, which results in these audio sync problems. Rather than focussing on the audio, the video should be corrected instead.
My understanding is that there is a problem with DVD2AVI or mpeg2dec or both. I'm awaiting Nic's word with baited breath :)
Jinxed
3rd March 2003, 15:15
I also have this burning question about AC3 delay, which I have been investigating. I use DVD2AVI to produce the d2v file and AC3 rip, TMPEnc to re-encode the movie to .m2v and Maestro to put it all back together.
I have tried several films which have reported delays of between -40ms and -108ms (always seems to be minus -which I guess means that the audio happens before the video). Also, when I use Smart Ripper to rip the audio I get the same delays reported. I have used AC3 delay Corrector to correct the delay, which reports that it has chopped frames, although when I mux the whole thing together does not produce well synched video and audio. I have watched carefully, and the video definitely lags the audio (indicating to me that maybe the reported delay was pure fiction).
I also, replying to a previous post, don't think that it has anything to do with video frames being dropped, because this lag appears to be consistent throughout the movie.
One further fly in the ointment is that when I use Maestro to author the DVD using the AC3 file with the delay, the video and audio still do not appear to synch in the resultant DVD.
I think that the answer lies somewhere in the timecode that is present in the AC3 file. If we can find some way to re-write the AC3 file, that rewrites the timecode then maybe it willl synch.
Any ideas?
By the way, I use PAL DVDs, 25 fps etc..
aquabubble
3rd March 2003, 15:30
Originally posted by Jinxed
I also, replying to a previous post, don't think that it has anything to do with video frames being dropped, because this lag appears to be consistent throughout the movie.
Well, I'm confident that frames are sometimes dropped from the beginning of the video, which if true will result in a consistent lag throughout.
Just a thought - if we can work out how many frames are dropped from the beginning then a quick fix could be to add that many black frames to the AVS script to be played at the beginning.
Jinxed
3rd March 2003, 16:08
Thanks for the reply Aquabubble.
I just did a test on one I have recently done, Aliens, PAL version. The .d2v file that I imported into TMPGEnc was reported by TMPGEnc to have 165309 frames, which equates to 1hr50mins12secs9frames. I then checked the m2v file created by TMPEnc (found the info in the Maestro project) and found that this file is 165310 frames, hence 1 frame longer than the original.
So it may be that TMPGEnc is adding a frame at the begginning (or end) of the file. If at the beginning, then the audio would be ahead of the video by 40ms (which could be what I am seeing -video lags audio when I have corrected the AC3 delay).
If that were the case, then the audio delay reported of -108ms, would need to be corrected to just -68ms (i.e. strip off 2 frames of audio, 80ms) for the audio and video to be nearly in synch.
Can we just edit the resulting IFO file after authoring to give the AC3 delay and avoid all this hassle? If so what with?
trbarry
3rd March 2003, 16:09
Well, I'm confident that frames are sometimes dropped from the beginning of the video, which if true will result in a consistent lag throughout.
I think this may happen only when you are processing the vob's separately and the first one does not start on a GOP, an I-frame. In that case frames may be dropped until the beginning of the next GOP.
- Tom
aquabubble
3rd March 2003, 16:19
Originally posted by Jinxed
Can we just edit the resulting IFO file after authoring to give the AC3 delay and avoid all this hassle? If so what with?
Unfortunately the delay is not included in the IFO file, but rather is in the muxed VOB. It is the time delay between the start of the audio stream and the start of the video stream. So a post-processing tool would need to adjust the muxing in the VOBs - not a job for the feint hearted!
aquabubble
3rd March 2003, 16:29
Originally posted by trbarry
I think this may happen only when you are processing the vob's separately and the first one does not start on a GOP, an I-frame. In that case frames may be dropped until the beginning of the next GOP.
Yes, that would be the only thing that could explain any dropped frames at the beginning - so long as there is no bug with DVD2AVI locating the I-frame in the first place. We still need to answer the question of how audio can be out of sync from the beginning and the only thing I can think of is dropped frames - however, this is also apparently happening when an m2v has been directly demuxed from the VOBs so it's impossible for these to start without an I-frame (isn't it?). So what could be going on? :confused:
atreides93
3rd March 2003, 19:49
There's nothing wrong with AC3 delay corrector, or DVD2AVI. They both work brilliantly. I think the problem lies in Tmpegenc. I also used to get sync errors when re-encoding with tmpeg..but since switching to CCE for encodes, I no longer have those problems.
My video and audio is perfectly synced...i've tested this on countless DVD's now and they are all great!!
I remember earlier someone started a thread where he noticed that if he encoded progressive with 3:2 pulldown in tmpegenc, he'd always end up with audio sync problems. But if I he did it in CCE and then used pulldown.exe to insert the RFF flags, the audio sync problem didn't happen.
Jinxed
4th March 2003, 09:31
TMPGEnc may be a problem for NTSC films requiring pulldown, but my problem is with PAL films that do not require pulldown. The same thing happens with progressive or interlaced material.
Reasons why I do not think that TMPGEnc or DVD2AVI are the problem here:
1. If TMPEnc was the problem then I would expect the number of frames in the output file to differ widely from the input file, which is not the case.
2. The delay in the finished product is a fraction of a second, but still noticeable (you would be surprised at how many times we can open and close our mouths per second when we speak - 40 ms is noticeable).
3. The delay is consistent throughout the film
4. When you re-author the film with the original m2V file demuxed using SmartRipper (in other words not touched by TMPEnc or DVD2AVI) the delay is still a noticeable problem.
So in my mind the problem is caused by either AC3 Delay Corrector or more likely, the reported delay in the VOB file is not an acurate delay. How do DVD players handle this info anyway. Do they actually have a delay circuit which adjusts the sound to the video? Do software players also have this?
aquabubble
4th March 2003, 11:45
Jinxed - this is an interesting point. Your results suggest that there may be a combination of problems here - perhaps there is an issue with the decrypting/demuxing software dropping audio and/or video frames?
The way the delay works is nothing to do with any automatic adjustments, the IFO, etc. It is simply the way the VOB is muxed. If there is a negative delay, then it means that the audio stream begins in the VOB before the video stream starts - there is no need to have the audio and video start at the same time. Indeed, the different streams can stop and start willy-nilly throughout the VOB.
all_the_while
4th March 2003, 21:40
its an interesting point u make about the streams being able to stop/start. i have been using DVD2AVI v1.76 with a pal dvd of a seven part tv series. The problems i have encountered with delays almost prompted me to start a new thread . .
There are 7 episodes and 7 vob files BUT 1 episode is not 1 vob. The first vob has the first 5 mins of the second episode and so on . . I began by encoding all the episodes together with the intention of splitting after. However the audio was not in synch after 1 episode. The delay for all seven vobs was 40ms.
I then made dv2 files of each vob seperately. 5,6,7 all have the same delay (170 i think) but the rest vary hugely. I then encoded each vob seperately and each episode synched perfectly. However each episode contained 5 mins of the next and i want to have each episode as a single complete file. Therefore i have split the encode i made of all vobs and have had to resynch each episode seperately.
I would like to know please . .
from where the delay is referenced, i cant understand the 40 value considering the different value of the other delays?
I have encoded other episode dvds but usually each episode=1 vob. This method of encoding the vobs makes hard work of backing up dvds . . or is there a better method of dealing with these vobs that i have overlooked?
also i would like to stay that dvd2avi is an excellant tool, thanks
Jinxed
5th March 2003, 10:24
In reply to the previous post, I would think that if the 7 vobs were all part of the same PGC that the dealy of 40ms would indicate only the delay between audio and video streams at the beginning of the PGC. DVDs like this usually just flow the video and audio through episodes as though they were part of one large feature. If you remuxed all vobs separately it is quite likely that you thought they were in synch, as 40ms is not that long (1 frame), and you would therefore have to look carefully to see any synch diferences.
I have conducted some more exprerements with the Aliens DVD, the results are interesting and suggest that the answer to this problem may be quite complex, as follows:
I point out at this stage that the DVD has been ripped with Smartripper, and then stripped with IFOEdit 0.95 to produce a movie only DVD, that is still too large for the DVD-R burner. Therefore I used Smartripper to strip the streams of the new DVD files to another directory of my hard drive. I then used DVD2AVI/TMPGEnc to make a new m2v file that is small enough to fit onto a DVD-R.
1. I loaded up the original demuxed m2v (demuxed by Smartripper) and the re-encoded m2v files into Maestro to see if there was any diference. I then notice from the asset properties that the larger m2v file stripped by Smartripper is 5 frames longer than the new m2v file made by TMPEnc. So the theory that DVD2AVI or TMPGEnc strip frames seems to be supported.
2. I then make a project in Maestro with 2 movies. I put the Smartripper ripped m2v on the timeline on Movie 1 and the TMPGEnc re-encoded m2v file on the timeline on Movie 2. I then then use the real-time player to go through the film until a scene change occurs (you have to use the frame forward feature). I find the same frame change on both Movie 1 and Movie 2. To my surprise, Movie 1 is 5 frames earlier than Movie 2, i.e. the TMPGEnc re-encoded m2v is lagging the original by 5 frames. This would definitely account for the perceived lag of video compared to audio on the finished movie, even after the delay corrector program had chopped out 2 frames (which makes the delay worse).
What I don't understand is if the Smartripper stripped m2v (the original video stream)is 5 frames longer overall than the re-encoded m2v, then why when I run these movies side by side does a scene change occur 5 frames earlier in the Smartripper stripped m2v?
This is totally bizzare and indicates to me that maybe TMPGEnc is doing all sorts of weird things with the movie. I wonder if CCE or REMPEG are any better.
So I am still working on this, but to my mind I need to apply this test to all future DVD rips to make a calculation of what I need to do with the audio track, not based on the delay measurement reported by DVD2AVI or Smartripper for the audio track, but the combination of the video delay in the re-encoded m2v file and audio delay, Like this:
Time to be chopped from the beginning of audio file= negative delay reported by rip program - positive delay between original m2v and re-encoded m2v
e.g. audio delay -80ms
video dealy 5 frames (= 200ms)
time to be chopped from audio file = 80 -200, i.e. 120ms, in other words 120ms needs to be added to audio file.
Am I wrong, has my brain exploded? Please comment.
Jinxed
5th March 2003, 14:18
Well that was the theory, but I'm sorry to have to report that the results were not good. The video was ahead of the audio this time.
I think we're going to have to just try it out a few times until it's nearly right and then call it a day!
Anyone tried out CCE?
all_the_while
5th March 2003, 18:05
thats right jinxed, all the vobs are part of the same PGC. When i remuxed the vobs seperately i did according to their specific delays and they were in synch (for sure).
The first vob has a delay of 40ms. So yor idea that dvd2avi is only indicating the delay at the beginning is plausible. 40 definately couldn't have been an average of the delays from each vob but i cant believe the delay calculation is as simplistic as that it is referenced from the first vob only and all other vob delays are ignored.
trbarry
5th March 2003, 19:02
The way I understand it DVD2AVI thinks that you are processing one continuous stream at a time, regardless of how many files it contains. So the audio and video should be the same length. It then just has to match them up at the beginning and they will stay matched.
I remember someone in the Development forum explaining this process, where DVD2AVI would derive the delay factor somehow from the differences in the timestamps of the beginning of the respective audio and video streams. But I don't remember the details.
- Tom
Mr Zippy
23rd March 2003, 22:27
This has been discussed at great lenght before, and a guide was written - http://www.encodinginfo.org.uk/dvd.php#delay
Also see http://forum.doom9.org/showthread.php?s=&threadid=20433&perpage=20&pagenumber=1
Neil
HomerJ
27th March 2003, 01:22
Guys,
This is a pretty long long thread, so forgive me if I have missed something.
I use DVD2AVI & CCE, follwed by Spruce Up to create my new VOB set.
I have never come across a visible audio / video sync problem. (and I have done lots of backups) Mind you the old eye sight is strating to go a bit.....
Is it just me, or is this a case of "chasing shadows" ?
HomerJ
Jinxed
27th March 2003, 11:59
No it's not a case of chasing shadows, but I gather from other threads on this site that this problem is more applicable to PAL DVD rips.
When loading the .d2V file produced by DVD2AVI into both CCE and TMPEnc I notice that the number of frames are truncated from the original vob.
I believe that there are issues relating to the way that PAL DVDs are put together that means that frames are not synched when re-encoded. I have tried this out with re-encoded video elementary streams from CCE and TMPGEnc and the results are the same.
It does not appear to be the fault of DVD2AVI either, as if you encode direct from a demuxed .m2v in TMPGEnc you get the same anomoly.
The anolomoly is as follows:
Viewing the same frame number in the original vob (or m2v) and the re-encoded m2v shows different frames. Some threads have suggested that the first two frames of the original vob are cut, but my research shows that the frames of the re-encoded m2v seem to lag the original by about 2 frames (or more).
The result of this is that the delay correction in the AC3 will not produce synch, as the video is out of synch with the original.
So I guess the question is what is it within the video stream of a PAL DVD that prevents these re-encoding programs from synching the video?
I think the audio issue is now irrelevant. Any ideas, bright sparks out there?
all_the_while
28th March 2003, 22:26
jinxed, "Viewing the same frame number in the original vob (or m2v) and the re-encoded m2v shows different frames"
which program are u using to ascertain this, ?
i agree with what you are saying, something inately related to the structure of PAL dvds is feasible . .
Mr Zippy
28th March 2003, 22:42
Just read the guide on my site, as previosly posted, saves a lot of reading. (or see the last page of the thread I gave for the unedited guide)
I believe there are 13 pages to the thread which resulted in the guide on my site being written.
http://www.encodinginfo.org.uk/dvd.php#delay
Jinxed
29th March 2003, 14:08
Thanks Mr Zippy, I have read your guide, but you leave a lot of questions unanswered.
For instance, if the first two frames of the PAL DVD are not encoded into the output by CCE or TMPGEnc, then why when I look at the resultant elementary video stream produced by either of these programs does the video seem to be lagging the original, by between two and five frames, when from your theory it should be two frames ahead?
For the information of all who have followed this post I am using DVD Maestro's realtime preview to search through the frames. You need to have the Raviscent Cinemaster 2000 codec installed for this to function.
I loaded up two movies, one with the original demuxed m2v and the other with the re-encoded m2v. I then previewed on both of them in turn until I found a change of scene that cut neatly (near the beginning of the film).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.