View Full Version : Logo Removal with Avisynth 2.5
nicksteel
30th November 2003, 14:55
Is there any way to execute logo removal (xlogo, delogo, etc) without reencoding? For example, I capture TV at 720x480 YV12 with PVR250 capture board and normally process with avs script into TMPGEnc utilizing KVCD templates.
My exact methods are:
Capture at 720x480 as MPEG1 12.0MBit/sec (CBR)
Make D2V with DVD2AVI
Create Trim statements with VirtualDub-MPEG
Create avs script with filters
Process avs with TMPGEnc using KVCD templates
Muxing with BBMPEG as either VCD or SVCD
It would seem avantageous to not do any additional conversions (RGB, YUY2, etc for quality) and to work with the final MPEG file for size.
The logo removal filters all seem to require conversion into AVI files (using Vdub) or RGB, YUY2, etc using AviSynth. Also, the logo removal process seems to take a lot of time (25 hours for 90 minute clip).
Is there any method for encoding, then reprocessing (without reencoding) for logo removal. It would seem that the process would be simpler if you were working with the final MPEG, which would be already reformated, telecined, decimated, etc.
Please excuse my obvious ignorance concerning the process.
ppera2
30th November 2003, 15:52
You must reencode for practically any change of video. No way to change part of pic without reencoding.
But it stays not that you need intermediate AVI file for logo removal.
All can be done with AVIsynth. I recommend you DeKafka logo remover. It's AVIsynth script, and works much faster than logo removal plugins.
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
}
Call it with: clip=clip.dekafka(masklogo,564,26,122,82,255)
For more details search forum. You need to prepare some bitmap mask.
It converts to RGB, but is still pretty fast.
nicksteel
30th November 2003, 16:38
Originally posted by ppera2
You must reencode for practically any change of video. No way to change part of pic without reencoding.
But it stays not that you need intermediate AVI file for logo removal.
All can be done with AVIsynth. I recommend you DeKafka logo remover. It's AVIsynth script, and works much faster than logo removal plugins.
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
}
Call it with: clip=clip.dekafka(masklogo,564,26,122,82,255)
For more details search forum. You need to prepare some bitmap mask.
It converts to RGB, but is still pretty fast.
How do I handle AviSynth 2.53 filters that require YV12 when using this?
ppera2
30th November 2003, 16:52
Originally posted by nicksteel
How do I handle AviSynth 2.53 filters that require YV12 when using this?
You must perform all filtering before DeKafka anyway.
nicksteel
3rd December 2003, 23:20
Has anyone dealt with a disney channel logo (big mouse ears) in the bottom left corner of the screen? The logo runs to the very bottom.:confused:
ronnylov
22nd December 2003, 17:23
Originally posted by nicksteel
Has anyone dealt with a disney channel logo (big mouse ears) in the bottom left corner of the screen? The logo runs to the very bottom.:confused:
And now it's also snowing inside the logo...
Is ist possible to remove an animated logo?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.