Log in

View Full Version : Plugin to get progressive frames from video with a varying pulldown pattern


yukichigai
16th August 2007, 10:52
I know this exists, mostly because I know how to do it (in principal). I just need to know what the damn thing is called.

Okay, let's say you have some interlaced video that you know uses pulldown flags/fields irregularly. (Family Guy, or any cartoon episodes, would be a good example) Rather than trying to find some common, lower-than-29.97-framerate for the video, I'm looking for something that will figure out what even fields match up with what odd fields (or are duplicates of previous/coming even fields) and use the corresponding odd fields (and vice versa of all of that jazz) to create solid 59.94p video. (Or to simplify, recreate the original, whatever-fps-converted-to-59.94fps progressive frames from existing fields)

Like I said, I know it has to exist out there somewhere because I have a fairly good idea how to do it in my head. (Basically, separate the fields into frames, bob the current frame, then compare that with both the weave of the previous frame with the current frame and the weave of the current frame with the next frame. Whichever is a closer match, that's your winner) I realize it would screw up if neither combination of fields created a progressive frame, but I'm not asking for perfection here. :P

So, anyway, who knows where I can find this. (And failing that, anybody willing to whip up a plugin to do the above mentioned procedure real quick?)

Leak
16th August 2007, 11:51
So, anyway, who knows where I can find this. (And failing that, anybody willing to whip up a plugin to do the above mentioned procedure real quick?)
Well, my BlendBob filter (http://leak.no-ip.org/AviSynth/BlendBob/) almost does this, except it blends the current bobbed frame with the "better" neighbouring frame instead of weaving them - but you might want to give it a try anyway... :)

Here's the thread for it (http://forum.doom9.org/showthread.php?t=80289), you might be able to tweak the AviSynth script of similar function that I linked to to actually weave the matching frames.

Didée
16th August 2007, 11:57
Not cocksure about possible pitfalls, but what about

DoubleWeave().AssumeBFF().TFM(...)

?

yukichigai
18th August 2007, 06:30
Well, my BlendBob filter (http://leak.no-ip.org/AviSynth/BlendBob/) almost does this, except it blends the current bobbed frame with the "better" neighbouring frame instead of weaving them - but you might want to give it a try anyway... :)

Here's the thread for it (http://forum.doom9.org/showthread.php?t=80289), you might be able to tweak the AviSynth script of similar function that I linked to to actually weave the matching frames.It KINDA does that, except that it's doing the opposite of what I want in terms of framerate, i.e. it halves the framerate, rather than doubling it. I don't think there's any way I can use it for what I had in mind. (Though I can think of several other videos it would be useful for, hence why it's in my plugins folder right now. :P)

yukichigai
18th August 2007, 06:31
Not cocksure about possible pitfalls, but what about

DoubleWeave().AssumeBFF().TFM(...)

?It might help if I knew what TFM was. :P

TheRyuu
18th August 2007, 06:50
It might help if I knew what TFM was. :P

http://bengal.missouri.edu/~kes25c/#c1

Part of TIVTC. It's a plugin with 5 different filters in it.
Very useful for IVTC.

There is a document on it here:
http://avisynth.org.ru/docs/english/externalfilters/tivtc.htm

I use it like this (to recover 23.94fps progressive frames):
movie = mpeg2source(sample.d2v, info=3)
assumebff(movie) #use proper bff/tff here
movie = tfm(movie,d2v=sample.d2v).tdecimate()
movie = ColorMatrix(movie,mode="Rec.709->Rec.601",hints=true,threads=0)
last = movie

yukichigai
18th August 2007, 07:09
http://bengal.missouri.edu/~kes25c/#c1

Part of TIVTC. It's a plugin with 5 different filters in it.
Very useful for IVTC.

There is a document on it here:
http://avisynth.org.ru/docs/english/externalfilters/tivtc.htm

I use it like this (to recover 23.94fps progressive frames):
movie = mpeg2source(sample.d2v, info=3)
assumebff(movie) #use proper bff/tff here
movie = tfm(movie,d2v=sample.d2v).tdecimate()
movie = ColorMatrix(movie,mode="Rec.709->Rec.601",hints=true,threads=0)
last = movie

That's exactly what I was looking for. Thanks.

EDIT: After using it on a test clip I realized that for it to work properly in all cases (e.g. strange pulldown patterns and honest-to-god 59.94/50 fps material) you need to leave out AssumeBFF() after the DoubleWeave(). That way TFM will use avisynth's internal field dominance parity bit, which alternates each frame when you do a DoubleWeave(), and will give you properly motion-interpolated screens/etc.

ChiDragon
18th August 2007, 07:21
yukichigai, TDeint(1,tryweave=true,MI=256) should be what you want. With MI set at 256 (default blockx * default blocky = 16*16) all frames should be weaved. You can leave MI out to use the default interpolate/weave switching or tweak it however you want..