Log in

View Full Version : Simulate, how video might look on TV: Scanlines


scharfis_brain
6th March 2004, 20:29
function TVdeint(clip clip, float kell)
{
clip=clip.addborders(0,4,0,4)
input=clip.converttoyuy2().separatefields()
blank=blankclip(selecteven(input))
even=interleave(selecteven(input),blank).weave()
odd =interleave(selectodd(input) ,blank).weave()
output=interleave(even,odd)
kell = (kell < 0 ) || (kell > 1) ? 0 : kell
(kell == 0) ? output : output.blur(0,kell).levels(0,1,255-int(128*kell),0,255)
crop(0,4,0,-4)
}

this thing separates the video into its fields,
and then fills them up with every other line black.
This gives the typical scanline-look

kell is the amout of vertical blur that is introduced
after scanlining to simulate some kind of unfocus.

kell=1 is very close to a simple bob
kell=0 gives the untouched scanine-look
every value between 0 and 1 varies the amount of blur.
values greater 1 or smaller zero are doing the same like kell=0

bb
8th March 2004, 10:52
I assume this interesting script is intended for previewing purposes, not for encoding, right?

bb

Backwoods
8th March 2004, 18:55
Can this be used to simulate scanlines for a video effect rather than a preview?

As in, increase the amount of scanlines or thickness.

mf
8th March 2004, 19:00
Originally posted by bb
I assume this interesting script is intended for previewing purposes, not for encoding, right?

bb
Or maybe it's just like my DotCrawl (http://forum.doom9.org/showthread.php?s=&threadid=69472) and Blink (http://forum.doom9.org/showthread.php?s=&threadid=69806#post436220) filters. :)

scharfis_brain
8th March 2004, 19:26
If you want to abuse this thing as scanline-creator for TV, do the following:


avisource("interlacedvideo.avi")
yourbobber()
verticalreduceby2()
separatefields().selectevery(4,1,2).weave()
tvdeint(0.3)
bicubicresize(last.width,last.height*2)
separatefields().selectevery(4,1,2).weave()


(this is a completely untested, mind dumped script)

btw. it is useless like mf's other creations he mentioned