Log in

View Full Version : DGIndex to demux a DVD - extra black frames inserted on certain chapter boundaries?


nonoitall
27th March 2015, 08:39
I have a DVD with several anime episodes on it. All the episodes are a single title on the DVD, with certain chapters marking the episode boundaries. Playing the DVD in Media Player Classic or VLC has no sync issues throughout all the episodes. However, if I create a D2V project for the title in question and demux the audio and open them both in Avisynth (using Mpeg2Source and FFAudioSource), the first episode has audio in sync, but subsequent episodes do not.

In the second episode, there appear to be 19 extra black frames right at the beginning of the episode. If I trim them out, audio in that episode syncs up properly. (I made this determination by opening the DVD in DVD Shrink and re-authoring it such that the VOBs were split on the chapter boundaries that separated the episodes. Then I created separate D2V projects for each episode and still had sync issues and noticed that there were 19 more black frames preceding the second episode than there were preceding the first.)

Is there some known reason why this would happen on certain titles? Extra frames getting inserted before certain chapters?

manono
27th March 2015, 10:01
It sounds to me as if you split them incorrectly, with the black at the beginning of the episodes, rather than at the end of the previous ones.

Rather than using DVDShrink to split it into episodes, either use DVDDecrypter in IFO Mode together with the correct number of chapters or (maybe) split by VOB ID with PGCDemux. I don't believe any black frames were inserted, but that they were there all along - at the ends of the episodes. But I could be wrong.

Does this have anything to do with AviSynth? Should I move it to the Decrypting Forum, maybe?

nonoitall
27th March 2015, 10:52
It sounds to me as if you split them incorrectly, with the black at the beginning of the episodes, rather than at the end of the previous ones.
The problem actually presented without me splitting them at all; if I just create a DGIndex project for the entire title (which contains all the episodes) I still get sync issues on all but the first episode.

Rather than using DVDShrink to split it into episodes, either use DVDDecrypter in IFO Mode together with the correct number of chapters or (maybe) split by VOB ID with PGCDemux. I don't believe any black frames were inserted, but that they were there all along - at the ends of the episodes. But I could be wrong.
Yay! PGCDemux apparently extracts them correctly, and to boot, it seems to know which segments of the title correspond to each episode, so no need for me to pick out starting/ending chapters or frames. I guess DGIndex had some sort of issue when trying to index the entire title, and maybe DVD Shrink passed along whatever bugged DGIndex when it split it. No idea, really. DVD structure is so confusing. :confused:

Does this have anything to do with AviSynth? Should I move it to the Decrypting Forum, maybe?
Yeah, sorry, it's just one of the many software elements involved. My first instinct was to post this in the DGIndex section but the section seemed completely empty aside from stickies?

In any case, it seems you've pointed me to a tool that will do what I need, so thanks a bunch! :)

StainlessS
27th March 2015, 12:21
but the section seemed completely empty aside from stickies?

You can change Display Options (at bottom of page) to "From The Last Year", instead of "From The Last Month".

manono
27th March 2015, 12:55
The problem actually presented without me splitting them at all; if I just create a DGIndex project for the entire title (which contains all the episodes) I still get sync issues on all but the first episode.
Which doesn't address my point at all. Your problem is that the black frames have no audio. The DVD when played knows how to take that into account. DGIndex can't.
I guess DGIndex had some sort of issue when trying to index the entire title...
Nothing of the sort.

Okay, I'll move this to the DGIndex Forum. It could use a fresh post.

Glad you got it sorted out. :)

nonoitall
28th March 2015, 02:14
You can change Display Options (at bottom of page) to "From The Last Year", instead of "From The Last Month".
Ooooh. Okay, thanks!
It sounds to me as if you split them incorrectly, with the black at the beginning of the episodes, rather than at the end of the previous ones.
The problem actually presented without me splitting them at all; if I just create a DGIndex project for the entire title (which contains all the episodes) I still get sync issues on all but the first episode.
Which doesn't address my point at all.
I mistakenly had thought that the parts in bold were your point, and my addressing of your point, respectively. With your latest post I believe I see what your point was, however.

Your problem is that the black frames have no audio. The DVD when played knows how to take that into account. DGIndex can't.
Now I believe I understand. But I will restate the problem as I understand it in idiot-ese so that if anyone else like me comes along with the same problem they will understand:

There are (black) frames at the end of the episode which have no corresponding audio. DVD players ignore these audio gaps and emit silence. When the entire title was extracted, DGIndex appended all the audio for each episode immediately one after the other and made no adjustment for gaps in the audio. This meant that the gap in audio which is present when the title is played back was not present in the resulting audio stream, which caused all but the first episode to fall out of sync if the resulting streams were used together.

I was under the incorrect impression that individual titles on a DVD were limited to being continuous, matching streams without arbitrary breaks inside the audio or video, and thus I did not anticipate that extracting a single title's streams could result in shifting times of one stream but not the other. This was exacerbated by the fact that, when re-authoring the disc in DVD Shrink, those blank frames (with their audio gap) evidently got prepended to the second episode's title. So extracting the re-authored second episode in DGIndex still resulted in an audio gap right at the beginning of the episode being 'swallowed up', which led to immediate desync.

Really, my deduction was not too far off:
I guess DGIndex had some sort of issue when trying to index the entire title, and maybe DVD Shrink passed along whatever bugged DGIndex when it split it.
The 'issue' was simply a limitation in the way DGIndex works: There can be gaps in the audio of a title, which are accounted for when the disc is played, but which DGIndex does not insert padding to replace. And re-authoring the disc in DVD Shrink apparently placed one such gap with its corresponding video at the beginning of the second title, "passing it along" to DGIndex to perpetuate the same sync issue that arose when the entire title was extracted together.

Pictures are good, so psuedo-example of a DVD title:
Video: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
Audio: 00 01 02 03 04 05 06 07 08 09 10 14 15 16 17 18 19 20
In above example, DVD player plays 00-13, and the last bit of it will have no audio. Then it resumes audio playback at 14. However, if we extract this title's streams with DGIndex we end up with streams like this:
Video: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
Audio: 00 01 02 03 04 05 06 07 08 09 10 14 15 16 17 18 19 20
The gap had no audio data and no padding or anything is inserted, so streams fall out of sync, with audio playing too early starting at 11. Does that all sound about right? (To be clear, I'm not criticizing the fact that DGIndex does not replace audio gaps with padding; I'm just noting that one must take this into account when working with it.)

manono
28th March 2015, 05:13
Does that all sound about right?
Yes, that's correct. The audio from the second and subsequent episodes 'slides' up against the earlier audio, ignoring the original gap of silence, creating the out of synch audio for every episode after the first. There's probably a sign of the problem when checking the DVD in PGCDemux. When checking the cells you might see some real short ones and those are the black frames with no audio. You could confirm (or disprove) that theory by demuxing one into audio and video and there'd be no audio file when done.

It's a rare problem, but it's not unheard of. Anytime the audio is shorter than the video it might happen. For example, people over the years have joined 2 DVDs of various Lord of the Rings movies and found that part 2 was out of synch. The cell with the text screen at the end of part one telling you to put in the second disc had no audio, causing the problem. But it's probably most common in the kind of anime you have - episodic with all the episodes in a single title.