» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Learn to script
»Discussion fora
»Project page
»External filters

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth




As outlined at [my own wiki], this fairly simple filter washes away those annoying bugs from broadcast clips.

Note this "new and improved" version works seamlessly (literally) with any format, but there will be a RGB32 conversion.

function dekafka(clip clip, clip maskclip, int Xstart, int Ystart, int X,
  \ int Y, int Amount)
ytop = Ystart
ybot = Ystart + Y
xleft = Xstart
xright = Xstart + X
clip = clip.ConvertToRGB32
maskclip = maskclip.ConvertToRGB32
topline = clip.Crop(Xstart-2, ytop-2, X, 2)
bottomline = clip.Crop(Xstart-2, ybot, X, 2)
leftline = clip.Crop(xleft-2, ytop-2, 2, Y)
rightline = clip.Crop(xright, ytop-2, 2, Y)
logosrc_hor = StackVertical(topline, bottomline).Blur(1.58, 0).BilinearResize(X, Y)
logosrc_ver = StackHorizontal(leftline, rightline).Blur(1.58, 0).BilinearResize(X, Y)
Amount2 = (Y>=2*X) ? 255 : 128*Y/X
# Amount2 is small if X >> Y => logoscr_hor is dominant
logosrc = Layer(logosrc_hor, logosrc_ver, "add", Amount2)
masklogo = maskclip.BilinearResize(X, Y)
logo = logosrc.Mask(masklogo)
clip = clip.Layer(logo, "add", Amount, Xstart, Ystart)
return clip

You must provide both a source and a mask. if you don't care about a mask I suppose you can change the code, but why would you want to replace an ugly logo with an even more ugly blurred box? ;)


Guaranteed to be the fastest de-logoizer in the county!

Back to ShareFunctions.

SourceForge Logo


Edit this document | View document history
Document last modified Wed, 19 Jan 2005 06:53:16