Log in

View Full Version : automated framedrop filler script :)


Mug Funky
19th December 2005, 11:16
yo, i just got a clip that i was meant to put a slowmo on (using clouded's script), and found that it was full of dropped frames which were b0rking the motion-interpolation.

so i wrote a little function to replace all frames that are identical to the previous one with a motion-interpolation of the adjacent frames. it could be useful for captures that you can't get again, but are full of drops (this one's got heaps... i odn't know what happened there).


function filldrops (clip c)
{
vf=c.mvanalyse(truemotion=true,pel=2,isb=false,delta=1,idx=1)
vb=c.mvanalyse(truemotion=true,pel=2,isb=true,delta=1,idx=1)
global filldrops_d = c.mvflowinter(vb,vf,time=50,idx=1)
global filldrops_c = c
c.scriptclip("""ydifferencefromprevious()==0? filldrops_d : filldrops_c""")

}

usage:

xxxsource("blah.xxx")

filldrops()


currently it doesn't support interlaced frames (though that would be quite handy, and very do-able, but i don't care enough right now).

hope someone finds a use for this :)

[edit]

oh, forgot to say (but it's kinda important...) that this requires fizick's latest version of manao's MVtools. you can get it from http://bag.hotmail.ru

[edit 2]

thanks Didée, i just put your changes in.

Didée
19th December 2005, 11:43
Why took it one year and a half to make this appear? :D

BTW, those not equipped with that much memory might add
[...]
vf=c.mvanalyse(truemotion=true,pel=2,isb=false,delta=1, idx=1)
vb=c.mvanalyse(truemotion=true,pel=2,isb=true,delta=1, idx=1)
global filldrops_d = c.mvflowinter(vb,vf,time=50, idx=1)
[...] to reduce memory usage, and gain speed as well.

In case other MVTools-based operations are running in the same script, eventually use another positive number for idx ... it must be unique for each instance where MVTools are working on a given instance of input.
In this case here, without specifying "idx", MVTools would interpolate the input stream three times, and would buffer all three interpolations as well ... but they're all the same.

Mug Funky
19th December 2005, 13:52
thanks for the tip :) i've been getting increasingly lazy in my scripts lately, and tend to just fall back on presets for everything.

so long as it works in concept :p