VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 40
Thread
  1. 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
    Quote Quote  
  2. 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.
    Quote Quote  
  3. I admit that I didn't even understand how it works
    Image
    [Attachment 61436 - Click to enlarge]
    Image Attached Files
    Last edited by JAX75; 25th Oct 2021 at 02:54.
    Quote Quote  
  4. How is anyone going to help you without seeing your script?
    Quote Quote  
  5. I didn't even understand how it works
    Quote Quote  
  6. You don't have to understand how the script works to upload it to the forum for people to see it.
    Quote Quote  
  7. 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.
    Quote Quote  
  8. That's your entire script?
    Quote Quote  
  9. I updated my comment
    Quote Quote  
  10. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Best would be asking at a place where a dev of a tool resides. I arrived here accidentally from google...

    Originally Posted by JAX75 View Post
    I admit that I didn't even understand how it works
    Image
    [Attachment 61436 - Click to enlarge]
    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.

    Originally Posted by JAX75 View Post
    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)
    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.
    Quote Quote  
  11. 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.
    Image Attached Thumbnails Click image for larger version

Name:	Logo.bmp
Views:	151
Size:	5.93 MB
ID:	61443  

    Image Attached Files
    Quote Quote  
  12. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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")
    Then once the mask was created I used this and got a a default removal, which looked pretty good as-is
    Code:
    inpaintdelogo(mask="i:\mask6.bmp",Loc="1690,58,-104,-944")
    There's tons of doc on the parameters, but not really a quick and dirty example(s) on how to get going with this filter
    Quote Quote  
  13. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by manono View Post
    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.
    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)
    Black borders shouldn't be present in the 'Loc' area.
    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"))
    After delogo you can add those borders back if you want - AddBorders(156,0,186,0), plus you can safely downscale it with Spline16Resize(1024, 576) as video is actually upscaled from SD.
    Image Attached Thumbnails Click image for larger version

Name:	Mask2.bmp
Views:	166
Size:	4.88 MB
ID:	61452  

    Image Attached Images  
    Last edited by VoodooFX; 26th Oct 2021 at 01:56.
    Quote Quote  
  14. hello thank you for your help I admit that I am lost with the avs script
    so the solution is to create a Mask ?
    Quote Quote  
  15. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JAX75 View Post
    so the solution is to create a Mask ?
    Solution to what? Mask is already attached in my previous post.
    Quote Quote  
  16. Originally Posted by VoodooFX View Post
    Originally Posted by JAX75 View Post
    so the solution is to create a Mask ?
    Solution to what? Mask is already attached in my previous post.
    I would like to understand how we make the mask and how to calculate the location of the logo
    Quote Quote  
  17. Originally Posted by VoodooFX View Post
    Your shared "Logo.bmp" is not a mask, did you mixed up files?
    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!
    Quote Quote  
  18. Originally Posted by JAX75 View Post
    I would like to understand how we make the mask and how to calculate the location of the logo
    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.
    Quote Quote  
  19. Originally Posted by manono View Post
    Originally Posted by JAX75 View Post
    I would like to understand how we make the mask and how to calculate the location of the logo
    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.
    thanks i will try
    Quote Quote  
  20. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JAX75 View Post
    I would like to understand how we make the mask and how to calculate the location of the logo
    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.

    Originally Posted by manono View Post
    I originally made a mask with the logo painted white, but got better results keeping the logo 'natural'.
    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!?
    Quote Quote  
  21. Originally Posted by VoodooFX View Post
    Originally Posted by JAX75 View Post
    I would like to understand how we make the mask and how to calculate the location of the logo
    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.
    ok just a little problem the logo moves for announcements how to hide the whole image ?
    Image Attached Files
    Quote Quote  
  22. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JAX75 View Post
    ok just a little problem the logo moves for announcements how to hide the whole image ?
    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+t3
    Last edited by VoodooFX; 26th Oct 2021 at 04:11.
    Quote Quote  
  23. Originally Posted by VoodooFX View Post
    Originally Posted by JAX75 View Post
    I would like to understand how we make the mask and how to calculate the location of the logo
    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.
    I tried Automask = 1 weird I get results where the logo has not completely disappeared
    Quote Quote  
  24. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JAX75 View Post
    I tried Automask = 1 weird I get results where the logo has not completely disappeared
    If you ask for something then post your whole script, there is hundred parameters, and we are not the fortune tellers.
    "Automask=1" parameter just enables the basemask creation effect, it alone doesn't control effect in any way.
    Quote Quote  
  25. Originally Posted by VoodooFX View Post
    Originally Posted by JAX75 View Post
    I tried Automask = 1 weird I get results where the logo has not completely disappeared
    If you ask for something then post your whole script, there is hundred parameters, and we are not the fortune tellers.
    "Automask=1" parameter just enables the basemask creation effect, it alone doesn't control effect in any way.
    Hello

    Quote Quote  
  26. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JAX75 View Post
    I tried Automask = 1 weird I get results where the logo has not completely disappeared
    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"!
    PS:
    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.
    Quote Quote  
  27. Originally Posted by VoodooFX View Post
    Originally Posted by JAX75 View Post
    I tried Automask = 1 weird I get results where the logo has not completely disappeared
    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"!
    PS:
    You can right click on AvsPmod' video preview and press "Save image as...". Script is better to share as text [do Copy/Paste].
    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)
    Image
    [Attachment 61473 - Click to enlarge]
    Quote Quote  
  28. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    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.
    Quote Quote  
  29. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    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.
    Quote Quote  
  30. Originally Posted by VoodooFX View Post
    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.
    I must have made a error in loc the logo
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!