PDA

View Full Version : lotr: TTT video/audio size difference


code
7th December 2003, 20:27
I have currently regrouped all vobs of th TT -extended version (pal) in 1 directory. Used dvd2avi(1.77.3) to make a dv2 and to strip the AC3 2ch sound track.

It seems my videosize=3.45.43
audiosize=3.45.39
playing the vobs directly in powerdvd works fine
playing the rip shows me the problem (audio out of sync) starts between file 6 and 7 (is also the end of CD1 and start of CD2).

I have read a few posts on dvd2avi losing a few frames in certain conditions but here i'm dealing with 4 seconds=+/- 100 frames.

1 year ago i ripped the fellowship disc and there i had a similar problem, unfortunately i cant remember what i did to solve that problem.

suggestions?



==========my DV file:

DVD2AVIProjectFile
12
29 Q:\ring\VIDEO_TS\VTS_01_1.VOB
29 Q:\ring\VIDEO_TS\VTS_01_2.VOB
29 Q:\ring\VIDEO_TS\VTS_01_3.VOB
29 Q:\ring\VIDEO_TS\VTS_01_4.VOB
29 Q:\ring\VIDEO_TS\VTS_01_5.VOB
29 Q:\ring\VIDEO_TS\VTS_01_6.VOB
29 Q:\ring\VIDEO_TS\VTS_01_7.VOB
29 Q:\ring\VIDEO_TS\VTS_01_8.VOB
29 Q:\ring\VIDEO_TS\VTS_01_9.VOB
30 Q:\ring\VIDEO_TS\VTS_01_10.VOB
30 Q:\ring\VIDEO_TS\VTS_01_11.VOB
30 Q:\ring\VIDEO_TS\VTS_01_12.VOB

Stream_Type=1,0,0
iDCT_Algorithm=2
YUVRGB_Scale=1
Luminance=128,0
Picture_Size=0,0,0,0,0,0
Field_Operation=0
Frame_Rate=25000
Location=0,0,11,298F

=========part of dv file: file 6->7
7 6 7FE8F 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
7 7 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
=======================================

hakko504
7th December 2003, 21:34
I need to make this a FAQ, because it's a quite common problem, and it's not easy to solve satisfactory

Short answer: DVD2AVI can not handle audio synch of two separate PGC's that have been joined the way you described.

Long answer: What to do then? Two possible ways exists. The first is the quick, easy and reliable one, but not always totally predictable method: encode each DVD separately. This is the best if you wish to keep the 5.1 audio.
To understand the second method (which uses AviSynth) I'll need to describe how the vobs are muxed. First of all, you must realise that video and audio does not have to be of equal length inside a vob. audio synch is ensured by timestamping both audio samples and video frames. And for audio, a number of samples is encoded as a group, which means that even if it is quite at the end of the file, the length of the file will always be a multiple of whole groups. of samples. And sometimes you want the audio to play before or after the video, so a situation like this is not uncommon:
|---time------------------>
*video------------end*
*audio----------------end*
Now if you add two PGC's that both have audio/video like the above, it should look like this:
|---time------------------------------------------->
*video1------------end* *video2------------end*
*audio1----------------end**audio2----------------end*
But DVD2AVI does not check the timestamps after the initial video frame. This is because it wouldn't know what to do in the time where there is no video information. In some cases a black screen would not be suitable, and it is also possible that the time between the last video frame of file 1 and the first of file 2 does not add up to a multiple of whole video frames too. In any case it means that what you get from DVD2AVI is this:
|---time------------------------------------------->
*video1------------end**video2------------end*
*audio1----------------end**audio2----------------end*
So in order to avoid this you need to cut the audio from the middle of the final video - but this can't be done in DVD2AVI. Instead we need to save the .d2v's independently from both PGC's, cut the audio 'sticking out' and then put it back together again in the correct manner. At the moment the only safe(1) way of doing this is by using AviSynth and the trim function, but IIRC this will only and only work with 2 channel audio. AviSynth 2.5 have support for multichannel audio, but I don't know if any usful app can get multichannel audio from AviSynth and do something useful with it. (i.e. reencode it to AC3)
In any case, let's assume you have created your two .d2v's and have two stereo WAV's with delay 0ms (this can be arranged by converting the AC3 to WAV using BeSweet) and that they are called disc1.d2v disc1.wav disc2.d2v and disc2.wav. Then you can use the following script to join the files correctly:video1=mpeg2source(disc1.d2v)
audio1=wavsource(disc1.wav)
movie1=audiodub(video1,audio1)
video2=mpeg2source(disc2.d2v)
audio2=wavsource(disc2.wav)
movie2=audiodub(video2,audio2)
total=movie1++movie2
return totalAnd now when you feed this AViSynth script to an encoder (like VirtualDub(Mod)) you will get 100% synchronized audio.



(1) You can always decode the AC3 into six files and cut them manually to the correct length. But don't blame me if you fail.

Cyberia
11th December 2003, 22:16
If you haven't already...

Try ripping/splitting the VOBs into the smallest possible segments (split on Cell-ID), then remove any "all black" or intermission segments.

When I do this, there are usually TINY vobs 1-20KB large at the beginning or end of a clip. Maybe they are throwing you off.

Mango Madness
14th December 2003, 19:02
i vote for sticky status on this thread, at least somewhere (perhaps it's better suited for avisynth forums?).