VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Could anyone guide me to remove the artifacts found in the attached sample video? Assuming that the defect may be due to interlacing, I tried VidCoder -> VideoFilters-> Deinterlace-> Decomb with Preset - Bob. But, with no effect.

    https://files.videohelp.com/u/198504/Sample%20Video-%20720p%20x264.mkv

    Thanks.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Unfortunately, some of the combing is burned in; usually it happens when a video is resized without taking
    the interlacing into account. Some Avisynth filters may help but the damage is already done.
    Quote Quote  
  3. About the best you can hope for is to blur the artifacts away with some thing like:

    Code:
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    That will result in a loss of sharpness of the while frame (though not as much as you might expect). Play with the downscaled height value to get the compromise of blurring away the combing vs. blurring the entire picture too much.

    You can try protecting the still areas with a motion mask:

    Code:
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    mmask = original.mt_motion().mt_expand().Blur(1.0).Blur(1.0)
    Overlay(original, last, mask=mmask)
    Play around with the mmask to get sufficient coverage.
    Last edited by jagabo; 21st Sep 2018 at 12:56.
    Quote Quote  
  4. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    About the best you can hope for is to blur the artifacts away with some thing like:

    Code:
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    That will result in a loss of sharpness of the while frame (though not as much as you might expect). Play with the downscaled height value to get the compromise of blurring away the combing vs. blurring the entire picture too much.

    You can try protecting the still areas with a motion mask:

    Code:
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    mmask = original.mt_motion().mt_expand().Blur(1.0).Blur(1.0)
    Overlay(src, last, mask=mmask)
    Play around with the mmask to get sufficient coverage.
    Thanks Jagabo. I appreciate your suggestion. I copied the above commands in note pad, saved as .avs file and tried to open in VirtualDub. But, it did not open. Could you please elaborate the procedure step by step as I am not conversant with these commands.?
    Quote Quote  
  5. What was the error message? You probably don't have the LSMASH package (LWLibavVideoSource is part of it). For the second script you may not have mt_masktools (mt_motion, mt_expand).
    Quote Quote  
  6. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    What was the error message? You probably don't have the LSMASH package (LWLibavVideoSource is part of it). For the second script you may not have mt_masktools (mt_motion, mt_expand).
    This is the error message I got when I tried to open the avs file in VirtualDub:



    Of course, I have not installed LSMASH package. Should I install this package in my system?
    Quote Quote  
  7. Have you installed AviSynth? Keep in mind that 32 VirtualDub (or other editor/encoder) requires 32 bit AviSynth and 32 bit filters. 64 bit VirtualDub (or other editor/encoder) requires 64 bit AviSynth and 64 bit filters.
    Quote Quote  
  8. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    Have you installed AviSynth? Keep in mind that 32 VirtualDub (or other editor/encoder) requires 32 bit AviSynth and 32 bit filters. 64 bit VirtualDub (or other editor/encoder) requires 64 bit AviSynth and 64 bit filters.
    Yes, I have AviSynth installed in my 32 bit system. I have 32 bit VirtualDub. I am using Windows 7 -32 bit.
    Quote Quote  
  9. In VirtualDub: did you use File -> Open Video File to open the AviSynth script? Don't use File -> Run Script -- that's for VirtualDub scripts, not AviSynth scripts.
    Quote Quote  
  10. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    In VirtualDub: did you use File -> Open Video File to open the AviSynth script? Don't use File -> Run Script -- that's for VirtualDub scripts, not AviSynth scripts.
    I used File -> Open Video File in VirtualDub. The problem may be that I don't have LSmash.dll plug-in in AviSynth plugin folder. I don't know how to get it and install it. I am searching the forum for similar topic.
    Quote Quote  
  11. LSMASH: http://avisynth.nl/index.php/LSMASHSource
    mt_masktools2: http://avisynth.nl/index.php/MaskTools2

    Download the archives then put the x86 versions of LSMASHSource.dll and mt_masktools2.dll in AviSynth's plugins folder. LSMASH includes several other dll files. I don't remember if you need them all but put those in the plugins folder too.

    You may also need Microsoft Visual C++ 2015 Redistributable. A URL for that is in the LSMASH package.

    By the way, the simple downscale/upscale works with any editor which lets you apply two resizes. So you don't need AviSynth for that. VirtualDub's resize filter will work.
    Quote Quote  
  12. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    About the best you can hope for is to blur the artifacts away with some thing like:

    Code:
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    That will result in a loss of sharpness of the while frame (though not as much as you might expect). Play with the downscaled height value to get the compromise of blurring away the combing vs. blurring the entire picture too much.
    After installing LSmash.dll plug-in, I could open the video in VirtualDub and the artifacts disappear to a great extent. I could see much improvements.
    The video plays well. Is it like I could only play the video in VirtualDub? How do I save the video duly eliminating the artifacts? Let me know the procedure, please .

    You can try protecting the still areas with a motion mask:

    Code:
    mmask = original.mt_motion().mt_expand().Blur(1.0).Blur(1.0)
    Overlay(src, last, mask=mmask)
    Play around with the mmask to get sufficient coverage.
    When I add these 'mmask' function, the video doesn't open and I get the error message telling that the video can not open.
    Anyway, I am much satisfied now having removed the artifacts to great extent. Thanks a lot.
    Quote Quote  
  13. Sorry, I made a mistake in the Overlay ("src" instead of "original"). I changed the script in my earlier post.
    Quote Quote  
  14. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    Sorry, I made a mistake in the Overlay ("src" instead of "original"). I changed the script in my earlier post.
    After the correction in 'mmask' function, now the video plays correct. I am not getting the audio. Do I need to add separate avs scripts to play the audio? Is it like I could only play the video in VirtualDub? How do I save the video and audio duly eliminating the artifacts? Let me know the procedure, please . I want to watch the movies with WDTV media player.

    Thanks.
    Quote Quote  
  15. Originally Posted by shans View Post
    Originally Posted by jagabo View Post
    Sorry, I made a mistake in the Overlay ("src" instead of "original"). I changed the script in my earlier post.
    After the correction in 'mmask' function, now the video plays correct. I am not getting the audio. Do I need to add separate avs scripts to play the audio? Is it like I could only play the video in VirtualDub? How do I save the video and audio duly eliminating the artifacts? Let me know the procedure, please . I want to watch the movies with WDTV media player.

    Thanks.
    To add audio in the script, you can use AudioDub()

    eg

    Code:
    aud = LWLibavAudioSource("Sample Video- 720p x264.mkv")
    
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    mmask = original.mt_motion().mt_expand().Blur(1.0).Blur(1.0)
    Overlay(original, last, mask=mmask)
    vid = last
    
    AudioDub(vid,aud)
    Quote Quote  
  16. I usually use the x264 command line encoder to encode the video then mux the original audio with the new video with MkvToolNix. You can use VirtualDub to encode the video. Just select the video codec you want to use (Video -> Compression) and File -> Save as AVI. If you want something other than AVI I recommend you use VirtualDub2 which supports other containers.

    The script with the motion mask only detects motion in the luma channel. It leaves some comb artifacts in the chroma. Here's a modification that detects motion in the chroma as well as the luma and eliminates the chroma combing too:

    Code:
    function YUVMotion(clip c)
    {
       mot = mt_motion(c, U=3, V=3, thT=255)
       U = mot.UtoY().BilinearResize(c.width, c.height)
       V = mot.VtoY().BilinearResize(c.width, c.height)
       Overlay(U, V, mode="add")
       Overlay(mot, last, mode="add")
       mt_expand()
       Blur(1.0)
       Blur(1.0)
       GreyScale()
    }
    
    
    LWLibavVideoSource("Sample Video- 720p x264.mkv") 
    original = last
    
    Spline36Resize(width, 240)
    Spline36Resize(original.width, original.height)
    
    mmask = YUVMotion(original)
    Overlay(original, last, mask=mmask)
    Quote Quote  
  17. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    I usually use the x264 command line encoder to encode the video then mux the original audio with the new video with MkvToolNix. You can use VirtualDub to encode the video. Just select the video codec you want to use (Video -> Compression) and File -> Save as AVI. If you want something other than AVI I recommend you use VirtualDub2 which supports other containers.

    The script with the motion mask only detects motion in the luma channel. It leaves some comb artifacts in the chroma. Here's a modification that detects motion in the chroma as well as the luma and eliminates the chroma combing too:
    I just followed the modified script. The outcome is great. I saved the video part alone using x264 external encoder, and then muxed the original audio with MkvToolNix. Excellent result. I have many movie files with the same type of artifacts and I wanted to throw them after watching. Now, all of them could be saved. Thank you very much, Jagabo.

    Thanks @poisondeathray.
    Quote Quote  
  18. Congratulations. Glad to help out. You may need to adjust the downscale size for each video as some will need more, some less.
    Quote Quote  
  19. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo View Post
    You may need to adjust the downscale size for each video as some will need more, some less.
    How do I decide the downscale size? What are the parameters to be taken into account?
    Quote Quote  
  20. Originally Posted by shans View Post
    Originally Posted by jagabo View Post
    You may need to adjust the downscale size for each video as some will need more, some less.
    How do I decide the downscale size? What are the parameters to be taken into account?
    Downscale just enough to make the combing go away. You usually need to downscale the height by about 50 percent to fix this problem. But this video was upscaled from an SD video (probably 720x480) so I had to go smaller.
    Quote Quote  
  21. Member
    Join Date
    Mar 2011
    Location
    India
    Search Comp PM
    Originally Posted by jagabo;
    Downscale just enough to make the combing go away. You usually need to downscale the height by about 50 percent to fix this problem. But this video was upscaled from an SD video (probably 720x480) so I had to go smaller.
    I got it. Thank you.
    Quote Quote  



Similar Threads

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