VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    I have a video clip that has a chat box and sometimes the chatbox has stuff in it that I don't want to make public. So all I want to do is black out this specific region in the entire clip. Samples can be viewed here. The chat box is in the bottom left corner.

    The first script I tried is using inpaint and is as follows
    Code:
    LoadCPlugin("C:\Program Files\AviSynth 2.5\plugins\AVSInpaint.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TomsMoComp.dll")
    Import("C:\Program Files\AviSynth 2.5\plugins\InpaintFunc.avs")
    
    DirectShowSource("First RoS Kill.avi",fps=29.97000002997,audio=false)
    SwapFields()
    
    InpaintFunc(last, mask="First RoS Kill Chat Mask.png",loc="BL",AR=16.0/9.0,mode="Inpaint", speed=10, ppmode=3, pp=75)
    
    ConvertToYV12()
    TomsMoComp(-1,5,1)
    The problem with this script is that it took 48 hours to encode a 9GB file and I don't need a pretty blur, just a black out. So I tried this script using subtract
    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TomsMoComp.dll")
    
    clip = DirectShowSource("First RoS Kill.avi", audio=false)
    clip = SwapFields(clip)
    clip = ConvertToRGB24(clip)
    
    maskclip = Imagesource("First RoS Kill Chat Mask.bmp", end = (clip.Framecount - 1), fps = clip.Framerate, use_DevIL = true)
    maskclip = AssumeFrameBased(maskclip)
    maskclip = ConvertToRGB24(maskclip)
    
    clip = Subtract(clip, maskclip)
    
    clip = ConvertToYV12(clip)
    
    TomsMoComp(clip,-1,5,1)
    The mask bmp is a single frame capture saved as png, opened in mspaint with the chat box changed to white and the rest of the image black. The preview from MeGUI looks like the chatbox is mostly blacked out but the rest of the image is washed out, like the brightness got turned way up. Also it is like the swapfields command didn't work. I haven't done a speed run on this yet but the image quality is pretty bad. I tried VirtualDub and the swapfields issue goes away but the brightness issue is still there.

    I see that most of the topics here are about removing logos from TV and this is kind of like it, but it just seems like my problem should be much easier to solve. Does anyone have any suggestions?

    More about what I am doing here
    Quote Quote  
  2. Create a black BMP using an Image Editor (or maybe a black video using BlankClip) of the desired resolution and Overlay or Layer it where you want. You may have to convert its colorspace, probably to YV12:

    http://avisynth.org/mediawiki/Overlay
    http://avisynth.org/mediawiki/Layer
    http://avisynth.org/mediawiki/BlankClip

    You tried with InPaint? If you have any more trouble let us know and I or someone else can steer you in the right direction.
    Quote Quote  
  3. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by sirsad
    The problem with this script is that it took 48 hours to encode a 9GB file and I don't need a pretty blur, just a black out.
    Well, despite that, I think Xlogo is suitable. See this guide: Remove an opaque logo using Xlogo in Avisynth

    It's also very fast.

    I couldn't download your sample files ("Invalid session"??? ) otherwise I would have given it a try.
    Quote Quote  
  4. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    I'm still not having much luck.

    Script for overlay
    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TomsMoComp.dll")
    
    clip = DirectShowSource("First RoS Kill.avi", audio=false)
    clip.SwapFields()
    
    overlayclip = BlankClip(length = clip.Framecount, width = 522, height = 168, pixel_type = "RGB24", fps = clip.Framerate, color = $000000)
    
    clip = Overlay(clip, overlayclip, x = 87, y = 737, mode = "Difference")
    
    clip = ConvertToYV12(clip)
    
    TomsMoComp(clip,-1,5,1)
    This makes the box gray and the words pinkish.

    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TomsMoComp.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\xlogo.dll")
    
    
    clip = DirectShowSource("First RoS Kill.avi", audio=false)
    clip.SwapFields()
    
    clip.xlogo("First RoS Kill Chat Mask _x_86_y_737_2.bmp", X = 86, Y = 737, alpha=0)
    
    clip = ConvertToYV12(clip)
    
    TomsMoComp(clip,-1,5,1)
    This doesn't appear to do anything at all in both meGUI and virtualdub.

    The wiki says
    This will display the difference between the clip and the overlay. Note that like Subtract a difference of zero is displayed as grey, but with luma=128 instead of 126. If you want the pure difference, use mode="Subtract" or add ColorYUV(off_y=-128).
    But I don't quite understand where to add ColorYUV call. I added a "clip.ColorYUV(off_y=-128)" before and after the xlogo call and that didn't do anything.

    I also get the "your download has failed. You have an invalid session set. Click here to try your downlaod again". Clicking there works through. Have you tried clicking "clicking here"? Note that those samples are already compressed using x264 (read full description on that site).
    Quote Quote  
  5. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    I think this script works for me, at least the preview does. Going to compress now!
    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TomsMoComp.dll")
    
    
    clip = DirectShowSource("First RoS Kill.avi", audio=false)
    clip.SwapFields()
    
    overlayclip = BlankClip(length = clip.Framecount, width = 522, height = 168, pixel_type = "RGB24", fps = clip.Framerate, color = $000000)
    
    clip = Overlay(clip, overlayclip, x = 87, y = 737, mode = "Blend", opacity = 1.0)
    
    clip = ConvertToYV12(clip)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!