View Full Version : Removing scrolling text on captured video
TJeR
8th January 2006, 12:28
Hello all.
I'am looking for a way to remve a scrolling text from a captured video, I did some research, but couldn't find anything usefull, some suggestion? with avisynth? or why not, with VirtualDub?
regards
Morpheus_xx
8th January 2006, 19:38
I usually remove such scrolling text at bottom of the video by cropping and adding black borders (via Avisynth) like this:
function BannerWeg(clip clip)
{
clip=clip.Crop(0,0,720,426).AddBorders(0,0,0,150)
return clip
}
And if it occures only sometimes, I use Trim:
Trim(0,1000)+BannerWeg(Trim(1001,1200))+....
Maybe not the best solution, but I like a black border for some seconds more than a scrolling text....
TJeR
23rd January 2006, 20:44
Many thanks for your suggestion, Anyway I found a different way of removing this annoiance, and IMHO it is worth a post.
It use the dekafka function to remove the text and the video itself to generate a mask. I tried it and found the results quite good.
r=trim(clip,141365,141570) #portion of the video to be cleaned
maskclip = r
maskclip=ConvertToYUY2(maskclip) #this is mandatory because tweak() works in YUY2 color space.
maskclip= crop(maskclip,4,480,584,36) #select the area where the scrolling text is located, cropping at lest 4 lines from the left bordere is mandatory or dekafka will complainm
maskclip=greyscale(maskclip)
maskclip=tweak(maskclip,bright=0, cont=40) # the last two lines generate a "black" and "white" mask (requested by dekafka),
r=dekafka(r,maskclip,4, 480, maskclip.width, maskclip.height, 256) #dekafka function the removes the scrolling text using the video itself as a mask.
this can be applied as many time you want inside your script, it may generates some artifacts because the mask it is not truely black and white.
Anyway this is my first attempt at making a script in avisynth and any suggestion is really welcome, also I would like to create an *.avsi to easily call it in other script.
regards to all
Morpheus_xx
24th January 2006, 18:30
cool...
looks very very interesting! thank you for the script, I try to modify it for my needs.
If you like it as function try this:
function RemoveScroll(clip r, int offsetLeft, int offsetTop, int width, int height) {
maskclip=r
maskclip=ConvertToYUY2(maskclip) #this is mandatory because tweak() works in YUY2 color space.
maskclip= crop(maskclip,offsetLeft,offsetTop,width,height) #select the area where the scrolling text is located, cropping at lest 4 lines from the left bordere is mandatory or dekafka will complainm
maskclip=greyscale(maskclip)
maskclip=tweak(maskclip,bright=0, cont=40) # the last two lines generate a "black" and "white" mask (requested by dekafka),
r=dekafka(r,maskclip,offsetLeft, offsetTop, maskclip.width, maskclip.height, 256) #dekafka function the removes the scrolling text using the video itself as a mask.
return r.ConvertToYV12()
}
and you can call it like this:
ApplyRange(2898, 3623, "RemoveScroll", 2,20,710,80)
I've added parameters for position and size, and I converted the clip back to YV12 (my source format).
So thank you once more :)
Morpheus_xx
26th January 2006, 17:51
I think it could be interesting for others to see the result of that filter.
I used 2 different boxes to filter the advertisement:
# Typ 1: Handy mit Laufschrift
top=414
ApplyRange(51770,52506, "RemoveScroll", 140,top+58,570,40)
ApplyRange(51770,52506, "RemoveScroll", 30, top+36,220,90)
foxyshadis
27th January 2006, 02:43
How does it look in motion? Is it stable, or jumpy? Is it really horribly blurry in higher-detail areas? I simply have no sources to test it on currently, although if it could work as a delogo as well that would be exceptionally useful. Color me interested.
If I get something that requires it I'm sure I'll take it apart and see what I can do with it. Dekafka is definitely something I need to investigate.
Wilbert
27th January 2006, 10:43
@foxyshadis,
There seems to be a bug in dekafka: http://forum.doom9.org/showthread.php?t=94788&highlight=dekafka
I still have to look at it one day. See also http://forum.doom9.org/showthread.php?t=94711&highlight=dekafka for a corrected version.
I guess you can also try xlogo and compare the results.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.