View Full Version : Conjecture about field order from D2V file
Guest
9th June 2003, 21:52
This has come up several times. It would be useful if the following conjecture were true:
Look at the very first frame's flag digit in the D2V file. If it is a 2 or a 3, the resulting (non-FORCE FILM) AVI will be top-field first. If it is 0 or 1, the resulting AVI will be bottom field first.
I cannot find a counterexample and it appears justified on theoretical grounds.
It also explains how you can get both TFF and BFF AVIs from the same DVD rip. If a TFF VOB is cut before a 0 or 1, it becomes BFF.
Can anyone refute the Graft Conjecture? :D
hakko504
9th June 2003, 21:58
No. I'd like to confirm it.DVD2AVI FAQ Q07 (http://forum.doom9.org/showthread.php?s=&threadid=46851) quotes Nic (http://forum.doom9.org/showthread.php?s=&threadid=49423):Q07: What are all those numbers inside the .d2v file?
A:Some typical line of the .d2v file looks something like this:
7 0 120B 2 3 0 1 2 3 0 1 2 3 0 1 2 3
7 0 12E0 0 1 2 3 0 1 2 3 0 1 2 3 0 1
7 0 13BB 2 3 0 1 2 3 0 1 2 3 0 1 2 2
7 0 14A7 2 2 2 2 2 2 2 2 2 2 2 2 2 2
The first number is always 7, and represents a keyframe.
The second number is a reference to the filenumber, as defined in the first few lines of the .d2v. The third number is the sector offset, a reference to how far into the vob DVD2AVI/mpeg2dec should look for the keyframe (1 sector = 2048 bytes). The remaining numbers of the file is a reference to how the frames should be interpretated with reference to top/bottom-first (tff) display and repeated fields (rff).
trf = 2*tff + rff
0 0 0 (bottom first without repeated field)
1 0 1 (bottom first with repeated field)
2 1 0 (top first without repeated field)
3 1 1 (top first with repeated field)
A correctly telecined video should have the sequence ...012301230123...
A long list of 2's (or 0's) indicates interlaced video OR 25/30fps progressive.
Guest
9th June 2003, 22:20
Yes, but a single D2V file can have runs of 0s *and* 2s between telecined parts. My conjecture is that it is the polarity of the first frame in the D2V that determines the polarity of the resulting AVI. That is not addressed by Nic's FAQ.
trbarry
10th June 2003, 03:44
I have wondered about this before but can't either confirm or deny it. It makes sense that, both with or without Force Film, MPEG2DECx will return fields in frames (pairs) so if the first one is returned top first then all the others should be also.
But I still worry about it and still cannot completely visualize all the strange things that may be happening.
- Tom
trbarry
13th June 2003, 01:56
The more I think about it the more I am inclined to support the "Graft Conjecture" above.
It seems the apparent changing of polarity on my HDTV clips would only be evident in the source frames themselves. But when not using Force Film they would all come out the same as the first frame by the time they got to Avisynth.
I still don't understand how Force Film would handle it but I don't trust that usually anyway for my stuff.
- Tom
bilu
13th June 2003, 10:38
Originally posted by neuron2
Yes, but a single D2V file can have runs of 0s *and* 2s between telecined parts. My conjecture is that it is the polarity of the first frame in the D2V that determines the polarity of the resulting AVI. That is not addressed by Nic's FAQ.
Do you think this also applies to hard-telecined movies?
Bilu
Guest
13th June 2003, 13:19
The Graft Conjecture is all encompassing!
bilu
13th June 2003, 14:07
I think I got it. So only the rff flags fail then :)
Guest
13th June 2003, 14:59
There are no RFF flags set in a hard telecined VOB.
bilu
13th June 2003, 15:19
My point exactly, I understood well :)
trbarry
13th June 2003, 16:17
Is a GOP require to have an even number of output fields? Is a video clip?
What happens when we concat non-sequential input clips of varying polarity?
Things to think about.
- Tom
Guest
14th June 2003, 00:37
As I have pointed out, of course you can concatenate AVIs with different polarities, but they won't play correctly. The same point applies if you try to badly concatenate VOBs. The conjecture applies to D2V files derived from properly formed VOBs, i.e., ones that play correctly.
Regarding GOPs and field pictures, the MPEG2 spec says that if field pictures are used, they shall occur in pairs. So GOPs always have an even number of fields.
bilu
14th June 2003, 01:12
Originally posted by neuron2
Regarding GOPs and field pictures, the MPEG2 spec says that if field pictures are used, they shall occur in pairs. So GOPs always have an even number of fields.
That's nice to know.
But if tff flags are reliable, doesn't that also means that we can check the field order difference in the D2V file, i.e. one part has 0's and the next has 2's, for example? So we shouldn't have problems with bad concatenated VOBs, just AVIs.
Bilu
trbarry
14th June 2003, 03:44
Regarding GOPs and field pictures, the MPEG2 spec says that if field pictures are used, they shall occur in pairs. So GOPs always have an even number of fields.
It's good that field pictures occur in pairs, but does that mean output fields of a GOP, after evaluating repeat flags. I mean, any frame with a rff flag actually puts out 3 fields, right? Or is that magically taken care of somehow.
The reason I was asking is because DVD2AVI allows you to set the starting and ending location. I think that is always in GOPs, clipping properly at I-frames but I was not sure of the implications for polarity if a GOP contained an odd number of rff flags. So hopefully it can't do this.
- Tom
bilu
15th June 2003, 22:20
Can this be useful? What's your opinion?
http://forum.doom9.org/showthread.php?s=&postid=329059#post329059
Bilu
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.