VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hello! I've been lurking the forums all day trying to take in as much info as possible, and I've been messing with Hybrid with great success, though the program is daunting with the sheer amount of options it has.

    Sample source is an old PAL TV recording recorded using a period accurate video recorder that recorded to mpeg-2 at 720x576 @ ~9k bitrate and its only input option is RCA ().

    Code:
    General
    Complete name                  : D:\VideoTest\Medallas\20120811_2319_Medallas_Fem.mpg
    Format                         : MPEG-PS
    File size                      : 471 MiB
    Duration                       : 7 min 5 s
    Overall bit rate mode          : Variable
    Overall bit rate               : 9 271 kb/s
    Frame rate                     : 25.000 FPS
    
    Video
    ID                             : 224 (0xE0)
    Format                         : MPEG Video
    Format version                 : Version 2
    Format profile                 : Main@Main
    Format settings                : BVOP
    Format settings, BVOP          : Yes
    Format settings, Matrix        : Default
    Format settings, GOP           : M=3, N=12
    Format settings, picture struc : Frame
    Duration                       : 7 min 5 s
    Bit rate mode                  : Variable
    Bit rate                       : 8 830 kb/s
    Maximum bit rate               : 9 800 kb/s
    Width                          : 720 pixels
    Height                         : 576 pixels
    Display aspect ratio           : 4:3
    Frame rate                     : 25.000 FPS
    Standard                       : PAL
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Interlaced
    Scan order                     : Top Field First
    Compression mode               : Lossy
    Bits/(Pixel*Frame)             : 0.852
    Time code of first frame       : 00:00:00:00
    Time code source               : Group of pictures header
    GOP, Open/Closed               : Open
    GOP, Open/Closed of first fram : Closed
    Stream size                    : 448 MiB (95%)
    Color primaries                : BT.601 PAL
    Transfer characteristics       : BT.470 System B/G
    Matrix coefficients            : BT.470 System B/G
    
    Audio
    ID                             : 192 (0xC0)
    Format                         : MPEG Audio
    Format version                 : Version 1
    Format profile                 : Layer 2
    Duration                       : 7 min 5 s
    Bit rate mode                  : Constant
    Bit rate                       : 256 kb/s
    Channel(s)                     : 2 channels
    Sampling rate                  : 48.0 kHz
    Frame rate                     : 41.667 FPS (1152 SPF)
    Compression mode               : Lossy
    Delay relative to video        : -17 ms
    Stream size                    : 13.0 MiB (3%)
    
    Menu
    Format                         : DVD-Video
    So far I've been using x264 and NVenc (to see what was faster but it's about the same, 60fps), cropping black bars, upscaling to 1080p and using QTGMC and Vapoursynth to deinterlace and apply some filters and the quality improvement is noticeable.

    I didn't want to alter the source, datacap users we warned:
    Original file (470 MB): https://www.mediafire.com/file/ptztxw1bo0a4tkc/20120811_2319_Medallas_Fem.mpg/file

    Output (220 MB): https://www.mediafire.com/file/ptvstxjeb5h7dpv/20120811_2319_Medallas_Fem_hybrid_GPU-n...arpen.mp4/file

    Settings used! If not in the screenshot, they're the default.

    Do you think I can improve it in any way? There are thousands of possible combinations between the different filters, without counting all the individual options and I don't even know where to start.

    BTW I'm not using Filtering - Vapoursynth - Frame - Resize - NNEDI3 as Selur recommended in some post because I saw no gain in quality taking x6 time to complete.

    Thanks for your help!!
    Last edited by Nirvash; 25th Oct 2024 at 06:01.
    Quote Quote  
  2. Derainbow & dot crawl remover is what you need

    MPEG2Source("20120811_2319_Medallas_Fem.d2v", cpu=0)

    # 1: REMOVE RAINBOWS
    ConvertToYV16(interlaced=true) #
    orig=last
    ev=orig.assumetff().separatefields().selecteven()
    od=orig.assumetff().separatefields().selectodd()
    ev
    ue_chroma = UToY(ev).blur(0,1.5).ttempsmooth(maxr=6,lthresh=15 0, strength=2)
    ve_chroma = VToY(ev).blur(0,1.5).ttempsmooth(maxr=6,lthresh=15 0, strength=2)
    YToUV(ue_chroma, ve_chroma)
    MergeLuma(ev)
    ev_filtered=last
    od
    uo_chroma = UToY(od).blur(0,1.5).ttempsmooth(maxr=6,lthresh=15 0, strength=4)
    vo_chroma = VToY(od).blur(0,1.5).ttempsmooth(maxr=6,lthresh=15 0, strength=4)
    YToUV(uo_chroma, vo_chroma)
    MergeLuma(od)
    od_filtered=last
    interleave(ev_filtered,od_filtered)
    assumefieldbased().assumetff().weave()
    converttoyv12(interlaced=false)

    #2: DEINTERLACE
    QTGMC( Preset="fast", SourceMatch=3, Lossless=1, Sharpness=0.4, TR2=2, EdiThreads=4)
    Selecteven()

    #3: REMOVE DOT CRAWL (PROGRESSIVE ONLY)
    main=last
    main
    #checkmate (thr=12,max=12, tthr2=0) #
    bicubicresize(480,360) #
    spline36resize(720,576)
    lsfmod
    filtered=last
    main
    mt_edge().mt_expand()
    mymask=last
    mt_merge(main, filtered, mymask)
    #
    Image Attached Thumbnails Click image for larger version

Name:	videohelp-video-dotcrawl.png
Views:	10
Size:	461.7 KB
ID:	83077  

    Last edited by themaster1; 25th Oct 2024 at 06:18.
    *** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE
    Quote Quote  
  3. Code:
    assumefieldbased().assumetff().weave()
    converttoyv12(interlaced=false)
    shouldn't this be 'converttoyv12(interlaced=true)' ?

    @Nirvash: general suggestions, looking at the setting (haven't looked at the source) you might want to set output PAR to 1:1 when going for HD and higher resolutions and probably also change the color matrix.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. @Selur

    In hindsight I should have added some screenshots comparing the source and the output I have so far so you don't have to download the whole video. Here they are:

    Image
    [Attachment 83085 - Click to enlarge]

    Image
    [Attachment 83081 - Click to enlarge]

    This is much, much cleaner, but of course the faces remain garbled because the original is garbage.
    Image
    [Attachment 83083 - Click to enlarge]

    Again, overall pretty clean and like the faces, the buttons on the jacket were garbage and will always look like garbage.

    @10themaster1 Thanks! So should I disable the other filters (de-noise, de-halo, de-ring and sharpen)?
    Also, how do I use your code? Do I just paste that into vsViewer? And how do I generate that code with my own settings?

    This code Hybrid gave me doesn't look like your code.
    Code:
    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    import ctypes
    import sys
    import os
    core = vs.core
    # Import scripts folder
    scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    # Loading Support Files
    Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
    # loading plugins
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/VagueDenoiser/libneovaguedenoiser.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")# vsQTGMC
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/scenechange.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
    core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/DGDecode.dll")
    # Import scripts
    import mvsfunc
    import G41Fun
    import havsfunc
    import validate
    # Source: 'D:\VideoTest\Medallas\20120811_2319_Medallas_Fem.mpg'
    # Current color space: YUV420P8, bit depth: 8, resolution: 684x380, frame rate: 25fps, scanorder: top field first, yuv luminance scale: limited, matrix: 470bg, transfer: bt.470 system b/g, primaries: bt.601 pal, format: mpeg-2
    # Loading D:\VideoTest\Medallas\20120811_2319_Medallas_Fem.mpg using DGDecode
    clip = core.dgdecode.MPEG2Source("B:/Temp/mpg_5f820ce2b0c0fd990c6f0c5430b365c6_853323747.d2v",info=3)# 25 fps, scanorder: top field first
    frame = clip.get_frame(0)
    # setting color matrix to 470bg.
    clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
    # setting color transfer (vs.TRANSFER_BT470_BG), if it is not set.
    if validate.transferIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT470_BG)
    # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
    if validate.primariesIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
    # setting color range to TV (limited) range.
    clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
    # making sure frame rate is set to 25fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # making sure the detected scan type is set (detected: top field first)
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # tff
    # Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Placebo", TFF=True) # new fps: 50
    # Making sure content is preceived as frame based
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
    clip = core.std.Crop(clip=clip, left=18, right=16, top=88, bottom=82)# cropping to 650x210
    # rainbow removal using LUTDeRainbow
    clip = havsfunc.LUTDeRainbow(input=clip)
    # denoising using VagueDenoiser
    clip = core.neo_vd.VagueDenoiser(clip=clip)
    # sharpening using FineSharp
    clip = G41Fun.FineSharp(clip=clip)
    # applying dehalo using DeHalo_alpha
    clip = havsfunc.DeHalo_alpha(clip)
    # deringing using HQDeringmod
    clip = havsfunc.HQDeringmod(clip, nrmode=2, darkthr=3.0)
    # Resizing using 6 - luma bicubic, chroma bilinear
    clip = core.fmtc.resample(clip=clip, kernel="bilinear", w=3344, h=1080, interlaced=False, interlacedd=False) # resolution 3344x1080 before YUV420P8 after YUV420P16
    # adjusting output color from: YUV420P16 to YUV420P8 for x264Model
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
    # set output frame rate to 50fps (progressive)
    clip = core.std.AssumeFPS(clip=clip, fpsnum=50, fpsden=1)
    # output
    clip.set_output()
    Last edited by Nirvash; 25th Oct 2024 at 09:30.
    Quote Quote  
  5. About your settings:
    a. QTGMC with Placebo seems overkill
    b. about the resizer: I would recommend using another one
    c. you might want to add some deblocking
    d. your resizing seems wrong
    side note: there a also some machine learning based addons for Hybrid, if you have the GPU for it
    Last edited by Selur; 25th Oct 2024 at 11:26.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads

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