hello i tried to understand how to use this script to hide the logo of a tv channel i tried to understand i can't do it
https://forum.doom9.org/showthread.php?t=176860&page=10
+ Reply to Thread
Results 1 to 30 of 40
-
-
Maybe show us the script you're trying and any error messages, together with a short video from your source. I use that filter regularly.
What you linked is a different use for the filter, for extracting hardcoded subs. -
I admit that I didn't even understand how it works
[Attachment 61436 - Click to enlarge]Last edited by JAX75; 25th Oct 2021 at 02:54.
-
You don't have to understand how the script works to upload it to the forum for people to see it.
-
i'm doing something wrong i think
DirectShowSource("C:\Users\jax\Videos\prt18.mp4")
InpaintDelogo( Automask=1, aMix=0, Loc="100,100,-100,-100",Mode="Deblend",Analyze=1, FrB=0, FrW=0, FrS=0)Last edited by JAX75; 25th Oct 2021 at 12:15.
-
Best would be asking at a place where a dev of a tool resides. I arrived here accidentally from google...
This error is an error from your own script (which you didn't shared). I guess that you need to read about basic syntax of AviSynth.
There is no "x" in here, so it's not the same script where you got that error.
It looks like random copy/paste from examples, it can't work and reasons why - you can read in the error messages.
You can read the help about parameters inside InpaintDelogo.avsi (it's just a text file, you can open it with any text reader).
That kind of logo like in your video sample should go away without a trace. -
I've never had any luck using Deblend mode. Maybe VoodooFX (the developer. Nice to see you here!) can provide a better script. This is what I used:
LWlibavVideoSource("Iv.mkv")
#######################use traditional crop and add 10 pixels on all sides########
InpaintDelogo(mask="D:\Test Files\Logo.bmp",
\ Automask=0, aMix=0, Loc="1694,60,-110,-948",
\ Mode="Inpaint",
\ Analyze=1, Fr1=0, Fr2=0, FrS=0)
First I made a mask ("D:\Test Files\Logo.bmp") provided below. Then I encoded the video (also provided below). Getting rid of the other round logo would be similar. -
Yes, I did something similar, just enough to get it working.
To create the mask I used this, using frames 1 and 146 for a dark and bright area surrounding the logo:
Code:InpaintDelogo(Loc="1690,58,-104,-944",Automask=1,Analyze=3,FrB=1,FrW=146,aMix=-3,mask="i:\mask6.bmp")
Code:inpaintdelogo(mask="i:\mask6.bmp",Loc="1690,58,-104,-944")
-
Hi manono, I can count on my two fingers how many times I didn't had 'luck' with Deblend.
Your InpaintDelogo version is very outdated, there is no Fr1 & Fr2 parameters anymore.
"Fr1=0, Fr2=0, FrS=0" <- They don't do anything in your script.
Your script can be reduced to: InpaintDelogo( mask="D:\Test Files\Logo.bmp", Loc="1694,60,-110,-948" )
Your shared "Logo.bmp" is not a mask, did you mixed up files?
=================================================
OK, let's start. You can remove 80% of these logos without any plugin:
Code:LWLibavVideoSource("D:\Iv.mkv") Crop(156,0,-186,-0) AddBorders(156,0,186,0)
To do 'Deblend' you need to get good alpha/color masks, in this short sample I don't see qood dark/bright frames to analyze, full video or better samples are needed.
Anyway we can use something for example. [ @JAX75 Those below Deblend settings are not good! ]
Mask and one output frame are in the attachments. [127th frame, selected frame where inpaint artifact is visible.]
Code:c=LWLibavVideoSource("D:\Iv.mkv").crop(156,0,-186,-0) out1=c.InpaintDelogo(mask="D:\Mask2.bmp", Loc="1538,60,-0,-948") out2=c.InpaintDelogo(mask="D:\Mask2.bmp", Loc="1538,60,-0,-948", Mode="Deblend", dPP=5, Analyze=4, FrW=54, FrS=2) Stackvertical( \ c.crop(1400,40,-0,-928).AddBorders(0,2,0,0,$F0F080).Subtitle("Original"), \ out1.crop(1400,40,-0,-928).AddBorders(0,2,0,0,$F0F080).Subtitle("Inpaint"), \ out2.crop(1400,40,-0,-928).AddBorders(0,2,0,0,$F0F080).Subtitle("Deblend"))
Last edited by VoodooFX; 26th Oct 2021 at 01:56.
-
hello thank you for your help I admit that I am lost with the avs script
so the solution is to create a Mask ? -
-
-
I originally made a mask with the logo painted white, but got better results keeping the logo 'natural'. And thank you for pointing out it's time to update my version of your fine filter.
And I completely forgot about cropping away the black (followed by adding it back if wanted) to completely remove the circle logo and much of the other one. Stupid! -
You create a mask by saving out a frame from the video and editing it in a photo program. PhotoFiltre is a free and very good one, if you don't already have one. The crop numbers can be acquired in several ways. One is to open the video in VDub2 and use its crop filter to get your logo location.
-
Did you read the manual? First sentence there: "This function will help you to determine "Loc" values...".
InpaintLoc() is like Crop() [and u can use Crop() too to determine the logo coordinates], "100,100,-100,-100" are "Left,Top,-Right,-Bottom" in pixels, "0,0,-0,-0" doesn't crop anything. Change some numbers and look at video what is going on.
About AviSynth's internal functions you can read on AviSynth website, for example: http://avisynth.nl/index.php/Crop
I use PhotoShop to do mask, sometimes "Automask=1" parameter. About every parameter you can find out in the manual.
Ha, how good I'm at predictions, my random picked conversion to mask is better than user's work on the logo mask, yes, your 'natural' image is internally converted to the God knows what mask. And you say that you don't have luck.
Should I add error on such 'natural' masks!? -
-
InpaintDelogo can remove some dynamic logos, but here is no point as you have whole advertisement here and it's more complicated than static logos.
So you don't want those frames to be processed with InpaintDelogo here.
You can isolate frames from processing with Trim() - http://avisynth.nl/index.php/Trim .
Let's assume you have one ad in video that starts at frame 121 and ends at frame 254.
Trim() use example:
c=LWLibavVideoSource("D:\clip.mkv")
# Split video:
t1=c.Trim(0, 120).InpaintDelogo()
t2=c.Trim(121, 254)
t3=c.Trim(255, 820).InpaintDelogo()
# Then join video back:
t1+t2+t3Last edited by VoodooFX; 26th Oct 2021 at 04:11.
-
-
-
Now I see what you meant.
Mask looks good. You see result of the base mask creation, not the delogo results. The top image is mask, the bottom image is from what it was created.
Now you need to turn off Automask=0 to proceed setting for delogo.
Wasn't that clear from the manual? :
# Int "Automask" :
# 0 - Off (default).
# 1 - On. Generates the base mask. Script doesn't do anything else when "On"!
You can right click on AvsPmod' video preview and press "Save image as...". Script is better to share as text [do Copy/Paste].Last edited by VoodooFX; 27th Oct 2021 at 04:52.
-
Code:
LWLibavVideoSource("G:\part1.mkv") Crop(32, 4, -14, -12) InpaintDelogo( mask="G:\Mask2.bmp", \ Automask=0, aMix=0,Loc="1120,6,-2,-978", \ Mode="inpaint", \ Analyze=4, FrB=0, FrW=0, FrS=0)
[Attachment 61473 - Click to enlarge] -
Mask is not covering whole logo, see dark edges around, you can try inflate the base mask a bit with "Inflate=2".
Probably that won't be enough and you would need to create a fatter base mask with higher aMix setting. -
Btw, you can use Show=1 to show more steps of what is going on.
Create a fatter base mask, then use "Inflate=2" and "Show=1" for delogo, then post a screen of what you get.