[RESOLVED] Different duration after indexing

Support forum for DGDecNV
Post Reply
Xunkar
Moose Approved
Posts: 36
Joined: Sun Aug 18, 2019 5:17 am

[RESOLVED] Different duration after indexing

Post by Xunkar » Thu Aug 29, 2019 10:45 am

Hello, I know I'm asking a lot of questions recently I hope you don't mind :D

I've stumbled upon a VOB that displays an odd behavior. When opening the VOB in MPC-HC it has a duration of 20:30.976. But once I index it with DGIndexNv and opens it with DGSource+VirtualDub or FFMPEG the video duration is 20:32.160. The video starts with a fade from black, I'm only saying this because I suspect it could be related. The same thing happens with the original DGIndex by the way. I can tell that the extra duration has been added in the beginning of the video, a whole second of black frames. This is not particularly problematic, but kind of intriguing. It also messes with my scripts as I have to introduce some delay on the audio tracks to compensate.

On an unrelated note I've also noticed that DGIndexNV does not warn on bad field order transition like DGIndex used to, how is that handled? Can I safely index VOBs with DGIndexNV or should I use it only for HD sources?

Thank you.

User avatar
admin
Site Admin
Posts: 4410
Joined: Thu Sep 09, 2010 3:08 pm

Re: Incorrect duration after indexing

Post by admin » Thu Aug 29, 2019 12:14 pm

Please provide a link to the unprocessed VOB. We cannot do anything without it. If you want to use my FTP please send me a PM.

If a field order transition is detected it gets automatically fixed and a backup DGI is created that contains the unfixed index. A warning popup is not generated.

Xunkar
Moose Approved
Posts: 36
Joined: Sun Aug 18, 2019 5:17 am

Re: Incorrect duration after indexing

Post by Xunkar » Thu Aug 29, 2019 2:29 pm

Oh I should mention that the VOB was created through PgcDemux. Otherwise I wouldn't be able to tell where the episode starts precisely (as I mentionned in a different thread). Could this be the source of the discrepancy?

Here is the VOB in any case https://mab.to/eH2lWrf9D

User avatar
tormento
Moose Approved
Posts: 321
Joined: Mon Sep 20, 2010 2:18 pm

Re: Incorrect duration after indexing

Post by tormento » Fri Aug 30, 2019 5:17 am

Xunkar wrote:
Thu Aug 29, 2019 10:45 am
When opening the VOB in MPC-HC it has a duration of 20:30.976. But once I index it with DGIndexNv and opens it with DGSource+VirtualDub or FFMPEG the video duration is 20:32.160.
Video and audio have different lenghts. MPC-HC takes the longest of the two to display duration.

Just use MediaInfo to acknowledge what I saw.

Xunkar
Moose Approved
Posts: 36
Joined: Sun Aug 18, 2019 5:17 am

Re: Incorrect duration after indexing

Post by Xunkar » Fri Aug 30, 2019 7:37 am

I beg to differ. When that happens MPC will start both video and audio at 0:00 and either the audio will cut off sooner than the video (if the audio track is shorter) or the video will stop on the last frame until the audio track is over (if the video track is shorter).

Here the issue is different. When opening the VOB you can clearly count 1 second before the fade in from the black begins, and 2 seconds when the video is opened through VirtualDub or encoded through FFMPEG, without any audio track.

User avatar
tormento
Moose Approved
Posts: 321
Joined: Mon Sep 20, 2010 2:18 pm

Re: Incorrect duration after indexing

Post by tormento » Fri Aug 30, 2019 9:25 am

Xunkar wrote:
Fri Aug 30, 2019 7:37 am
Here the issue is different.
Load the 2 VOBs in AviDemux and export as mkv, copying video and audio tracks (no encoding).

You will have a perfectly synced track and, if you try to demux, you will find that audio has 1941ms of delay.

IMHO VirtualDub and FFMpeg don't honor the delay. Is there any sync problem when encoding with them?

Dunno how VOB was created so I can't understand exactly what happened. Perhaps, you can use this workaround.

Xunkar
Moose Approved
Posts: 36
Joined: Sun Aug 18, 2019 5:17 am

Re: Incorrect duration after indexing

Post by Xunkar » Fri Aug 30, 2019 12:37 pm

You are right muxing the VOBs through AviDemux does sync the tracks which is done by inserting extra seconds at the beginning (since the audio has a negative delay I guess that makes sense). The fact that MediaInfo does not display decimals on duration has thrown me off with the rounding, but I guess this was all due to the delay.

I'm curious how you managed to determine the audio delay this precisely, I've tried inspecting the resulting file with MediaInfo, MakeMKV and MKVCleaver but I did not found it.

User avatar
admin
Site Admin
Posts: 4410
Joined: Thu Sep 09, 2010 3:08 pm

Re: Incorrect duration after indexing

Post by admin » Fri Aug 30, 2019 3:43 pm

This is a classic example of the "video with no audio" problem described in the user manual Appendix F. There are several resets of the System Clock Reference (SCR = 0) at the beginning of the stream (look at a timestamps dump). A player can track these SCR resets whereas when DGIndexNV demuxes streams the SCR values are lost. So it is a matter of when to start demuxing video and when to start demuxing audio. DGDecNV simply demuxes all the video and audio regardless of STC values. Players and other applications may do things differently, but I do not want to play the game of coding around pathologies in an ancient format (DVD VOB) by playing guessing games about how the STC is managed. (Here's the kind of nonsense that can result: our strategy will be to ignore any STC resets and associated video and audio followed by a further reset within 5 seconds. It's crazy.)

My advice is given in the Appendix F of the DGIndexNV manual. Determine the delay you need and then implement that when you do your final muxing. It's not the only way to do things, as tormento has shown, but it at least lets you see the issues involved with these unusual streams.

Whee!

User avatar
tormento
Moose Approved
Posts: 321
Joined: Mon Sep 20, 2010 2:18 pm

Re: Incorrect duration after indexing

Post by tormento » Mon Sep 02, 2019 2:34 pm

Xunkar wrote:
Fri Aug 30, 2019 12:37 pm
I'm curious how you managed to determine the audio delay this precisely, I've tried inspecting the resulting file with MediaInfo, MakeMKV and MKVCleaver but I did not found it.
Simply demux with any GUI that relies on MKVToolnix toolkit. DGIndexNV too.

Post Reply