PDA

View Full Version : Conditional Filter and IsCombed()


Video Dude
15th September 2004, 21:00
I need some help in writing a conditional filter using IsCombed() from Decomb.

This is what I would like to do:


Telecide(order=0, post=0) # post processing disabled

FDecimate()

# Conditional Filter: If IsCombed() returns true,
then the detected interlaced frame is replaced by the previous frame



For example, if you look at a series of frames after using Telecide and FDecimate:

1p 2p 3p 4i 5p

After running the conditional filter, it would return:

1p 2p 3p 4p 5p with the 4th frame being a duplicate of the 3rd frame


A big thanks to anyone who can help.

scharfis_brain
15th September 2004, 21:06
hehe, look at this: http://forum.doom9.org/showthread.php?s=&threadid=82264

this will turn your 29.97 or 25 fps video into a comb-free high quality video of 59.94 or 50 fps.
(it matches the fields like telecide, but interlaced frames are detected using iscombed() and then correectly deinterlaced)

after matchbob() you can apply fdecimate()

so, your script may look as easy as this:


avisource("blah.avi")
matchbob()
fdecimate(rate=23.976)

Video Dude
16th September 2004, 05:31
Thanks for the link.

Just for the heck of it, I would like to get my script to work.

I did some more work on it. The following script will run without error messages. But this is my first attempt at a Conditional Filter, and I'm not sure if the syntax and parameters are correct. Could someone who is experienced with Conditional Filters verify that it does what I intended to do. Many thanks.



vid = AviSource("C:\video.avi").Telecide(order=0, post=0).FDecimate()

replace = ScriptClip(vid, "FreezeFrame(current_frame, current_frame, current_frame - 1)")

final = ConditionalFilter(vid, replace, vid, "IsCombed(vid, threshold=20)", "=", "true", show=false)

return final

scharfis_brain
16th September 2004, 05:53
this one is easier & should work theorethically:


vid = AviSource("C:\video.avi").Telecide(order=0, post=0).FDecimate()

replace = vid.deleteframe(0) #or duplicateframe(0)

ConditionalFilter(vid, replace, vid, "IsCombed(10)", "==", "true", show=false)


*advertise mode on*
but for near to perfect smooth results, you should go for matchbob & fdecimate.
*advertise mode off*

Video Dude
16th September 2004, 06:01
Thanks for the script.

I tried matchbob and it seems to produce great results.

I realize my script will produce jerky motion most, if not all of the time the conditional filter evaluates to true. But the main reason I wrote it was to learn how to use the conditional filter. Since I seem to do IVTC all of the time I thought it was a good script to work on to learn the syntax and parameters.