VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
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 07: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:	44
Size:	461.7 KB
ID:	83077  

    Last edited by themaster1; 25th Oct 2024 at 07: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 10: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

    Maybe worth a look:
    Code:
     Deinterlacing using QTGMC
    clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 50
    # Making sure content is preceived as frame based
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
    # Spot removal using SpotLess
    clip = SpotLess.SpotLess(clip=clip, radT=1, pel=1, smoother="zsmooth")
    # applying deblocking using DeBlock QED
    clip = havsfunc.Deblock_QED(clip)
    clip = core.std.Crop(clip=clip, left=18, right=16, top=88, bottom=88)# cropping to 686x400
    # denoising using mClean
    clip = mclean.mClean(clip=clip, thSAD=200, sharp=5, rn=4, deband=0)
    # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLFilmGrain
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/filmgrain.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define INTENSITY 0.05', '#define INTENSITY 0.02')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=clip.width, height=clip.height)
    but of course the faces remain garbled because the original is garbage.
    Yeah, samply there is no real good CodeFormer like solution.
    CodeFormer isn't 'stable' enough,..








    Last edited by Selur; 25th Oct 2024 at 14:18.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. Originally Posted by Selur View Post
    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
    a) yeah probably, I did it like someone showed here and didn't mess around too much with it .
    b & d) What do you recommend?

    I got a 3070 Ti, what could I enable? I tried NNEDI3 enabling the GPU checkbox and it slowed processing down to 10fps.
    Last edited by Nirvash; 28th Oct 2024 at 08:26.
    Quote Quote  
  7. Assuming you are using Hybrid and Vapoursynth (like in the thread you linked to):
    regarding, b:
    You can use general resizers under "Crop/Resize->Resize->Picture Resize->Resize method" or overwrite the selection there by using "Filtering->Vapoursynth->Frame->Resize->Resizer".
    If using NNEDI3 with gpu slows down the processing, do not enable gpu. Personally I usually use NNEDI3, 'gauss' or 'bicubic spline', but depending on the source using other filters might be better. (check the Vapoursynth Preview to decide which looks best for you and your source)

    regarding d:
    You should enable "Crop/Resize->Base->Pixel Aspec Ratio (PAR)->Convert output to" and set it to "Square Pixel (1:1)" if you encode higher resolutions that SD.
    Then just set the "Crop/Resize->Resize->Picture Resize->Target resolution" to the width you want. Do not disable 'Auto adjust'. If you want to specify a target height instead of a target width toggle 'Adjust to' to 'width'.

    Cu selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. Aha aha gotcha! I was pretty close to what you do but I wasn't enabling Square Pixel in the PAR section. (what does that do, anyway? I think I understand after reading this).

    Regarding B I'll try around these settings to see what's better / faster. I didn't know GPU was slower lol. Feels kinda counter intuitive.
    Finally getting familiar with "Compare view" to have a preview is such a huge help... before I was rendering the sample over and over again to compare. What a waste of time. 😂😂

    One last question, is there any way to fix the edges of the t-shirt and elbow? I tried several filters and didn't see any improvement.
    Image Attached Thumbnails Click image for larger version

Name:	Sin título.png
Views:	32
Size:	564.9 KB
ID:	83163  

    Quote Quote  
  9. what does that do, anyway?
    Anything with a PAR that isn't 1:1 is usually called anamorphic.
    read: https://en.wikipedia.org/wiki/Anamorphic_format
    Anamorphic is usually only used for SD content, so when upscaling to HD and higher one usually converts to a 1:1 PAR.
    (PAR = pixel aspect ratio)

    One last question, is there any way to fix the edges of the t-shirt and elbow? I tried several filters and didn't see any improvement.
    Probably. Using some strong filtering and limiting around edges might work.
    Did not see that in the shared clip.
    Last edited by Selur; 28th Oct 2024 at 13:41.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Originally Posted by Selur View Post
    Anything with a PAR that isn't 1:1 is usually called anamorphic.
    read: https://en.wikipedia.org/wiki/Anamorphic_format
    I don't think that is exactly accurate. "Anamorphic" films are indeed compressed horizontally when shot and then stretched when displayed in the theater. Thus, that part is correct. However, as used in the movie industry, the word usually refers to a process where the image is compressed and stretched more at the edges and less in the center. This non-linear transformation is done in order to preserve as much detail in the center of the screen, while intentionally allowing the edges to degrade more, because the viewer won't notice a slight bluriness or increased green at the edge of the screen.

    PAR other than 1:1 (often 1.21 or 0.9) compresses and stretches the image uniformly in the horizontal direction.
    Quote Quote  
  11. I don't think that is exactly accurate.
    Okay.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by Nirvash View Post
    upscaling to 1080p
    I always advise against it. There are currently no tools that give satisfactory results (there are always some strange bugs). I would rather stick with 576p -- better tools will surely appear someday.
    Quote Quote  



Similar Threads

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