View Full Version : Duration / Elapsed Time not picked up right by GK
stormy1777
27th August 2004, 21:31
Rip using dvddcrypter 3.1.7 in IFO mode, duration shows as 1:31:19.
In dvd2avi v1.77.3dg1.0.0RC2 I load the VOBs and can advance up to 1:31:17 (click on right until it stops) ok, save project (no force film) in log file I see:
Stream_Type=1,0,0
iDCT_Algorithm=5 (1:MMX 2:SSEMMX 3:FPU 4:REF 5:SSE2MMX)
YUVRGB_Scale=1 (0:TVScale 1:PCScale)
Luminance_Filter=0,0 (Gamma, Offset)
Picture_Size=0,0,0,0,0,0 (ClipLeft, ClipRight, ClipTop, ClipBottom)
Field_Operation=0 (0:None 1:ForcedFILM 2:SwapOrder)
Frame_Rate=29970
Location=0,0,3,6DF14
on bottom:
7 3 6DEF2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
7 3 6DEFF 2 2 2 2 2 2
7 3 6DF0F 2 9
FINISHED 89.30% FILM
now open in GK 0.28.8 and in bitrate tab I see duration of:
1:31:25. that's 6 seconds off...
nothing in GK settings (frame rate, NTSC/PAL) seem to effect this duration so it must read it/figure out from dvd2avi..
which is broken? dvd2avi or one of my setting?
I haven't encoded anything yet, just noticing wrong duration, if I do encode then audio is out of synch...
manono
28th August 2004, 05:11
Hi-
...if I do encode then audio is out of synch...
How do you know that, if you haven't encoded it yet? What's the length of the audio? Among other ways, you can open it in HeadAC3he (http://www.doom9.org/Soft21/Audio/headac3he-0.23a.rar) to find out.
My guess is that nothing's broken, but I'll admit that it's an unusual problem.
len0x
28th August 2004, 11:45
It may be worth trying DGIndex instead DVD2AVIdg as well...
stormy1777
29th August 2004, 18:47
manono,
If you read what I said then.. I did encode several times, but audio is out of synch since source is OK I found it a waste of time trying to figure out what exactly is out of synch.. I then point out the exact location I notice an irregularity, i.e. prior to encoding.. just after dvd2avi..
now I used HeadAC3he and it shows the exact correct time of the source.. but then again I never thought the audio is bad.. it's the video that shows up longer in GK...
ok.. so the next suggestion is probably the solution, I passed it by DGIndex and got a new d2v file.. diffed the two, and seems like more info in the new one.. that causes GK not to be able to read it, trying to open it says it's an invalid d2v.. does anyone have any idea how to 'merge' the two to satisfy GK, or how to check the length on film encoded in these two d2v's?
the new file has this heading:
Stream_Type=1
iDCT_Algorithm=5 (1:MMX 2:SSEMMX 3:FPU 4:REF 5:SSE2MMX)
YUVRGB_Scale=1 (0:TVScale 1:PCScale)
Luminance_Filter=0,0 (Gamma, Offset)
Clipping=0,0,0,0 (ClipLeft, ClipRight, ClipTop, ClipBottom)
Aspect_Ratio=4:3
Picture_Size=720x480
Field_Operation=0 (0:None 1:ForcedFILM 2:RawFrames)
Frame_Rate=29970
Location=0,0,3,6DF14
and this in the body:
7 0 2048 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 161792 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 403456 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 690176 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
original d2v has a body of:
7 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2
7 0 4E 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
7 0 C4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
7 0 150 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
I can spend some time to figure it out, but wondering if folks have already done it.. thanks..
manono
30th August 2004, 02:46
Hi-
You said, "I haven't encoded anything yet, just noticing wrong duration". I don't know what that tells you, but it tells me you've only looked at the length in DVD Decrypter and the .d2v's length in GKnot.
Anyway, to make the .d2v from DGIndex readable in GKnot, upgrade your GKnot to the latest. There were audio synch problems with some of the DVD2AVIDG versions, so using DGIndex (per len0x's suggestion) may solve the problem.
stormy1777
30th August 2004, 08:42
and.. the rest of that sentence says "if I do encode then audio is out of synch".. so.. trust me, I've reencoded several times but only this source is causing problems..
ok, so pulled 0.32 beta and the 1.7 codec pack, and still for some reason can't open the d2v file generated by DGindex 1.0.12 get: File is not a valid d2v project, avi or avs file!.. how do I debug this/verify correct format..
it did complain about not having mpeg2dec3.dll, so I copied the previous one: 254,018 bytes 2-oct-03.. should I get a different one?
manono
30th August 2004, 13:32
You have to use the dgdecode.dll that comes with the newest GKnots/DGIndex's. It's replaced the mpeg2dec3.dll. Check in the Options Tab, over on the left side under MPEG Decoding Library, to make sure it says "dgdecode.dll" (and then do what it says).
stormy1777
31st August 2004, 08:38
yes.. changing dgdecode.dll allows new GK to read the DGIndex d2v format, however timing is still off at 1:31:25 when real video is 1:31:17. If I encode resulting avi has badly synched audio almost through the film.. audio length of both the ac3 and cbr mp3 is 1:31:17, also DGIndex can advance up to 1:31:17.. only GK's interpertation is wrong.
Tried a new slot, still the length is off..
Can someone point me to source code location (routine name) of where this interpertation is done? Other sources are indexed correctly, it's only this particular DVD.
here's a snapshot of the d2v file (top):
Stream_Type=1
iDCT_Algorithm=5 (1:MMX 2:SSEMMX 3:FPU 4:REF 5:SSE2MMX)
YUVRGB_Scale=1 (0:TVScale 1:PCScale)
Luminance_Filter=0,0 (Gamma, Offset)
Clipping=0,0,0,0 (ClipLeft, ClipRight, ClipTop, ClipBottom)
Aspect_Ratio=4:3
Picture_Size=720x480
Field_Operation=0 (0:None 1:ForcedFILM 2:RawFrames)
Frame_Rate=29970
Location=0,0,3,6DF14
7 0 2048 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 161792 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 403456 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
and the bottom of the file:
7 3 922167296 2 26 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
7 3 922195968 2 26 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
7 3 922222592 2 26 2 2 12 12 12 12
7 3 922255360 3 1 12 9
FINISHED 89.30% FILM
will try to attach the file (previous time it killed my post so had to type all this from scratch!)
thanks for any help, I think this thread will uncover a bug in GK... :-)
len0x
31st August 2004, 11:14
Originally posted by stormy1777
thanks for any help, I think this thread will uncover a bug in GK... :-)
Not really. If there is a bug then its in DGIndex/DGDecode that you used to supply all the info to AutoGK (along with demuxed audio). But then nothing we can do atm.
stormy1777
31st August 2004, 16:24
well.. either way... I'm now trying to understand/'reverse engineer' how GK gets a time based on parsing the d2v file.. I'm not using AutoGK (I prefer to original and using v0.32 beta)
Specifically these lines somehow are converted into time:
Frame_Rate=29970
7 0 2048 1 1 12 12 12 12 12 12 12 12 12 12 12 12 12
7 0 161792 1 1 2 2 12 12 12 12 12 12 12 12 12 12 12 12 12
is there a way I can verify that DGIndex did the right thing with a different tool? (Inside DGIndex it knows the correct length, but maybe when you 'save project' it padds it with more stuff) seems like I need to switch to the dvd2avi group... maybe GK uses this DLL to get the time duration...
(only the len0x knows ;-)
I'm willing to work on this as long as it takes.. I'm in no rush..
thanks.
stormy1777
31st August 2004, 16:45
ok, as always u'r right...
I simply removed about 18 lines from the d2v file (close to the end) and now when I open in GK it shows correct video length.. now encoding.. answer shortly.. then we'll go and bug the DGIndex folks ;-) source is FILM 85%, NTSC 4:3 29.970.
thanks!
len0x
31st August 2004, 16:49
It does _not_ parse d2v file. It displays whatever is supplied by a call to DGDecode.dll So it really out of our control.
stormy1777
31st August 2004, 21:20
ok, moved here: http://forum.doom9.org/showthread.php?s=&threadid=81694
re-encode (with trimmed d2v file) gets the video to the correct length, however audio is still out of synch all over the clip.. which leads me to thinking that it has something to do with droping frames throughout the movie maybe ivtc or something.. I've never encountered anything like this... thanks for the help...
stormy1777
1st September 2004, 22:56
tried autoGK, same symptom, audio out of synch AND video is 8 seconds longer than it should.
so I used my hack.. basically TRIM a few lines from the d2v file and load into GK each time you trim the length of the video should decrease (I trim from the end of the file assuming it's the credits). once video length is correct encode to final avi (now you have a video of right length). Audio is out of synch I used Synchronizer 0.08b (http://www.chez.com/ripitall/prog/synchronizer.zip) to fix, in my case it was +7000ms (7 sec) offset, now all is OK.
I'll try to keep the source VOB files around.. if anyone wants to help debug..
thanks for the support and ideas.
piscator
2nd September 2004, 01:23
Are you sure you selected the right PGC? Sometimes there is a PGC around that includes a stupid trailer or something. Isn't there a PGC without the trailer stuff or so?
Anyway, it might be worthwhile to check your IFO with IFOEdit (http://www.doom9.org/Soft21/Vobtools/Ifoedit096.zip). Check the program chain part and see if you see some weird reference.
greetz,
Piscator
stormy1777
2nd September 2004, 05:43
NICE... I do see this:
PGC_1 (program chain): [Title(TTN): 1] [01:31:19.16 / 30 fps] (Programs: 25) (Cells: 28) (uses VOB-IDs: 1,2,3)
**[Ch 01] [Pg 01] [Cell 01] [V/C Id: 1/ 1] : time: 00:00:07.00 / 30 fps [Pos: 00:00:07.00] [Frames: 210] SP/ILVU/DISC/SA:[ no/ no/yes/ no]
[Cell 02] [V/C Id: 2/ 1] Layer Br.: time: 00:04:42.25 / 30 fps [Pos: 00:04:49.25] [Frames: 8695] SP/ILVU/DISC/SA:[ no/ no/yes/ no]
[Ch 02] [Pg 02] [Cell 03] [V/C Id: 2/ 2] : time: 00:04:30.19 / 30 fps [Pos: 00:09:20.14] [Frames: 16814] SP/ILVU/DISC/SA:[yes/ no/ no/ no]
[Ch 03] [Pg 03] [Cell 04] [V/C Id: 2/ 3] : time: 00:01:31.16 / 30 fps [Pos: 00:10:52.00] [Frames: 19560] SP/ILVU/DISC/SA:[yes/ no/ no/ no]
[Cell 05] [V/C Id: 2/ 4] : time: 00:03:34.24 / 30 fps [Pos: 00:14:26.24] [Frames: 26004] SP/ILVU/DISC/SA:[yes/ no/ no/ no]
[Ch 04] [Pg 04] [Cell 06] [V/C Id: 2/ 5] : time: 00:04:46.11 / 30 fps [Pos: 00:19:13.05] [Frames: 34595] SP/ILVU/DISC/SA:[yes/ no/ no/ no]
[Ch 05] [Pg 05] [Cell 07] [V/C Id: 2/ 6] : time: 00:02:55.29 / 30 fps [Pos: 00:22:09.04] [Frames: 39874] SP/ILVU/DISC/SA:[yes/ no/ no/ no]
that is where the 7 seconds are coming from (I marked that line with ** so you can see it)... it seems like the indexing piece counts these 7 seconds TWICE.. that's why a) the video is 7 seconds longer, b) audio out of synch... the beginning 7 seconds are some logo moving around..
I let dvddecrypt chose main PGC.. maybe that "Layer Br" means something.. I think those 7 seconds are counted twice..
thanks for that idea!
piscator
2nd September 2004, 09:27
DVDDecrypter chooses the longest PGC, not necessarily the right one (especially when trailers are included in the main PGC, though this is rare for most DVDs). Perhaps a newer version of DVDDecrypter helps (current is 3.2.3.0), but I doubt it.
I don't think the 7 seconds are counted double. The first 7 seconds probably hasn't any audio with it. You do the video encoding on it (what does the first 7 seconds show?), so that's why the audio is out of sync.
What helps as a workaround in this case is add a trim(8695,lastframe) to the first line of your AVS script.
greetz,
Piscator
stormy1777
2nd September 2004, 19:02
Originally posted by piscator
[B]DVDDecrypter chooses the longest PGC, not necessarily the right one (especially when trailers are included in the main PGC, though this is rare for most DVDs). Perhaps a newer version of DVDDecrypter helps (current is 3.2.3.0), but I doubt it.
actually 3.5.1.0 is out today..:-) well, I know about auto-select of PGC, it seemed OK at the time (there was no trailer or anything big just a harmless logo in the front).. only noticed problem when loaded ingo GK timing was off compared to source (pointing to DGIndex problem)
I don't think the 7 seconds are counted double. The first 7 seconds probably hasn't any audio with it. You do the video encoding on it (what does the first 7 seconds show?), so that's why the audio is out of sync.
Source is of length X, first 7 seconds do not have audio just a spinning logo. the DGIndex or DVD2AVIDG output of that source produces length of X+7 seconds. so the indexed video length is NOT correct to begin with, it's longer then it should. Video source is X, output of DGIndex and final GK encode is X+7. Audio stream in all steps is always exactly X. thats why I say that these 7 seconds were indeed counted twice, otherwise how else would the video stream be exactly 7 seconds longer than the source??
thanks for advice..
piscator
2nd September 2004, 23:15
The PGC shows playtime '01:31:19.16'. The actual time you encoded is probably '01:31:12.16'. So the first 7 seconds is not counted double, it shouldn't be counted at all, not being a vald MPEG2 stream but some 'advanced' DVD thing. Perhaps the author of DGIndex could include a feature to detect and get rid of these thing automatically (perhaps difficult to do) or add a 'chapter selection' feature to prevent these things. However, I've no idea who made DGIndex so I've no idea where you could suggest this.
At least glad that the problem is identified!
greetz,
Piscator
stormy1777
3rd September 2004, 05:06
to clarify.. time in IFO file is: '01:31:19.16' if I sum up all the times then it comes exactly to that value (that includes the 7 seconds).. ok, this is OK and normal.
now if I index using latest DGIndex/dvd2avidg and load that d2v into GK it shows a time of '01:31:25' that is 7 seconds LONGER than what it should be.
If I encode, the final video comes to be 1:31:25 and audio is out of synch. audio length is always 1:31:19.
bottom line, the first 7 seconds are counted twice in the indexing process. I'll follow up in the dvd2avi forum..
please reply on this thread:
http://forum.doom9.org/showthread.php?s=&threadid=81694
since its really not a GK issue, it's DGIndex/dvd2avi...
thanks.
jggimi
3rd September 2004, 12:43
Don Graft (neuron2) is the author of DGIndex and the moderator-of-record for the DVD2AVI forum.
I'm closing this particular thread, since stormy is duplicating efforts in both threads, and, whatever the root cause, it's not a GK specific problem.
As stormy requested, please submit all followups in the other thread.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.