VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Hi... Someone can help me understand and how to correct some videos?
    I have found online some russian courage the cowardly dog episodes that are better quality and bitrate than mine. At the end I will mux these episodes with my old episodes that have italian language but...
    I don't know the technical name of these problems in the video. Now i will upload a part of the video to explain better (probably a bad deinterlacing???)

    https://drive.google.com/file/d/115cSv28T9VF1cP8r5PW36Nh44ElVKt8q/view?usp=sharing

    You can see various dancing pixels on the chair, the book, the cat, and on the written PRIVATE on the door and various color bands on letters on the book.

    Please tell me what are the names of these specific problems, and how can I correct them. Thanks
    Quote Quote  
  2. Dot crawl. Caused by incomplete removal of the chroma carrier from the luma of a composite video signal. Use a dot crawl remover filter.
    Quote Quote  
  3. Ok, thanks for the reply. I use Ripbot or Staxrip.

    Probably Staxrip now is better. In Staxrip i have these Chroma Fix plugins:
    Bifrost
    Checkmate
    ChubbyRain2
    CNR2
    DeRainbow
    DotKill (S / Z / T)
    Fix Horizontal Rainbow.

    What is the best?
    Please can you give me a good line code for this file?

    Thanks
    Last edited by salvo00786; 30th Aug 2022 at 09:43.
    Quote Quote  
  4. Hi... Yesterday I have tried some conversion.

    I have tried with this:
    chroma = checkmate(thr=12,max=25,tthr2=25)
    luma = checkmate(thr=12,max=25,tthr2=0)
    fixed = luma.MergeChroma(chroma)

    but the fix is a little to none.

    I have tried QTGMC Slower Repair Progressive and the result is much better

    I have tried QTGMC Slower Interlaced and the result is the best of the three.

    Probably i have used a wrong line for Checkmate, but the results are very poor in fixing dot crawl. Let me know if I am wrong on the code line and let me know please the best of the plugins I mentioned in the precedent post, thanks.
    Quote Quote  
  5. Unfortunately your video was inverse telecined before the DVD was made. That has changed the dot crawl structure so that normal dot crawl filters no longer work. Basically, interlaced NTSC video has dots that alternate at each frame. A pixel will be dark in one frame, light the next, dark again, light again, etc. Many dot craw filters, like CheckMate, take advantage of that by using a temporal average on non-moving parts of the frame (a 3d comb filter). The IVTC filter has changed that pattern so the temporal averaging no longer works.

    I haven't had much time yet to look for another way to reduce the dot crawl. But here's a start:

    Image
    [Attachment 66523 - Click to enlarge]


    It's blurring some parts of the picture more than it needs to. So I'm looking to refine it further...
    Quote Quote  
  6. Ok, thanks for your time. In the meantime what is the best derainbow and what is the best dow crawl filter between the filter I mentioned.

    Let me know when you can give me a line of code to use, because I don't know how to blur some parts of the video.
    Quote Quote  
  7. Here's what I did in that sample:

    Code:
    Mpeg2Source("Various Problems.d2v", CPU2="ooooxx", Info=3) 
    TFM()
    TDecimate()
    src = last
    
    mmask = Sharpen(1.0).mt_motion(thy1=25, thy2=25, thT=20, chroma="-128").mt_expand().mt_inpand().Blur(1.0).Blur(1.0).Blur(1.0)
    blurry = Spline36Resize(width/2, height/2).Spline36Resize(width, height).aWarpSharp2(depth=10)
    Overlay(last, blurry, mask=mmask)
    MergeChroma(last, src)
    SMDegrain (tr=2, thSAD=500, refinemotion=true, contrasharp=false, PreFilter=4, mode=0, truemotion=true, plane=4, chroma=false)
    mmask is a map of motion. This includes the moving/flickering dots and other motions (characters, panning etc.).

    blurry is a blurred version of the image. Blurring removes most of the dot crawl but leaves the image blurry.

    The blurry image is overlaid onto the original only where there is motion. The biggest problem here is that the moving characters are being blurred as well as the dot crawl. It needs an additional mask to limit the blurring to only the dot crawl areas.

    SMDegrain was used to reduce any residual mild dot crawl and some sparkles created by the processing. It also reduces the rainbow artifacts around the black text in the guest book.

    before:after
    Image Attached Files
    Quote Quote  
  8. This might be a little better:

    Code:
    Mpeg2Source("Various Problems.d2v") 
    TFM()
    TDecimate()
    src = last
    
    dotmask = Sharpen(1.0).mt_edge(mode="0 -8 0    -8 32 -8    0 -8 0")
    motionmask = Sharpen(1.0).mt_motion(thy1=20, thy2=20, thT=20)
    combinedmask = Overlay(dotmask, motionmask, mode="multiply").mt_expand().mt_inpand().BinomialBlur(2)
    blurry = Spline36Resize(width/2, height/2).Spline36Resize(width, height).aWarpSharp2(depth=10)
    Overlay(last, blurry, mask=combinedmask)
    MergeChroma(last, src.aWarpSharp2(depth=15))
    SMDegrain (tr=2, thSAD=200, refinemotion=true, contrasharp=false, PreFilter=4, mode=0, truemotion=true, plane=4, chroma=false)
    Quote Quote  
  9. Code:
    # Imports
    import vapoursynth as vs
    import os
    import ctypes
    # Loading Support Files
    Dllref = ctypes.windll.LoadLibrary("i:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
    import sys
    # getting Vapoursynth core
    core = vs.core
    # Import scripts folder
    scriptPath = 'i:/Hybrid/64bit/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    import site
    # Import libraries for onnxruntime
    path = site.getsitepackages()[0]+'/onnxruntime_dlls/'
    ctypes.windll.kernel32.SetDllDirectoryW(path)
    # Loading Plugins
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/fft3dfilter.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools_sf_em64t.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DerainbowFilter/BiFrost/libbifrost.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeCrawlFilter/DotKill/DotKill.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
    # Import scripts
    import G41Fun
    import havsfunc
    # source: 'C:\Users\Selur\Desktop\Various Problems.mkv'
    # current color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: telecine
    # Loading C:\Users\Selur\Desktop\Various Problems.mkv using LWLibavSource
    clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/Various Problems.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
    # Setting color matrix to 470bg.
    clip = core.std.SetFrameProps(clip, _Matrix=5)
    clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
    clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # making sure frame rate is set to 29.97
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    clip2clip = clip
    clip2clip = havsfunc.QTGMC(Input=clip2clip, Preset="fast", opencl=True, TFF=True,FPSDivisor=2)
    # Deinterlacing using TIVTC
    clip = core.tivtc.TFM(clip=clip, clip2=clip2clip)
    clip = core.tivtc.TDecimate(clip=clip)# new fps: 23.976
    # make sure content is preceived as frame based
    clip = core.std.SetFieldBased(clip, 0)
    clip = core.dotkill.DotKillS(clip=clip)
    # Fixing chroma bleeding using FixChromaBleedingMod
    clip = havsfunc.FixChromaBleedingMod(input=clip,cx=2,cy=2,strength=6.00,blur=True)
    # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLDarken
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("i:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Darken_HQ.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define STRENGTH 1.5', '#define STRENGTH 2.5')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=clip.width, height=clip.height)
    from vsdpir import DPIR
    ## Starting applying 'EdgeMask (Sobel)' masked filtering for vsDPIRDenoise
    clipMask = clip
    clipMask = core.std.Sobel(clip=clipMask)
    for i in range(3):
      clipMask = core.std.Maximum(clipMask)
    clipFiltered = clip
    # adjusting color space from YUV444P16 to RGBS for vsDPIRDenoise
    clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
    # denoising using DPIRDenoise
    clipFiltered = DPIR(clip=clipFiltered, strength=35.000, task="denoise", provider=1, device_id=0)
    clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.YUV444P16, matrix_s="470bg", range_s="limited", dither_type="none")
    clip = core.std.MaskedMerge(clip, clipFiltered, clipMask)
    ## Finished applying 'Edgemask (Sobel)' masked filtering for vsDPIRDenoise
    # adjusting color space from YUV444P16 to YUV444P8 for vsBiFrost
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited", dither_type="none")
    # rainbow removal using BiFrost
    clip = core.bifrost.Bifrost(clip=clip, variation=4, interlaced=False, blockx=8, blocky=8)
    # sharpening using AWarpSharp2
    clip = core.warp.AWarpSharp2(clip=clip, thresh=200, blur=2, depth=6, planes=[1,2])
    # adjusting color space from YUV444P8 to YUV444P16 for vsGLSLAdaptiveSharpen
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("i:/Hybrid/64bit/vsfilters/GLSL/parameterized/adaptive-sharpen.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define curve_height    1.0', '#define curve_height    1.1000')
    glsl = glsl.replace('#define anime_mode      false', '#define anime_mode    true')
    glsl = glsl.replace('#define overshoot_ctrl  false', '#define overshoot_ctrl  false')
    glsl = glsl.replace('#define video_level_out false', '#define video_level_out true')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=clip.width, height=clip.height)
    # GLSL filter: ACNet_HDN_L3.glsl
    clip = core.placebo.Shader(clip=clip, shader="I:/Hybrid/64bit/vsfilters/GLSL/ACNet_HDN_L3.glsl", width=720, height=480)
    # removing grain using TemporalDegrain2
    clip = G41Fun.TemporalDegrain2(clip=clip, degrainPlane=4, meAlgPar=False, meTM=True, postFFT=4, fftThreads=1, knlDevId=0)
    # adjusting output color from: YUV444P16 to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, dither_type="none", format=vs.YUV420P10, range_s="limited")
    # set output frame rate to 23.976fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
    # Output
    clip.set_output()
    main work is done by dpir denoise + temporaldegrain2
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Wow, this is a big script. Thanks, i have so much to learn from this.
    Quote Quote  
  11. Yes, very clean!
    Quote Quote  



Similar Threads

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