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
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 subtractCode: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 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.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)
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
+ Reply to Thread
Results 1 to 5 of 5
-
-
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.
-
Originally Posted by sirsad
It's also very fast.
I couldn't download your sample files ("Invalid session"??? ) otherwise I would have given it a try. -
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)
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)
The wiki saysThis 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).
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). -
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)
Similar Threads
-
avs script giving me fits
By willmoodom in forum Newbie / General discussionsReplies: 32Last Post: 30th Sep 2009, 03:43 -
How do I create an AVS script
By Sopt Finder in forum Newbie / General discussionsReplies: 4Last Post: 15th Jun 2009, 13:17 -
AVS script and Subtitle Workshop
By sambat in forum SubtitleReplies: 3Last Post: 19th Apr 2009, 10:20 -
This correct avs script for this source?
By alcOre in forum Newbie / General discussionsReplies: 2Last Post: 13th Feb 2009, 01:24 -
help with avs script (dv to mpeg2) Fading in/out
By ZiGGY909 in forum EditingReplies: 2Last Post: 14th Nov 2007, 14:12