View Full Version : (PAL Problem ONLY!!) - How to get an m2v file and ac3/lpcm file that will sync
Alphaloop
23rd January 2003, 10:26
Here I have one example for the 2 frames issue in NTSC:
Cool Devices 3 DVD-Set US-Version, Operation 9, "Slave Warrior Maya II".
Loaded it into Womble MPEG2VCR, first nonblack pic is #9. Loaded it into VDub via DVD2Avi/AviSynth, first non black picture is #7.
Any explanations? ;)
Mr Zippy
23rd January 2003, 13:51
Originally posted by TRILIGHT
Don't know. It just is...every time. :) I think what it MIGHT be is that the clock is set to all zeros in CCE for the encode. The timecode in the audio files knows to delay by a certain amount from that number so it's always in sync since the audio timecode is never touched.
What makes you think the AC3 file has a timecode, I can find no evidence of this, Scenarist and DVDMaestro report nothing in the AC3 offset box, whereas the video offset shows the actual start timecode entered in CCE whether it's all zeros or not, and it makes no difference if you tell DVDMaestro to ignor AC3 timecode.
Also the delay cannot be relative to a zero timecode, as many DVDs do not start the video timecode at zero.
Originally posted by Mattew
Because DVD2AVI does not take account of these 2 frames when calculating delay
From what I read DVD2AVI looks at the first audio frame and the first video I frame to calculate the AC3 delay, am I to take it that in the case where frames are dropped the AC3 delay is being calcualted from the first video frame that would be frame served, and not the first video frame in the output demux M2V file?
Originally posted by Mattew
In regards to the 2 frame thing, I certainly don't care about the loss of 2 frames per se, but a desync of 80ms (67 ms for NTSC) can be noticeable
This is exactly why I want a fool proof method for 100% audio sync, I don't want to have to play back in my DVD player to discover the sync is wrong. For a example we use the Bitrate viewer before encoding to encsure the field order is encoded the right way round for TV playback.
LeXXuz
23rd January 2003, 21:33
Hi guys!
I just read this thread and it gaves me a big headache. ;)
I'm also a PAL-only user and recognized same sync problems.
I also check every DVD manually after authering for sync and often recognized they are NOT. So I have to fix it manually.
I use following method for reencode:
DVDDecrypter => DVD2AVI => Avisynth (mpeg2dec2) => cce
I never thought of the 2-frames-drop issue, but it might be the reason why my dvds are sometimes sync and sometimes not.
I'll test that frame-drop problem when I have a little bit more time....
There must be a way to get this sync-issue lost! :mad:
TRILIGHT
23rd January 2003, 22:19
@Lexxuz
Don't waste time with drop-frame. This is purely an NTSC issue and does not apply to you. Also, the source of your problem is not the 2 frames.
@Zippy
You're kidding yourself if you don't believe audio and video is edited and originally authored on DVD without timecodes. Even though I'm not a PAL user, I've suggested common sense probable causes but I really don't see anyone doing any REAL trial-and-error work and saying "I did this and it gave me this. I did that and it gave me that." in order to zero in on a solution. If anyone were to spend a little time doing some real scientific "process of elimination", you would have already found a solution by now. (Not to mention you seem to be one of only 3 or 4 PAL users on the planet posting in this thread. I wonder why the others don't have your problems?) Anyway, I'm really not getting into this discussion though because I am seriously done with the absurdity of this thread repeating the same crap over and over with no real value.
Matthew
23rd January 2003, 23:40
Originally posted by Mr Zippy
From what I read DVD2AVI looks at the first audio frame and the first video I frame to calculate the AC3 delay, am I to take it that in the case where frames are dropped the AC3 delay is being calcualted from the first video frame that would be frame served, and not the first video frame in the output demux M2V file?
Yes that's right. Smartripper and DVD Decryptor do the same as well. Vobedit doesn't though (it reports the correct delay).
Originally posted by Mr Zippy
This is exactly why I want a fool proof method for 100% audio sync, I don't want to have to play back in my DVD player to discover the sync is wrong. For a example we use the Bitrate viewer before encoding to encsure the field order is encoded the right way round for TV playback. [/B]
I already outlined a full proof method in a previous post in this thread.
TRILIGHT, I could be forgiven for thinking you haven't read this thread. Yes this thread has been rather repetitive and has pretty much outlived its life *but* the observed phenomena are real and it's been revealed as a bug in DVD2AVI.
A solution has been found, as previous posts in this thread show (mpucoder even said we appear to be doing the right thing to correct the problem). The methods have been scientific, in the sense that they have revolved around experiments, but a full understanding of the nature of the DVD format is not reasonably obtained, so it's unfair to critise in that regard.
As for why other people haven't posted in this thread - well 1) the end result is that if you rely on DVD2AVI's audio delay numbers and ensure the delays match up on original and re-authored DVDs by using AC3 delay corrector etc then everything is fine and dandy and 2) people may just do what is in the guides but not notice the desync. I bet there are quite a few PAL users out there with bad sync and they simply don't know it.
A matter of interest (for some people like Mr. Zippy, buy not me) is whether an alternative syncing solution, in the form of using timecodes, can be found.
The only matter of curiousity left for me in this topic is why NTSC is different from PAL in this regard. And that, I might add, has not been adequately explained with scientific method. Not that I particularly mind, it's not my lookout after all ;)
Calypso
24th January 2003, 02:34
if you rely on DVD2AVI's audio delay numbers and ensure the delays match up on original and re-authored DVDs by using AC3 delay corrector etc then everything is fine and dandy
I disagree, from personal experience. I recently re-worked a DVD where DVD2AVI reported -274ms delay for all three audio tracks. As per my usual process, I did nothing to correct this reported delay, and imported the audio directly into Maestro. In preview, it sounded just great. Believe me, you can certainly hear a delay this large.
I then experimented, and used AC3 Delay to 'cut' this delay out of the audio (just as many on this thread insist must be done) and placed it back on the timeline. NOW I had a delay that was obvious. I went back to using the original audio track, with no corrections.
I then ran DVD2AVI on my newly authored VOB, and it now reported a zero second delay. So what is really going on here?
Matthew
24th January 2003, 03:01
Well I had a similar situation, delay was over -200, except the way I achieved correct sync was by cutting frames off. It's quite clearly in sync (as you point out one can tell).
I also remember another case where I ripped a chapter with a large delay, and it was out of sync in Maestro's preview function until I made appropriate adjustments.
Only thing I can think of (apart from human error) is
a) DVD2AVI made a mistake for some reason, not sure why it would though (could use vobedit to test); or
b) Maestro adjusted the streams on the basis of timecodes or whatever, although that doesn't make much sense either. Regardless that could be tested by comparing the number of frames in the video and audio streams that were 1) fed into Maestro and 2) extracted from the reauthored DVD.
And PAL, or NTSC?
Calypso
24th January 2003, 05:49
Originally posted by Matthew
Only thing I can think of (apart from human error) is
a) DVD2AVI made a mistake for some reasonI have always suspected this 'delay' factor. In my case, I have never made any corrections- both when making SVCDs and DVDs.
And PAL, or NTSC?In my case, all NTSC
Matthew
24th January 2003, 06:10
mmmm...well leaving aside the dropped frame issues the delay figures do make sense. If you load a vob in vobedit you can find out the PTS value for the first video frame (say 23 ms) and the PTS value for the first audio frame (say 45 ms). That means there is a difference of 22ms from when the first video frame is displayed and when the first audio frame is displayed.
Not making adjustments with SVCDs doesn't make sense because there's no possibility of timecodes saving your bacon there.
Mr Zippy
28th January 2003, 18:04
I may have a timecode solution to AC3 Sync/delay.
Sonic Scenarist allows you to enter the audio start time.
1) Import your M2V and AC3 in the timeline
2) Click on the audio track in the timeline and select 'audio play' at the bottom of the screen.
3) Look at the audio play properties at the bottom of the screen
If you enter a 'start time' the audio will start at that time.
(not sure if the duration figure is timecode based or the actual lengh of the audio track, so you may need to update that also)
M2V asset - timecode starts ar 00:00:59;05
AC3 asset - no timecode as we have found
If you set the AC3 track 'start time' to 00:00:57;05 then Mux the tracks and playback, the audio is 2 seconds behind !
If DVD2AVI says the delay is -80ms, that is 2 frames before the video starts.
In Scenarist you can then set the audio to start 2 frames before the video.
You would need to check...
1. Possible dropped frames by DVD2AVI - although it has been said here the quoted delay is including any dropped frames when transcoding.
2. The video start timecode cannot be zero or you could not set an earlier audio start time - just set a higher than zero start timecode when transcoing in CCE.
What do you think of this method.
Alphaloop
28th January 2003, 18:09
I may have a timecode solution to AC3 Sync/delay.
Sonic Scenarist allows you to enter the audio start time.
Oh, nice, just invest 1000++ $ to solve a little sync problem. :D
Mr Zippy
28th January 2003, 19:39
It's proabably possible in DVD Maestro, but I don't know how.
Maestro does indicate a box for 'offset' for the AC3 asset - but it's blank and uneditable.
Atleast a workable method in Scenarist is a start.
Lets hope the AC3 delay offset figure in DVD2AVI is accurate, this method is only as accurate as 1 frame or 40ms PAL.
I note that the re-authored video always shows a delay of -80ms in DVD2AVI but you can easily test by setting a -2 second audio offset, which you can easily hear to verify, so it must use something like the AC3 delay corrector and cut frames to match the audio offset specified. Vobedit shows a 0ms delay on the re-authored video.
Matthew
29th January 2003, 02:00
1. Scenarist uses 40ms increments so less accurate than using AC3 delay corrector + Maestro.
2. Scenarist is an annoyance to use when undertaking simple authoring. Subs, chapters import etc are much easier in Maestro.
If you really want to avoid cutting the AC3 you can add a black bitmap at the start of DVDMaestro's timeline (before the video stream). It'll span 15 frames. And then you can drag audio to right accordingly.
e.g. -102 ms delay.
You add your picture. 15 frames = 600 ms
So your delay is now +498 ms. So drag the AC3 by that much to the right.
But really, I'm not sure why you are proceeding with this ;)
Mr Zippy
29th January 2003, 11:05
AC3 Delay corrector does seem to be the best method, as DVDMaestro has a simple user interface.
Is there a way to see if the uncorrected audio is the same sync as the original, I know the PTS values and DVD2AVI delays will not be the same to the frame serving and transcoding. One thing that is odd is DVD2AVI always shows -80ms delays on the re-authroed movie, even when I offset the audio by 2 seconds (-2000ms) which you can easily hear.
Also what keeps the audio in sync through the movie, I have read about poorly masterd DVDs that do not have the AC3 syncing flags - do we need to run create sync audio in DVDMaestro, but then surely we cannot drag forward in the timeline (or can we)
Maybe I am worrying about nothing, I just want to avoid any sync problems before the occur.
Can you tell I'm a worrier ;)
Anyway using AC3 Delay corrector I have had no sync issues yet, and I am looking foward to try commercial software like Pinnacle InstantCopy which if the quality is good will automate the backup process nicely.
Mr Zippy
29th January 2003, 11:09
Matthew, could you please type me you guide to fixing AC3 sync problems using AC3 corrector, including your explanation of how it worked with your examples, so that I may include it on my web site - I will credit yourself and doom9.org.
Then at least other users will be able to find the information easliy if it is required.
Matthew
30th January 2003, 01:57
I think you are worrying about nothing (in regards to audio staying in sync), because the way we are correcting the audio is like what people do with DivX (i.e., no timecodes, just line streams up at the beginning according to initial PTS values). And there are typically no sync problems with DivX.
I'll write a little guide, won't take long :)
Matthew
30th January 2003, 06:19
Well I wrote this, hardly brilliant but I think it suffices ;)
Guide to achieving perfect sync when reauthoring PAL DVDs using DVDMaestro.
Required:
DVDMaestro
AC3 Delay Corrector
DVD2AVI
This guide assumes you have re-encoded the video stream by feeding a DVD2AVI project file to CCE. If you haven't then it isn't valid.
Take the case of a simple DVD that contains one video and one audio stream. These streams are muxed together by an authoring program, and they don't necessarily start at the same time. When they start are governed by the first Presentation Time Stamp (PTS) values included in the muxed vobs (but not the streams themseleves).
Lets call the first video PTS value X and the first audio PTS value Y. The first video frame is played X ms into the DVD and the first audio frame is played back at Y ms into the video stream.
When you re-author in Maestro, it doesn't know about these PTS values as you are just feeding it the video and audio streams. Hence Maestro will mux the DVD such that the first video and audio frames will playback at the same time. This is fine if X = Y, but what if it doesn't? It means that the audio and video will be out of sync.
Here's an example. Lets say the first video PTS is 120 ms and the first audio PTS is 170 ms. This means that the audio stream should start 50 ms later than the video stream (i.e. there is an audio delay of 50 ms). Hence if the streams are muxed without adjustment, the audio will be replayed 50 ms earlier than it should be.
Similarly, in another case lets say the first video PTS is 120 ms and the first audio PTS is 71 ms. This means that the audio stream should start 49 ms earlier than the video stream (i.e. there is an audio delay of -49 ms). Hence if the streams are muxed without adjustment, the audio will be replayed 49 ms later than it should be.
So some adjustment is called for.
The first step is to use DVD2AVI to save your AC3 files along with the DVD2AVI project file. Each AC3 saved will include the delay figure in its filename, e.g. "movie AC3 T01 3_2ch 448Kbps DELAY 50ms.ac3"
If the audio delay is a positive figure, then do the following:
Import assets in Maestro, add them to timeline. Zoom in to the most detailed view (using "+" button).
You want the audio to start later than the video so you drag the audio to the right, the question is by how much. Well 1 video frame = 40 ms, so if your delay is 50 ms then drag to the right by a touch more than 1 frame.
Then compile the project, after a few seconds uncheck the compile box (the result is one main vob of relatively small size, e.g. 60 MB). Open this vob in DVD2AVI and save the project file [and accompanying AC3(s)]. Leave the vob open in DVD2AVI.
If the delay is too large, drag the AC3(s) to the left a fraction, similarly if it is not large enough, drag the AC3(s) to the right. Compile the project for a few seconds and switch back to DVD2AVI (the vob should still be open, no need to re-open it). Again save the AC3(s) using DVD2AVI. Repeat the process until the delay is correct. You should be able to get it within at least 1 ms of the desired figure.
If the audio delay is a negative figure, then it's a little trickier.
You cannot drag the audio to the left of the video in Maestro, so the next best thing is to cut off the start of the audio to remove the delay. However, you can only cut whole frames - which are equivalent to 32 ms - so cut the least number of frames that results in a positive delay. i.e. with a delay of -49 ms
Number of frames to cut = absolute value of delay/32
Number of frames to cut = 49/32
Number of frames to cut = 1.53125
As we can't cut partial frames, round the number up to the nearest whole number, in this case 2. So in AC3 Delay corrector enter in a start-delay of -(2 x 32) = -64 ms, then click write.
New delay = original delay + (number of frames cut x 32)
New delay = -49 + (2 x 32)
New delay = -49 + 64
New delay = 15 ms
Now do exactly what you'd do if you had a positive audio delay (which is outlined above).
---------------------------------------------------
A note on dealing with video streams which have not been re-encoded, or maybe even re-encoded differently (e.g. using REMPEG2)
Some DVDs have an unusual structure at the beginning of the DVD. A bug in DVD2AVI means it ignores the first 2 frames when
1) Calculating the audio delay; and
2) Frameserving to CCE.
The first effect results in a reported audio delay 80 ms less than it should be. But the second effect means the video stream is 2 frames (80 ms) shorter than it should be (the first 2 frames are not in the CCE output).
These 2 effects cancel each other out because in calculating its delay DVD2AVI is ignoring 2 video frames that aren't in the re-encoded video stream anyway.
But what if you are not re-encoding the video stream, or using another program like REMPEG2, which doesn't drop the frames? In this case DVD2AVI is inaccurate, as it is ignoring 2 video frames that are in the video stream you are using.
The easiest solution when using these streams is to use VobEdit instead of DVD2AVI to get the audio delay (you can still use DVD2AVI to extract the audio stream though, just ignore the delay figure). To get the audio delay open the first movie vob and click file, then "Get video/audio delay".
You can still use the guide above, with one exception - whenever you see a reference to using DVD2AVI to obtain the delay value, use vobedit instead.
Mr Zippy
1st February 2003, 00:35
Thanks, I have posted on my site.
http://www.encodinginfo.org.uk/dvd.php#delay
Mr Zippy
4th February 2003, 02:28
Originally posted by Matthew
You want the audio to start later than the video so you drag the audio to the right, the question is by how much. Well 1 video frame = 40 ms, so if your delay is 50 ms then drag to the right by a touch more than 1 frame.
In my tests if you drag the audio 1 frame foward in the timeline the delay shows around 25ms, yet if you drag foward 5 frames it shows 200ms (I'd expect 125ms) therefore I think the timeline is for the video only as audio is 32 frames a second and video is 25.
Also I use VobEdit to test the delay after muxing in DVDMaestro as it saves you actually demuxing anything at all to find on the new delay, as you can click get Video / Audio Delay.
Matthew
4th February 2003, 02:33
Well PAL is 25 frames per second. So that's 25 frames per 1000ms.
1000/25 = 40 ms ;)
As for using VobEdit, I don't think it makes much difference time/effort-wise as the partially muxed vob is small. But alter the guide accordingly if you feel like it :)
Mr Zippy
4th February 2003, 02:37
Thanks for the quick reply, I've just edited my oringal post you replied to whilst you were replying, as I did another quick test.
This is what I changed to...
In my tests if you drag the audio 1 frame foward in the timeline the delay shows around 25ms, yet if you drag foward 5 frames it shows 200ms (I'd expect 125ms) therefore I think the timeline is for the video only as audio is 32 frames a second and video is 25.
Matthew
4th February 2003, 04:32
heh, just tried it and see what you mean, I got 25 ms too.
I think you'll find it's a simple bug in DVDMaestro (i.e. interface is a just little inaccurate). As you can keep dragging to you get the figure you want it don't matter :)
Mr Zippy
6th February 2003, 03:06
One final question.
It has been said, whether frames are dropped or not, just use the same AC3 delay correction method.
Does this mean that on movies where 2 frames are not dropped during frame-serving, that the DVD2AVI delay is reporting correctly for this instance ie. the same as VobEdit would give.
I just re-read the whole topic and could not find this.
---------------------------------------------------
A point of interest............
I just tested a movie that drops 2 frames also with 3 programs:
DVD Decrypter: -88ms delay
DVD2AVI: -72ms delay
Actual delay with VobEdit: 8ms
I note the DVD Decrypter delay is another 16ms different!!!
TRILIGHT
6th February 2003, 03:57
No offense here, guys but it's becoming more and more obvious that this is a conversation between Mr. Zippy and Matthew. I am closing this thread because it is losing it's usefulness. Please discuss methods between the two of you via PM or e-mail. When you feel you've come up with a method others can benefit from, please post it in a new thread with an appropriate topic. This is the only way the information will ever be useful to those trying to find it. Many would not bother reading this thread as it is. Thank you both for your understanding and cooperation.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.