Log in

View Full Version : IVTC pulldown not really 3:2?


k0r0n4
24th August 2004, 04:33
I'm doing a 3:2 pulldown on some video ripped from DVD, but even though I've figured out the field order, and gotten the 3:2 pulldown to work, I'm still having problems. In order to find the frame offset for the deinterlace, I made all 5 possibilities for the 3:2 pulldown and put them together using ShowFiveVersions.

Actually, it would be easier to explain if you just look at the script:
# Type A
#
# 0 1 2 3 4 5 6 7 8 9
# A1 A2 B1 A2 C1 B2 C1 C2 D1 D2
#
# 0, 1, 2, 5, 6, 7, 8, 9
# A1 A2 B1 B2 C1 C2 D1 D2


# Type B
#
# 0 1 2 3 4 5 6 7 8 9
# A1 D2 B1 A2 B1 B2 C1 C2 D1 D2
#
# 0, 3, 4, 5, 6, 7, 8, 9
# A1 A2 B1 B2 C1 C2 D1 D2


# Type C
#
# 0 1 2 3 4 5 6 7 8 9 10 11
# A1 xx A1 A2 B1 B2 C1 C2 D1 C2 xx D2
#
# 2, 3, 4, 5, 6, 7, 8, 11
# A1 A2 B1 B2 C1 C2 D1 D2


# Type D
#
# 0 1 2 3 4 5 6 7 8 9
# A1 A2 B1 B2 C1 C2 D1 C2 A1 D2
#
# 0, 1, 2, 3, 4, 5, 6, 9
# A1 A2 B1 B2 C1 C2 D1 D2


# Type E
#
# 0 1 2 3 4 5 6 7 8 9
# A1 A2 B1 B2 C1 B2 D1 C2 D1 D2
#
# 0, 1, 2, 3, 4, 7, 8, 9
# A1 A2 B1 B2 C1 C2 D1 D2


AviSource("video.avi")

AssumeFrameBased
SeparateFields

a = Weave(AssumeBFF(SelectEvery(10, 0,1, 2,5, 6,7, 8,9).Subtitle("Type A")))
b = Weave(AssumeBFF(SelectEvery(10, 0,3, 4,5, 6,7, 8,9).Subtitle("Type B")))
c = Weave(AssumeBFF(SelectEvery(10, 2,3, 4,5, 6,7, 8,11).Subtitle("Type C")))
d = Weave(AssumeBFF(SelectEvery(10, 0,1, 2,3, 4,5, 6,9).Subtitle("Type D")))
e = Weave(AssumeBFF(SelectEvery(10, 0,1, 2,3, 4,7, 8,9).Subtitle("Type E")))

ShowFiveVersions(a, b, c, d, e)

Now at first Type B looks good and is in synch with the video, performing a very good looking 3:2 pulldown, as seen here:

http://img.photobucket.com/albums/v16/yoitsmeremember/Doom9/img0.jpg

However, later in the video you start seeing interlaced frames on Type B, but a good looking pulldown on one of the other syncronizations, as can be seen here (NOTE: I couldn't find another frame where all but one of the types produced interlaced frames, but these two images were taken from frames that were VERY close to each other):

http://img.photobucket.com/albums/v16/yoitsmeremember/Doom9/img1.jpg
-AND-
http://img.photobucket.com/albums/v16/yoitsmeremember/Doom9/img2.jpg

Now Type D is the only successful pulldown.

It would appear that a "3:2 pulldown" isn't really what I need....or rather, that it won't suffice.

My guess is that the problem occures because after a 3:2 pulldown, the video is 23.976 FPS, and NOT 24 FPS. Could the slight difference have caused an extra interlaced or a dropped interlaced frame every now and then? And, if so, is there an easy way to correct such a problem (other than going through the video to manually find the extra/lost frame and decimating/adding it)?

EDIT: Removed BB IMG tags so text would fit on the page ;-)

tritical
24th August 2004, 06:10
Are you sure that the ivtc (pulldown) pattern is constant throughout the film? It seems to me your problem is occurring simply because the ivtc pattern is changing (since it works with one type at the beginning and then later on another type is correct). You would need to go through the entire film and identify all the pattern changes if you want to do the pulldown the way you currently are or by using

doubleweave()
pulldown()

which is much easier to use then separatefields().selectevery().weave() for this purpose IMHO, but they both accomplish the same thing. Of course, you could use an automatic ivtc filter and avoid the manual labor of identifying all the pulldown patterns.

k0r0n4
24th August 2004, 14:05
Originally posted by tritical
Are you sure that the ivtc (pulldown) pattern is constant throughout the film? It seems to me your problem is occurring simply because the ivtc pattern is changing (since it works with one type at the beginning and then later on another type is correct).

The pattern itself is the same, it's just the offset that's changing. I could of just used one pattern and then used Trim() to find the offset, but then I'd be loosing a frame or more.

Originally posted by tritical
You would need to go through the entire film and identify all the pattern changes if you want to do the pulldown the way you currently are or by using

doubleweave()
pulldown()

which is much easier to use then separatefields().selectevery().weave() for this purpose IMHO, but they both accomplish the same thing.
Unfortunately, the don't both accomplish the same thing. if you look at the field order (A1 A2 B1 A2 C1 B2 C1 C2 D1 D2) you'll notice that even with DoubleWeave() I would never get a B1 B2 frame, and thus the only way I could use double weave is by messing with the field order prior to using it. However, at that point you might as well just skip using the DoubleWeave completely and just grab the fields you need (which is what I did).

Originally posted by tritical
Of course, you could use an automatic ivtc filter and avoid the manual labor of identifying all the pulldown patterns.
I did try this, but even when I used Telecide and SmartDecimate (not at the same time, of course) I still found multiple interlaced frames that had snuck through. I would much rather do IVTC using AviSynth the manual way, to prevent *any* interlaced frames from getting by.

Thanks for the help, and I hope this makes my problem a little more clear :D .

EDIT: fixed a typo :devil:

Mug Funky
24th August 2004, 14:47
this wouldn't be a hybrid clip would it? maybe just in a couple of bits?

you could try Leak's Blendbob plugin... this will give a slight vertical blur, but you could easily throw in an equivalent sharpen filter and lose almost nothing.

a vob sample would be very useful here, but if it's just a lot of regular patterns stuck together in different order, a small vob chunk might not show much.

if worse comes to worse you could just encode interlaced and bob on playback :)

Leak
24th August 2004, 17:02
Originally posted by Mug Funky
you could try Leak's Blendbob plugin... this will give a slight vertical blur, but you could easily throw in an equivalent sharpen filter and lose almost nothing.

Well, he probably could - if it weren't for a partial power outage in the building my server is located in... (which would be the second one in less than a month... :()

In the meantime, you can get it here (http://debian.ssw.uni-linz.ac.at/~kp/AviSynth/BlendBob_1.2.zip).

np: Pole - Round Two (Pole)

tritical
24th August 2004, 17:05
Unfortunately, the don't both accomplish the same thing. if you look at the field order (A1 A2 B1 A2 C1 B2 C1 C2 D1 D2) you'll notice that even with DoubleWeave() I would never get a B1 B2 frame, and thus the only way I could use double weave is by messing with the field order prior to using it. However, at that point you might as well just skip using the DoubleWeave completely and just grab the fields you need (which is what I did).
You would have to adjust the field order correctly before using doubleweave() of course.

If you tried smartdecimate and telecide already and got interlaced frames on output it may be that like Mug Funky said you have a hybrid clip, there are orphaned fields in the stream, etc... Either way, you already know that no single pulldown pattern works for the entire stream... and your only option that I see if you want to do things manually is to adjust it for different sections. For manual ivtc in which the pattern changes, using tmpg to do the actual pattern identification/ivtc and then using the tprivtc filter in avisynth is probably the easiest method. Though you already said you didn't want to do this, so I would try Mug Funky's suggestions first :D.

k0r0n4
24th August 2004, 17:25
Originally posted by Mug Funky
this wouldn't be a hybrid clip would it? maybe just in a couple of bits?
Unlikely, the video was ripped directly from DVD using DVD Decrypter w/ stream processing (grabbing only the video) under demux mode so I don't have to deal with any VOB mapping. It was then converted to huffyuv so I could put it in an AVI container (I had the space and I've had problems with MPEG2Dec3 that I didn't want to bother with). Unless by hybrid you mean a pattern change, but wouldn't they keep the same pattern throughout the video?

Originally posted by Mug Funky
you could try Leak's Blendbob plugin... this will give a slight vertical blur, but you could easily throw in an equivalent sharpen filter and lose almost nothing.?
I'll try that, but unfortunately I'm not @ home right now, but I will try it as soon as I get back. I was hoping for a lossless IVTC but if it's this much trouble it probably isn't worth it.

Originally posted by Mug Funky
a vob sample would be very useful here, but if it's just a lot of regular patterns stuck together in different order, a small vob chunk might not show much.
I totally agree, however a vob sample (or rather, m2v, since I demuxed when ripping) would, as you said, need to be rather large. The clip I was working on was *relatively* large for my BW (100+ megs, I don't remember the exact number because I don't have it in front of me now), but if you're willing to take a serious look I'd gladly send the entire thing to you, although half of it would be sufficient to see the problem.

Originally posted by tritical
For manual ivtc in which the pattern changes, using tmpg to do the actual pattern identification/ivtc and then using the tprivtc filter in avisynth is probably the easiest method.
I'll try that in addition to Mug Funky's suggestion. Thanks!

P.S. - Thanks for the link Leak!

k0r0n4
25th August 2004, 00:23
Well, the Blendbob-Sharpen combo worked well enough, so I guess I'll stick with that.

Oh, and on a slightly off-topic note, I found out that the SmartSmoother filter for VirtualDub does a surprisingly good job at finding interlaced frames. Don't believe me? Look at the img here:

http://img.photobucket.com/albums/v16/yoitsmeremember/Doom9/img3.jpg

It's pretty obvious that all 4 of the darker images are caused by interlaced frames. Is there a way I could use this, comparing the darkness of all 5 different images, and select the right pulldown frame that way?