VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 70
Thread
  1. I've been trying to do this for a while.

    Kodomo no Omocha was produced on film, but transfered to video via telecine, and when edited and mastered into analog videotape (Type-C or Betacam SP).

    Since it's a telecined analog taped source and the original film masters are probably lost (i think), i'm thinking of remastering from the taped source using the japanese DVD.

    The restoration filters used are:
    - De-rainbow and dot-crawl removal (analog videotape)
    - Color correction
    - De-haloing (with mask)

    I've been looking on doing some episode-specific artifacts:
    - Some episodes has chromatic aberration from (probably) the telecine machine
    - Ghosting

    Any help from feedback is greatly appreciated.

    Here's the script i'm using:

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("DirectShowSource", 3)
    
    ## Video file (ripped using MakeMKV)
    ep_file = "F:\title_t00.mkv"
    
    ## Load video file
    FFVideoSource(ep_file)
    
    ## Load audio file
    aud = FFAudioSource(ep_file)
    
    ## Rainbowing removal
    DFMDerainbow(maskthresh=10, mask=False, interlaced=True)
    
    ## Dot-crawl removal
    Tcomb(mode=2, fthreshl=4, fthreshc=5, othreshl=5, othreshc=6, map=False, scthresh=12.0)
    
    AssumeTFF()
    
    ## Temporary IVTC
    TFM(order=1, slow=2)
    TDecimate(rate=24.000/1001)
    
    ## De-halo
    #dehalo = FineDehalo(rx=2.0, ry=2.0, thmi=80, thma=128, thlimi=50, thlima=100, darkstr=0.8, brightstr=1.0, showmask=0, contra=0.0, excl=true)
    dehalo = Dehalo_alpha_mt(rx=4.0, ry=3.0, darkstr=1.0, brightstr=1.0)
    dehalomask = mt_edge(mode="prewitt", thy1=100, thy2=200).mt_expand().mt_expand().Blur(1.4).GreyScale()
    Overlay(last, dehalo, mask=dehalomask)
    
    ## Tweaking
    Tweak(hue=-10)
    
    ConvertToRGB32()
    Levels(16,1,241,0,255)
    ConvertToYV12()
    
    Prefetch(8)
    
    ## For comparison shots
    /*episode = episode.KillAudio()
    episode = episode.Crop(0,0,360,-0)
    
    Crop(360,0,-0,-0)
    
    StackHorizontal(episode,last)*/
    
    AudioDub(last,aud)
    Image Attached Thumbnails Click image for larger version

Name:	comparison1.png
Views:	174
Size:	852.4 KB
ID:	64975  

    Click image for larger version

Name:	comparison2.png
Views:	166
Size:	856.6 KB
ID:	64976  

    Quote Quote  
  2. Share a short sample of your (unfiltered/modified) source (in example created by mkvtoolnix gui; tell it to split the file in x MB chunks and share one of those chunks) unless you want advice on image filtering and not video filtering.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Hi!

    So, there's a unfiltered clip i separated using FFMPEG (stream copy).
    Image Attached Files
    Quote Quote  
  4. Main issue I see is the ghosting, at least for me:
    Code:
    TFM(order=1, slow=2)
    TDecimate(rate=24.000/1001)
    doesn't really help there, my guess is you will need to find a proper pattern.

    About the cleaning: I would probably add some strong denoising (with invered edgemask) to cleanup the areas more.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. What code/settings you can recommend?
    Quote Quote  
  6. Here's what I came up with:

    Code:
    LWLibavVideoSource("title_t00_clip1.mkv", cache=false, prefer_hw=2) 
    AssumeTFF()
    
    ColorYUV(gain_y=60, off_y=-26, cont_u=60, cont_v=60) # levels, saturation
    ConvertToRGB().RGBAdjust(r=249.0/230.0, b=249.0/228.0, rb=-15).ConvertToYV12() #white balance
    
    QTGMC() # undo the field blended PAL to NTSC frame rate conversion
    SRestore()
    
    dehalo = Dehalo_alpha(rx=3.5, ry=3.5, darkstr=1.0, brightstr=1.0)
    dehalomask = mt_edge(mode="prewitt", thy1=50, thy2=150).mt_expand().mt_expand().Blur(1.0).Blur(1.0).GreyScale()
    Overlay(last, dehalo, mask=dehalomask)
    
    SMDegrain (tr=3, thSAD=1000, refinemotion=true, contrasharp=false, PreFilter=4, mode=0, truemotion=true, plane=4, chroma=false)
    
    Prefetch(8)
    Image Attached Files
    Quote Quote  
  7. I usually use Vapoursynth not Avisynth.

    For Avisynth and the cleanup I would invert the dehalo_mask and then probably use MCTemporalDenoise with something like the settings I would use in Vapoursynth in preset 'very high' with it:
    Code:
    ### +-------------+----------------------+----------------------+----------------------+----------------------+----------------------+
    ### | SETTINGS    |      VERY LOW        |      LOW             |      MEDIUM          |      HIGH            |      VERY HIGH       |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | radius      |      1               |      2               |      3               |      2               |      3               |
    ### | pfMode      |      3               |      3               |      3               |      3               |      3               |
    ### | sigma       |      2               |      4               |      8               |      12              |      16              |
    ### | twopass     |      false           |      false           |      false           |      true            |      true            |
    ### | useTTmpSm   |      false           |      false           |      false           |      false           |      false           |
    ### | limit       |      -1              |      -1              |      -1              |      -1              |      0               |
    ### | limit2      |      -1              |      -1              |      -1              |      0               |      0               |
    ### | post        |      0               |      0               |      0               |      0               |      0               |
    ### | chroma      |      false           |      false           |      true            |      true            |      true            |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | deblock     |      false           |      false           |      false           |      false           |      false           |
    ### | useQED      |      true            |      true            |      true            |      false           |      false           |
    ### | quant1      |      10              |      20              |      30              |      30              |      40              |
    ### | quant2      |      20              |      40              |      60              |      60              |      80              |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | edgeclean   |      false           |      false           |      false           |      false           |      false           |
    ### | ECrad       |      1               |      2               |      3               |      4               |      5               |
    ### | ECthr       |      64              |      32              |      32              |      16              |      16              |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | stabilize   |      false           |      false           |      false           |      true            |      true            |
    ### | maxr        |      1               |      1               |      2               |      2               |      2               |
    ### | TTstr       |      1               |      1               |      1               |      2               |      2               |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | bwbh        |      HD?16:8         |      HD?16:8         |      HD?16:8         |      HD?16:8         |      HD?16:8         |
    ### | owoh        |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |
    ### | blksize     |      HD?16:8         |      HD?16:8         |      HD?16:8         |      HD?16:8         |      HD?16:8         |
    ### | overlap     |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |      HD? 8:4         |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | bt          |      1               |      3               |      3               |      3               |      4               |
    ### | ncpu        |      1               |      1               |      1               |      1               |      1               |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | thSAD       |      200             |      300             |      400             |      500             |      600             |
    ### | thSADC      |      thSAD/2         |      thSAD/2         |      thSAD/2         |      thSAD/2         |      thSAD/2         |
    ### | thSAD2      |      200             |      300             |      400             |      500             |      600             |
    ### | thSADC2     |      thSAD2/2        |      thSAD2/2        |      thSAD2/2        |      thSAD2/2        |      thSAD2/2        |
    ### | thSCD1      |      200             |      300             |      400             |      500             |      600             |
    ### | thSCD2      |      90              |      100             |      100             |      130             |      130             |
    ### |-------------+----------------------+----------------------+----------------------+----------------------+----------------------|
    ### | truemotion  |      false           |      false           |      false           |      false           |      false           |
    ### | MVglobal    |      true            |      true            |      true            |      true            |      true            |
    ### | pel         |      1               |      2               |      2               |      2               |      2               |
    ### | pelsearch   |      1               |      2               |      2               |      2               |      2               |
    ### | search      |      4               |      4               |      4               |      4               |      4               |
    ### | searchparam |      2               |      2               |      2               |      2               |      2               |
    ### | MVsharp     |      2               |      2               |      2               |      1               |      0               |
    ### | DCT         |      0               |      0               |      0               |      0               |      0               |
    ### +-------------+----------------------+----------------------+----------------------+----------------------+----------------------+
    For the pattern matching, I would try how AnimeIVTC copes with the source and may be even try Yatta or look a the separated fields and try whether I can find a pattern for field reduction.
    In Vapoursynth I would either use MCTemporalDegrain or DPIR to clean the source

    Code:
    QTGMC() # undo the field blended PAL to NTSC frame rate conversion
    SRestore()
    that still looks really ugly,...

    I'll give it a go later,..
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. I don't know if FineDehalo will work on dehaloing though.

    The AviSynth plugin description said to preserve as best details while dehaloing.

    I've tried comparing the dehalo filters.

    1 - Original
    2 - @jagabo's dehalo script
    3 - FineDehalo

    For me, Dehalo_alpha seemed... i don't know... blurry, for reason...
    Image Attached Thumbnails Click image for larger version

Name:	comp.01.png
Views:	152
Size:	890.9 KB
ID:	64994  

    Quote Quote  
  9. played around a bit (not using ml filters)
    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))
    # Loading Plugins
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DerainbowFilter/SSIQ/libssiq.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ColorFilter/TimeCube/vscube.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.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/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/MiscFilter/MiscFilters/MiscFilters.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
    # Import scripts
    import mvsfunc as mvf
    import masked
    import havsfunc
    # source: 'C:\Users\Selur\Desktop\title_t00_clip1.mkv'
    # current color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
    # Loading C:\Users\Selur\Desktop\title_t00_clip1.mkv using LWLibavSource
    clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/title_t00_clip1.mkv", format="YUV420P8", cache=0, fpsnum=30000, fpsden=1001, 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.970
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # setting field order to what QTGMC should assume (top field first)
    clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
    # Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 59.94
    # make sure content is preceived as frame based
    clip = core.std.SetFieldBased(clip, 0)
    # adjusting color space from YUV420P8 to RGB24 for vsTimeCube
    clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="limited")
    # color adjustment using TimeCube
    clip = core.timecube.Cube(clip=clip, cube="I:/Hybrid/64bit/vsfilters/ColorFilter/TimeCube/color/Presetpro - Summit.cube")
    # adjusting color space from RGB24 to YUV444P16 for vsGLSLSaturation
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="470bg", range_s="limited")
    with open("i:/Hybrid/64bit/vsfilters/GLSL/parameterized/bSat.hook.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define SatFactor 2.43', '#define SatFactor 1.5')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=720, height=480)
    # adjusting color space from YUV444P16 to YUV420P8 for vsSSIQ
    clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV420P8, range_s="limited")
    # rainbow removal using SSIQ
    clip = core.ssiq.SSIQ(clip=clip, interlaced=0)
    clip = havsfunc.DeHalo_alpha(clip, darkstr=1.50, brightstr=1.50)
    # denoising using MCTemporalDenoise
    clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", ncpu=1)
    ## Starting applying 'EdgeMask (Retinex)' masked filtering for vsFastLineDarken
    clipFiltered = clip
    clipFiltered = havsfunc.FastLineDarkenMOD(c=clipFiltered,strength=128,threshold=5)
    clipMask = clip
    clipMask = masked.retinex_edgemask(src=clipMask)
    clipMask = core.resize.Bicubic(clip=clipMask, format=vs.GRAY8)
    clip = core.std.MaskedMerge(clip, clipFiltered, clipMask)
    ## Finished applying 'Edgemask (Retinex)' masked filtering for vsFastLineDarken
    # adjusting frame count and rate with sRestore
    clip = havsfunc.srestore(source=clip, frate=23.9760, omode=6, speed=9, thresh=16, mode=2)
    # adjusting output color from: YUV420P8 to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, 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()
    note: color grading isn't my thing + not really happy how the lines look like atm. and still too much ghosting artifacts

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    The field blending is referred to as "Temporal Scanline Blending" on the bottom of this classic page: https://www.animemusicvideos.org/guides/avtech31/video-analyze.html

    There is no way to fully remove it. For instance, here are some separated fields. 936 and 937 contain a unique film frame, with partial blends from the surrounding frames.






    I would personally target 59.94fps output, so that when the blends have to be shown, each one is on-screen for less than 1/2 as long (17ms vs 42ms) and smoother motion is maintained.
    My YouTube channel with little clips: vhs-decode, comparing TBC, etc.
    Quote Quote  
  11. Here's another sources i'm sharing:

    First, another two unfiltered clips, since i thought need for more.
    And second, there's animation cels of the anime available online: for example, this cel.



    Maybe this can be helpful.
    Image Attached Files
    Quote Quote  
  12. the ghosting in the new clips seems as horrible as in the first.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  13. Originally Posted by Brad View Post
    The field blending is referred to as "Temporal Scanline Blending" on the bottom of this classic page: https://www.animemusicvideos.org/guides/avtech31/video-analyze.html

    There is no way to fully remove it. For instance, here are some separated fields. 936 and 937 contain a unique film frame, with partial blends from the surrounding frames.






    I would personally target 59.94fps output, so that when the blends have to be shown, each one is on-screen for less than 1/2 as long (17ms vs 42ms) and smoother motion is maintained.
    Oh boy, that's gonna be a challenge, wasn't it?

    So yeah, i searched and yeah, it's really hard to remove the blending.
    On the moment, we don't have a tool that removes fully the blend.

    But, mostly can be removed using AnimeIVTC, i think.
    This function has "blending removal" in mind too.

    Code:
    AnimeIVTC(mode=2,bbob=4,degrain=0)
    Quote Quote  
  14. Hmm,.. with some ml filters (BasicVSR++, DPIR, VSGAN) one can probably get rid off some of the artifacts, but it would be really slow.
    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/DerainbowFilter/SSIQ/libssiq.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.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/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/MiscFilter/MiscFilters/MiscFilters.dll")
    core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
    # Import scripts
    import mvsfunc
    import mvsfunc as mvf
    import masked
    import havsfunc
    # source: 'C:\Users\Selur\Desktop\title_t00_clip1.mkv'
    # current color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
    # Loading C:\Users\Selur\Desktop\title_t00_clip1.mkv using LWLibavSource
    clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/title_t00_clip1.mkv", format="YUV420P8", 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.970
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # setting field order to what QTGMC should assume (top field first)
    clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
    # Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 59.94
    # make sure content is preceived as frame based
    clip = core.std.SetFieldBased(clip, 0)
    # cropping the video to 706x480
    clip = core.std.CropRel(clip=clip, left=6, right=8, top=0, bottom=0)
    ## Starting applying 'EdgeMask (Retinex)' masked filtering for vsBasicVSRPPFilter
    clipFiltered = clip
    clipFiltered = core.std.AddBorders(clip=clipFiltered, left=0, right=6, top=0, bottom=0) # add borders to archive mod 8 (vsBasicVSRPPFilter) - 712x480
    # adjusting color space from YUV420P8 to RGBS for vsBasicVSRPPFilter
    clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
    # Quality enhancement using BasicVSR++
    from vsbasicvsrpp import BasicVSRPP
    clipFiltered = BasicVSRPP(clip=clipFiltered, model=3, fp16=True)
    clipFiltered = core.std.CropRel(clip=clipFiltered, left=0, right=6, top=0, bottom=0) # removing borders (vsBasicVSRPPFilter) -  706x480
    clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
    clipMask = clip
    clipMask = masked.retinex_edgemask(src=clipMask)
    clipMask = core.std.Maximum(clipMask)
    clipMask = core.resize.Bicubic(clip=clipMask, format=vs.GRAY8)
    clip = core.std.MaskedMerge(clip, clipFiltered, clipMask)
    ## Finished applying 'Edgemask (Retinex)' masked filtering for vsBasicVSRPPFilter
    # rainbow removal using SSIQ
    clip = core.ssiq.SSIQ(clip=clip, interlaced=0)
    from vsdpir import DPIR
    ## Starting applying 'EdgeMask (Retinex)' masked filtering for vsDPIRDenoise
    clipFiltered = clip
    # adjusting color space from YUV420P8 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=50.000, task="denoise", provider=0)
    clipFiltered = core.resize.Bicubic(clip=clipFiltered, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
    clipMask = clip
    clipMask = masked.retinex_edgemask(src=clipMask)
    clipMask = core.std.Maximum(clipMask)
    clipMask = core.std.Maximum(clipMask)
    clipMask = core.std.InvertMask(clipMask)
    clipMask = core.resize.Bicubic(clip=clipMask, format=vs.GRAY8)
    clip = core.std.MaskedMerge(clip, clipFiltered, clipMask)
    ## Finished applying 'Edgemask (Retinex)' masked filtering for vsDPIRDenoise
    clip = havsfunc.DeHalo_alpha(clip, darkstr=1.50, brightstr=1.50)
    clip = core.std.AddBorders(clip=clip, left=0, right=2, top=0, bottom=0) # add borders to archive mod 4 (vsVSGAN) - 708x480
    clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full")
    # Setting color range to PC (full) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
    # adjusting color space from YUV420P8 to RGB24 for vsVSGAN
    clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="full")
    # resizing using VSGAN
    from vsgan import ESRGAN
    vsgan = ESRGAN(clip=clip,device="cuda")
    model = "I:/Hybrid/64bit/vsgan_models/2x_LD-Anime_Skr_v1.0.pth"
    vsgan.load(model)
    vsgan.apply(overlap=4) # 1416x960
    clip = vsgan.clip
    # resizing 1416x960 to 1280x980
    clip = core.std.CropRel(clip=clip, left=0, right=4, top=0, bottom=0) # removing borders (vsVSGAN) -  1412x960
    clip = core.resize.Bicubic(clip, range_in_s="full", range_s="limited")
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # adjusting resizing
    clip = core.fmtc.resample(clip=clip, w=1280, h=980, kernel="lanczos", interlaced=False, interlacedd=False)
    # adjusting output color from: RGB48 to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
    # set output frame rate to 59.940fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
    # Output
    clip.set_output()
    gives me 0.07fps on my GeForce GTX 1070ti with 8 GB. I'll leave it over night and will post the result tomorrow.

    btw. Anime4K might be worth a try.

    But, mostly can be removed using AnimeIVTC, i think.
    might be worth a try,...

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  15. Here's the output of the above script, took ~2hrs speed when up to 0.16fps during the processing.
    CleanUp works fine with tht filter combination, ghosting is still there, but some of the ghosting artifacts got removed or lessened.

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  16. Originally Posted by Selur View Post
    Here's the output of the above script, took ~2hrs speed when up to 0.16fps during the processing.
    CleanUp works fine with tht filter combination, ghosting is still there, but some of the ghosting artifacts got removed or lessened.

    Cu Selur
    Very interessing.
    Yeah, it's strange, considering the AI upscale, but it's very interessing.
    Image Attached Thumbnails Click image for larger version

Name:	comp.02.png
Views:	206
Size:	2.33 MB
ID:	65012  

    Click image for larger version

Name:	comp.03.png
Views:	171
Size:	2.45 MB
ID:	65013  

    Quote Quote  
  17. Your best bet is to find a native NTSC version of the series not the screwed up PAL to NTSC conversion you have now.
    Quote Quote  
  18. I agree, getting a version without the ghosting would solve the main problem. Cleaning, color adustments, etc. archivable through different filters.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. Now, what about deblocking?

    Since the source is from a DVD, there will be some blocking artifacts.
    Quote Quote  
  20. Originally Posted by jagabo View Post
    Your best bet is to find a native NTSC version of the series not the screwed up PAL to NTSC conversion you have now.
    Well... here is the problem.
    This is the japanese DVD, with NTSC...

    I'm not joking...
    Quote Quote  
  21. Actually, though AnimeIVTC did fix the majority of the ghosting, thankfully.

    Just to know, this is the exact same frame.
    Image Attached Thumbnails Click image for larger version

Name:	episode_rmz.00.png
Views:	91
Size:	828.0 KB
ID:	65014  

    Quote Quote  
  22. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by RGMOfficial View Post
    Originally Posted by jagabo View Post
    Your best bet is to find a native NTSC version of the series not the screwed up PAL to NTSC conversion you have now.
    Well... here is the problem.
    This is the japanese DVD, with NTSC...

    I'm not joking...
    would the Blu-Ray version be any better quality wise ?? - https://www.ebay.com/itm/185079107978?amdata=enc%3AAQAHAAAA4ApOu9o19LXcXHhPBGXQx7P3pBp...3ABFBMhvbK159g
    Quote Quote  
  23. Well, some time ago, i received an copy of the .m2ts of the BluRay (here in Brazil, they don't sell, so that's the only way).

    Here's the same frame on the japanese BluRay:
    Image Attached Thumbnails Click image for larger version

Name:	00019.m2ts_snapshot_00.22.445.png
Views:	82
Size:	591.0 KB
ID:	65015  

    Quote Quote  
  24. Remember that this is the japanese BluRay.

    The Discotek BluRay actually looks better, but it's 480i, meaning no alterations to the framerate, maintain interlacing, and consequently, the same temporal blending.

    But i don't have a copy of the Discotek BluRay on the moment.

    Here's the opening of the Discotek version as posted by Discotek itself on Twitter:
    Here!
    Last edited by RGMOfficial; 25th May 2022 at 18:52.
    Quote Quote  
  25. For deblocking, Deblock_QED could be used, but depending on what filters you used beforehand it probably isn't necessary.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  26. Here's the opening of the Discotek version as posted by Discotek itself on Twitter:
    Here!
    Huh, I see no blending on that one. It might be just me though

    edit: nevermind
    Last edited by rrats; 26th May 2022 at 01:27.
    Quote Quote  
  27. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Originally Posted by jagabo View Post
    Your best bet is to find a native NTSC version of the series not the screwed up PAL to NTSC conversion you have now.
    It isn't PAL→NTSC, it's an issue that seems specific to Japanese telecine from the late '80s to late '90s. Here are more links:

    https://m1el.github.io/karekano/ (CTRL+F for "Temporal Scanline Blending" section, or scroll halfway down)
    https://forum.doom9.org/showthread.php?t=175051
    My YouTube channel with little clips: vhs-decode, comparing TBC, etc.
    Quote Quote  
  28. Originally Posted by Brad View Post
    Originally Posted by jagabo View Post
    Your best bet is to find a native NTSC version of the series not the screwed up PAL to NTSC conversion you have now.
    It isn't PAL→NTSC, it's an issue that seems specific to Japanese telecine from the late '80s to late '90s. Here are more links:

    https://m1el.github.io/karekano/ (CTRL+F for "Temporal Scanline Blending" section, or scroll halfway down)
    https://forum.doom9.org/showthread.php?t=175051
    Yeah, that's a general problem from the time considering telecine.

    This artifact can be found on GAINAX's 90s anime.
    Quote Quote  
  29. This artifact can be found on GAINAX's 90s anime.
    As a person trying to restore Evangelion episode 16, I can confirm that
    Quote Quote  
  30. Here's the opening comparison with my script:

    (Left - Original; Right - Restored with my script)

    Here's the updated script:

    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", 2)
    SetFilterMTMode("DirectShowSource", 3)
    
    ## Video file (ripped using MakeMKV)
    #ep_file = "title_t00.mkv"
    ep_file = "ep01_source.mkv"
    
    ## Load video file
    FFVideoSource(ep_file)
    #LWLibavVideoSource(ep_file)
    
    ## Rainbowing removal
    DFMDerainbow(maskthresh=10, mask=False, interlaced=True)
    
    ## Dot-crawl removal
    Tcomb(mode=2, fthreshl=4, fthreshc=5, othreshl=5, othreshc=6, map=False, scthresh=12.0)
    
    AssumeTFF()
    
    AnimeIVTC(mode=2,bbob=4,degrain=3,normconv=False)
    
    ## De-halo
    dehalo = Dehalo_alpha(rx=2.5, ry=2.5)
    dehalomask = mt_edge(mode="prewitt", thy1=100, thy2=200).mt_expand().mt_expand().Blur(1.4).GreyScale()
    Overlay(last, dehalo, mask=dehalomask)
    
    ## Tweaking
    Tweak(sat=.9)
    
    ConvertToRGB32(matrix="PC.709")
    Levels(14,1,245,0,255)
    ConvertToYV12(matrix="PC.709")
    
    Prefetch(4)
    Image Attached Files
    Quote Quote  



Similar Threads

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