VideoHelp Forum


Try StreamFab All-in-One and rip Netflix video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 49 of 49
Thread
  1. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    OK. I'll see what I can do.
    @jagabo managed to do something?
    Quote Quote  
  2. Originally Posted by kelvin View Post
    Originally Posted by jagabo View Post
    OK. I'll see what I can do.
    @jagabo managed to do something?
    Oops, sorry. I was busy and forgot about this. Here's what I came up with.

    Code:
    LWLibavVideoSource("teste.mkv", cache=false, prefer_hw=2) 
    
    Y = GreyScale()
    U = UtoY()
    V = VtoY()
    
    # if you want to see the channels enable the next line
    #return(StackHorizontal(Y.Subtitle("Y"), StackVertical(U.Subtitle("U"), V.Subtitle("V"))))
    
    U = U.TurnRight()
    U = U.defreq(fx=7.5, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=15.0, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=22.5, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=30.0, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.TurnLeft()
    
    # spacial only filtering on vertical axis to reduce remaining horizontal stripes
    #Y = Y.TNLMeans(Ax=0, Ay=20, h=8, rm=1) # if you want to filter Y too
    U = U.TNLMeans(Ax=0, Ay=10, h=6, rm=1)
    V = V.TNLMeans(Ax=0, Ay=6, h=6, rm=1)
    
    YtoUV(U, V, Y)
    The banding isn't as bad but some of the wider ones are still slightly visible.
    Image Attached Files
    Quote Quote  
  3. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by kelvin View Post
    Originally Posted by jagabo View Post
    OK. I'll see what I can do.
    @jagabo managed to do something?
    Oops, sorry. I was busy and forgot about this. Here's what I came up with.

    Code:
    LWLibavVideoSource("teste.mkv", cache=false, prefer_hw=2) 
    
    Y = GreyScale()
    U = UtoY()
    V = VtoY()
    
    # if you want to see the channels enable the next line
    #return(StackHorizontal(Y.Subtitle("Y"), StackVertical(U.Subtitle("U"), V.Subtitle("V"))))
    
    U = U.TurnRight()
    U = U.defreq(fx=7.5, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=15.0, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=22.5, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.defreq(fx=30.0, fy=0.0, dx=3.0, dy=2.0, info=false, show=0)
    U = U.TurnLeft()
    
    # spacial only filtering on vertical axis to reduce remaining horizontal stripes
    #Y = Y.TNLMeans(Ax=0, Ay=20, h=8, rm=1) # if you want to filter Y too
    U = U.TNLMeans(Ax=0, Ay=10, h=6, rm=1)
    V = V.TNLMeans(Ax=0, Ay=6, h=6, rm=1)
    
    YtoUV(U, V, Y)
    The banding isn't as bad but some of the wider ones are still slightly visible.
    Thanks. No need to apologize. I apologize to you. The image has improved a lot. How do I use this code in the episodes I have here? I'm a newbie.
    Quote Quote  
  4. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Image
    [Attachment 58326 - Click to enlarge]

    In the case of these risks that appear throughout the video. Give to remove them? Is there a code to take?
    Quote Quote  
  5. Originally Posted by kelvin View Post
    How do I use this code in the episodes I have here? I'm a newbie.
    I see you started a new thread about this. I replied there. https://forum.videohelp.com/threads/401428-script-error-Help#post2616342

    Originally Posted by kelvin View Post
    Image
    [Attachment 58326 - Click to enlarge]

    In the case of these risks that appear throughout the video. Give to remove them? Is there a code to take?
    You can probably just blur them away. Need a video sample...
    Quote Quote  
  6. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    OK!
    Image Attached Files
    Quote Quote  
  7. At first I though you meant all those very thin vertical and horizontal lines in the sample image. But I see now those are a result of your camera photographing the screen. I think what you really mean the comets? Those two short black streaks in the image. You can get rid of most of those with RemoveDirt():

    Code:
    LWLibavVideoSource("1978x29a.mkv") 
    RemoveDirtMC(limit=10)
    I think this is the same frame as your image (before filtering on the left, after on the right):
    Image
    [Attachment 58335 - Click to enlarge]


    Using a higher limit will remove more of them (but possibly mess up other things occasionally), a lower limit will remove less.
    Quote Quote  
  8. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    At first I though you meant all those very thin vertical and horizontal lines in the sample image. But I see now those are a result of your camera photographing the screen. I think what you really mean the comets? Those two short black streaks in the image. You can get rid of most of those with RemoveDirt():

    Code:
    LWLibavVideoSource("1978x29a.mkv") 
    RemoveDirtMC(limit=10)
    I think this is the same frame as your image (before filtering on the left, after on the right):
    Image
    [Attachment 58335 - Click to enlarge]


    Using a higher limit will remove more of them (but possibly mess up other things occasionally), a lower limit will remove less.
    Yes.The comets.

    Image
    [Attachment 58336 - Click to enlarge]
    error

    I downloaded RemoveDirt-0.9.3
    Image
    [Attachment 58337 - Click to enlarge]
    which one should I use and where to put it ?
    Quote Quote  
  9. RemoveDirtMC is a third party filter. You will need to download it and install any other third party filters it requires (that you don't already have). There are several variations around. The one I used comes from this thread:

    https://forum.videohelp.com/threads/382527-Need-help-setting-up-avisynth-pls!#post2477423

    Near the end of the big script there you'll see RemoveDirt() and RemoveDirtMC(). You can copy/paste from there into your script. I see they use RemoveGrain, fft3dfilter, and mvtools...
    Quote Quote  
  10. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    RemoveDirtMC is a third party filter. You will need to download it and install any other third party filters it requires (that you don't already have). There are several variations around. The one I used comes from this thread:

    https://forum.videohelp.com/threads/382527-Need-help-setting-up-avisynth-pls!#post2477423

    Near the end of the big script there you'll see RemoveDirt() and RemoveDirtMC(). You can copy/paste from there into your script. I see they use RemoveGrain, fft3dfilter, and mvtools...
    I downloaded several plugins.
    finally get to reproduce
    Last edited by kelvin; 9th Apr 2021 at 14:31.
    Quote Quote  
  11. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    At first I though you meant all those very thin vertical and horizontal lines in the sample image. But I see now those are a result of your camera photographing the screen. I think what you really mean the comets? Those two short black streaks in the image. You can get rid of most of those with RemoveDirt():

    Code:
    LWLibavVideoSource("1978x29a.mkv") 
    RemoveDirtMC(limit=10)
    I think this is the same frame as your image (before filtering on the left, after on the right):
    Image
    [Attachment 58335 - Click to enlarge]


    Using a higher limit will remove more of them (but possibly mess up other things occasionally), a lower limit will remove less.
    LWLibavVideoSource ("1978x29a.mkv") About scripts. What is the rule for opening a video? You should always use this code - (LWLibavVideoSource) or there are others. And what's the difference.
    Quote Quote  
  12. Generally, use whatever source filter that works. For VOB and MPG file I use DgIndex/MPEG2Source(). For MPEG 2 video in MKV I usually demux the video as an M2V elementary stream, then use DgIndex/Mpeg2Source(). That works best for MPEG2 with mixed hard/soft pulldown (and gives you access to its deringing and deblocking filters). For AVI files I use AviSource() if I have the video codec. LSMASH (LWlibavVideoSource(), LSMASHVideoSource(), and their audio counterparts) is a good general purpose source filter. Occasionally I'll use ffVideoSource() if LSMASH doesn't work right.
    Quote Quote  
  13. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    Generally, use whatever source filter that works. For VOB and MPG file I use DgIndex/MPEG2Source(). For MPEG 2 video in MKV I usually demux the video as an M2V elementary stream, then use DgIndex/Mpeg2Source(). That works best for MPEG2 with mixed hard/soft pulldown (and gives you access to its deringing and deblocking filters). For AVI files I use AviSource() if I have the video codec. LSMASH (LWlibavVideoSource(), LSMASHVideoSource(), and their audio counterparts) is a good general purpose source filter. Occasionally I'll use ffVideoSource() if LSMASH doesn't work right.


    Let's see if I understand.
    First use of input filter.
    Then the filter I want.

    So far I understood.

    For me to get the script on the website, AviSynth how do I do it?
    For example
    I want to get the logo out of a movie.
    http://avisynth.nl/index.php/External_filters#Logo_Removal

    I go to the site and I have several options, but where do I go to get the code for my script and where is it?


    Image
    [Attachment 58422 - Click to enlarge]

    Is this where the code that I use in the script is located?
    Quote Quote  
  14. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Image
    [Attachment 58424 - Click to enlarge]




    function RemoveDirt(clip input, bool "_grey", int "repmode")
    {
    _grey=default(_grey, false)
    repmode=default(repmode, 16)
    clmode=17
    clensed=Clense(input, grey=_grey, cache=4)
    sbegin = ForwardClense(input, grey=_grey, cache=-1)
    send = BackwardClense(input, grey=_grey, cache=-1)
    alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
    restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
    corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
    return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode )


    If I'm going to use the demovedirt, is that the scrit I use?
    Where do I put the source filter?
    For example if it were "Teste.mkv"

    #would that be correct?

    LWLibavVideoSource("teste.mkv")
    function RemoveDirt(clip input, bool "_grey", int "repmode")
    {
    _grey=default(_grey, false)
    repmode=default(repmode, 16)
    clmode=17
    clensed=Clense(input, grey=_grey, cache=4)
    sbegin = ForwardClense(input, grey=_grey, cache=-1)
    send = BackwardClense(input, grey=_grey, cache=-1)
    alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
    restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
    corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
    return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
    Quote Quote  
  15. Using something like:

    Code:
    function Myfunction(clip c...)
    {
        filters...
    }
    creates a function called MyFunction. The function isn't used in your script unless you explicitly call it. I like to import stuff and create functions at the start of my script, then follow with the actual script commands I want to use:

    Code:
    function MyFunction(clip c...)
    {
        filters...
    }
    
    LWLibavVideoSource("input.mkv")
    MyFunction(...)
    Note that your function definition is missing the final close curly brace, }.

    Code:
    # create a function called RemoverDirt
    function RemoveDirt(clip input, bool "_grey", int "repmode")
    {
        _grey=default(_grey, false)
        repmode=default(repmode, 16)
        clmode=17
        clensed=Clense(input, grey=_grey, cache=4)
        sbegin = ForwardClense(input, grey=_grey, cache=-1)
        send = BackwardClense(input, grey=_grey, cache=-1)
        alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
        restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
        corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
        return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode ) 
    }
    
    # open your source and apply RemoveDirt:
    LWLibavVideoSource("teste.mkv")
    RemoveDirt()
    Note that when you fail to name a stream explicitly AviSynth assume the name "last" so the script:

    Code:
    LWLibavVideoSource("teste.mkv")
    RemoveDirt()
    is equivalent to:

    Code:
    last = LWLibavVideoSource("teste.mkv") # create a video stream from test2.mkv, explicitly name it last
    last = RemoveDirt(last) # apply RemoveDirt to last, creating a new filtered stream called again called last
    Quote Quote  
  16. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    LWLibavVideoSource("teste2.mkv")
    InpaintDelogo( mask="c:\test\mymask.bmp",
    \ Automask=0, aMix=0, Loc="100,100,-100,-100",
    \ Mode="Inpaint",
    \ Analyze=1, FrB=0, FrW=0, FrS=0)
    InpaintDelogo ()


    I made this script but it is not working.


    Image
    [Attachment 58428 - Click to enlarge]
    Quote Quote  
  17. I'm not familiar with InpaintDelogo() but does c:\test\mymask.bmp exist? And the Loc="100,100,-100,-100" probably isn't right as that has something to do with the location of the logo.
    Quote Quote  
  18. Member
    Join Date
    Apr 2021
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    I'm not familiar with InpaintDelogo() but does c:\test\mymask.bmp exist? And the Loc="100,100,-100,-100" probably isn't right as that has something to do with the location of the logo.
    Do you have a script to remove the logo?
    Image
    [Attachment 58448 - Click to enlarge]
    Quote Quote  
  19. I have AvsInpaint:

    http://avisynth.nl/index.php/AvsInpaint

    which can be simple to use:

    Code:
    ##########################################################################
    #
    #  Fill a rectangular box with a specified color.
    #
    ##########################################################################
    
    
    function BoxFill(clip v, int x, int y, int w, int h, int color)
    {
       BlankClip(v, color=color)
       Crop(0, 0, w, h)
       Overlay(v, last, x, y)
    }
    
    ##########################################################################
    
    
    ImageSource("logo.png", start=0, end=23, fps=23.976) 
    Crop(0,0,-1,-1) # need even frame dimensions
    ConvertToYV12() # and YV12
    
    #mask = ImageSource("mask.bmp", start=0, end=23, fps=23.976).ConvertToYV12(matrix="pc.601")
    mask = Overlay(mt_binarize(130),mt_binarize(100).Invert(), mode="add").mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().GreyScale()
    mask = mask.BoxFill(0,0, 500, mask.height, $000000)
    mask = mask.BoxFill(500, 80, mask.width-500, mask.height-80, $000000)
    mask = mask.ColorYUV(cont_y=50)
    
    InpaintLogo(mask=mask, radius=5.0)
    The code is complicated by the fact that I built a mask based on the logo in the image. You could just import an image to use as a mask (as in the commented out (mask = ImageSource...) line.

    Image
    [Attachment 58449 - Click to enlarge]
    Quote Quote  



Similar Threads