![]() |
|
[BUG] Problem with QTGMC + EdiExt + Def + more - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: [BUG] Problem with QTGMC + EdiExt + Def + more (/thread-4219.html) |
Problem with QTGMC + EdiExt + Def + more - papageno - 21.09.2025 Hello everyone, ![]() Thank you very much for creating such a great tool, and for maintaining it over the years. It is greatly appreciated. I'm writing here in this forum to ask for your help with a couple of problems that I can't seem to solve. problem 1: When I use the 'def' option in QTGMC, it doesn't work. I get an error message that I don't know how to resolve or what causes it. (The process stops when I start it and does not process anything.) ![]() ![]() Here is the message that appears at the bottom of the Vapoursynth Editor. 2025-09-21 03:37:24.733
VapourSynth plugins manager: Failed to load vapoursynth library!
Please set up the library search paths in settings.
2025-09-21 03:37:46.578
Failed to evaluate the script:
Python exception: Degrain1: failed to retrieve first frame from super clip. Error message:
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3207, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 3209, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 832, in vapoursynth.FuncData.__call__
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\vs_deepdeinterlace\DeF.py", line 131, in process_frame
output_img = inference(arrays, even_values, model, device, fp16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\vs_deepdeinterlace\DeF.py", line 85, in inference
re_frame = model(input).cpu()
^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\nn\modules\module.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3378, in vapoursynth._vpy_evaluate
File "src/cython/vapoursynth.pyx", line 3379, in vapoursynth._vpy_evaluate
File "C:\Temp\Hybrid-temp\tempPreviewVapoursynthFile03_37_24_564.vpy", line 59, in
clip = qtgmc.QTGMC(Input=clip, Preset="Slower", InputType=0, TFF=True, TR2=1, SourceMatch=3, Lossless=1, MatchPreset="Slower", MatchPreset2="Slower", opencl=True, EdiExt=clipEdiExt) # new fps: 29.97
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\vsscripts\qtgmc.py", line 914, in QTGMC
degrain1 = core.mv.Degrain1(edi, ediSuper, bVec1, fVec1, thsad=ThSAD1, thscd1=ThSCD1, thscd2=ThSCD2) # 0.00 0.33 0.33 0.33 0.00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/cython/vapoursynth.pyx", line 3114, in vapoursynth.Function.__call__
vapoursynth.Error: Degrain1: failed to retrieve first frame from super clip. Error message:
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3207, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 3209, in vapoursynth.publicFunction
File "src/cython/vapoursynth.pyx", line 832, in vapoursynth.FuncData.__call__
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\vs_deepdeinterlace\DeF.py", line 131, in process_frame
output_img = inference(arrays, even_values, model, device, fp16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\vs_deepdeinterlace\DeF.py", line 85, in inference
re_frame = model(input).cpu()
^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Hybrid\64bit\Vapoursynth\Lib\site-packages\torch\nn\modules\module.------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ Problem 2 : I am trying to replicate this flow in hybrid, but I cannot figure out how to generate the VFR times and then insert them into the final container. 4-Step Workflow 1️⃣ TFM + TDecimate → CFR + Timecodes
How can I do the same thing in Hybrid? What is the most reliable method that provides the best quality? And can it be accelerated with a powerful nvidia GPU?. Thank you very much for your time. I hope someone can help me.
RE: Problem with QTGMC + EdiExt + Def + more - Selur - 21.09.2025 Quote:I am trying to replicate this flow in hybrid, but I cannot figure out how to generate the VFR times and then insert them into the final container.You can not. Hybrid does not support deinterlacing VFR content while keeping it vfr. This is, because:
Quote:"TFM + TDecimate → CFR + Timecodes"Hybrid doesn't support mode 3 or 5 for TDecimate, also those modes are not meant to be applied on VFR content, but on CFR content. Side note: those steps seem like something some ai chat bot came up with,... Quote: Apply AI (DEF / vs_deepdeinterlace)Hybrid also does not support applying DeF, which is for deinterlacing, on progressive content. (after step 1. the content should be progressive) Also from my experience DeF does not really remove ghosting, it can improve some of the shimmering (but that could be addressed better) and it might improve the quality of the deinterlacing compared to some deinterlacers on some content. About the crash of the preview: Sadly, I can't reproduce the issue. using the same QTGMC settings you did: # Deinterlacing using QTGMC
clipEdiExt = clip
# adjusting color space from YUV420P8 to RGBS for vsDDD
clipEdiExt = core.resize.Bicubic(clip=clipEdiExt, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
clipEdiExt = vs_deepdeinterlace.DeF(clip=clipEdiExt, tff=False, fp16=True, device="cuda")
# Making sure content is preceived as frame based
clipEdiExt = core.std.SetFrameProps(clip=clipEdiExt, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clipEdiExt = core.resize.Bicubic(clip=clipEdiExt, format=vs.YUV420P8, matrix_s="470bg", range_in_s="full", range_s="limited", dither_type="error_diffusion") # additional resize to allow target color sampling
clip = qtgmc.QTGMC(Input=clip, Preset="Slower", InputType=0, TFF=False, TR2=1, SourceMatch=3, Lossless=1, MatchPreset="Slower", MatchPreset2="Slower", opencl=True, EdiExt=clipEdiExt) # new fps: 29.97
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clip = clip[::2] # selecting previously even framesI assume you have a GPU with at least 16GB VRAM and supports FP16, since when I apply Def in 1920x1080 even with FP16 (QTGMC always does this when DeF is used) uses all the 16 GB VRAM of my GeForce RTX 4080 (and takes ages). (also eats a lot of normal RAM, around ~30GB peeking to around 43GB) => If you can share a sample of your source (i.e. by splitting it using mkvtoolnix) I can look at that sample and a. try to reproduce the problem b. try to suggest something. Cu Selur Ps.: Playing around, I could reproduce the crash here, when my system ran out of vram, so I guess that is the same issue you are having. (to be frank applying DeF on HD content seems simply not really feasible and worth it) RE: Problem with QTGMC + EdiExt + Def + more - papageno - 21.09.2025 Thank you very much for your response. It is greatly appreciated. Could you please advise me on the best way to deal with this type of content in your program to obtain the best possible result? Thank you for your help. https://drive.google.com/file/d/1lpj3UnU2HeebmDuOMXLUMRUCF-58Ksun/view?usp=drive_link https://www.mediafire.com/file/gb7v4i5bs3laq51/C-15-Genesis_-_Three_Sides_Live_%25281982%2529_%255B2014_Blu-ray%255D.mkv/file -------------------------------------------------------------------------------------------------------- Regarding the DEF problem, here is the information about my video card so you can confirm whether it is compatible and, if so, help me solve that problem as well. Thank you.
RE: Problem with QTGMC + EdiExt + Def + more - Selur - 21.09.2025 Quote:Could you please advise me on the best way to deal with this type of content in your program to obtain the best possible result?No clue about the 'best possible' way, but here's how I would start. Looking at the file. First thing I noticed, when bobbing the content, every frame is duplicated, so the content isn't really interlaced. Looking at the content when overwriting the scan type to progressive, you see combing. The content isn't interlaced (at least not all the time), but probably field shifted or telecined (or a mix). ![]() Looking at the fields separated: ![]() ![]() so there is already ghosting in some of the fields. ![]() When disabling bobbing, you still see duplicates, so the content probably is telecined. So either using TFM+TIVTC or QTGMC(Bob)+sRestore(frate=23.9760), neither of these is perfect. => For interlaced handling, I would probably use TFM+TIVTC and add Santiag (or Vinverse2) after it. For denoising&co I would probably use MCDegrainSharp and sharpen additionally a bit with CAS(0.6 or 0.7). But I can't really say whether that is something you might want to do. (Additionally, adding DPIRDeblock(mlrt) at the end might help) So here's the script I end up with: # Imports
import vapoursynth as vs
# getting Vapoursynth core
import logging
import site
import sys
import os
core = vs.core
# Limit frame cache to 48473MB
core.max_cache_size = 48473
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# Force logging to std:err
logging.StreamHandler(sys.stderr)
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vs-mlrt/vstrt.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libsangnom.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI2.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
# Import scripts
from importlib.machinery import SourceFileLoader
vsmlrt = SourceFileLoader('vsmlrt', 'F:/Hybrid/64bit/vs-mlrt/vsmlrt.py').load_module()
from vsmlrt import Backend
import antiAliasing
import validate
# Source: 'C:\Users\Selur\Desktop\C-15-Genesis - Three Sides Live (1982) [2014 Blu-ray].mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 29.97fps, scanorder: telecine, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC
# Loading C:\Users\Selur\Desktop\C-15-Genesis - Three Sides Live (1982) [2014 Blu-ray].mkv using DGSource
clip = core.dgdecodenv.DGSource("J:/tmp/mkv_4baacdb2bacedf5b6d10360e0d08f745_853323747.dgi",fieldop=0)# 29.97 fps, scanorder: telecine
frame = clip.get_frame(0)
# setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# making sure the detected scan type is set (detected: telecine)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # tff
# Deinterlacing using TIVTC
clip = core.tivtc.TFM(clip=clip)
clip = core.tivtc.TDecimate(clip=clip)# new fps: 23.976
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# applying anti aliasing using santiag
clip = antiAliasing.santiag(c=clip, nns=2, qual=2, pscrn=2, opencl=True)
clip = core.std.Crop(clip=clip, left=240, right=240, top=0, bottom=0)# cropping to 1440x1080
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip, sharpness=0.700)
# adjusting color space from YUV420P8 to RGBH for vsDPIRmlrtDeblock
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="709", range_in_s="limited", range_s="full")
# adjusting deblocking using DPIR (mlrt)
clip = vsmlrt.DPIR(clip = clip, strength=50.000, model=3, backend=Backend.TRT(fp16=True,device_id=0,bf16=False,verbose=True,use_cuda_graph=True,num_streams=3,builder_optimization_level=3,engine_folder="J:/TRT"))
# adjusting output color from: RGBH to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_in_s="full", range_s="limited", dither_type="error_diffusion") # additional resize to allow target color sampling
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()Alternatively, with QTGMC and sRestore and something like: # Imports
import vapoursynth as vs
# getting Vapoursynth core
import logging
import site
import ctypes
import sys
import os
core = vs.core
# Limit frame cache to 48473MB
core.max_cache_size = 48473
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# Force logging to std:err
logging.StreamHandler(sys.stderr)
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vs-mlrt/vstrt.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libsangnom.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI2.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/dfttest2_nvrtc.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll")# vsQTGMC
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
# Import scripts
from importlib.machinery import SourceFileLoader
vsmlrt = SourceFileLoader('vsmlrt', 'F:/Hybrid/64bit/vs-mlrt/vsmlrt.py').load_module()
from vsmlrt import Backend
import srestore
import antiAliasing
import vs_deepdeinterlace
import dfttest2
import qtgmc
import validate
# Source: 'C:\Users\Selur\Desktop\C-15-Genesis - Three Sides Live (1982) [2014 Blu-ray].mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 29.97fps, scanorder: top field first, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC
# Loading C:\Users\Selur\Desktop\C-15-Genesis - Three Sides Live (1982) [2014 Blu-ray].mkv using DGSource
clip = core.dgdecodenv.DGSource("J:/tmp/mkv_4baacdb2bacedf5b6d10360e0d08f745_853323747.dgi",fieldop=0)# 29.97 fps, scanorder: top field first
frame = clip.get_frame(0)
# setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# 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
clipEdiExt = clip
# adjusting color space from YUV420P8 to RGBS for vsDDD
clipEdiExt = core.resize.Bicubic(clip=clipEdiExt, format=vs.RGBS, matrix_in_s="709", range_in_s="limited", range_s="full")
clipEdiExt = vs_deepdeinterlace.DDD(clip=clipEdiExt, tff=True, fp16=True, device="cuda")
# Making sure content is preceived as frame based
clipEdiExt = core.std.SetFrameProps(clip=clipEdiExt, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clipEdiExt = core.resize.Bicubic(clip=clipEdiExt, format=vs.YUV420P8, matrix_s="709", range_in_s="full", range_s="limited", dither_type="error_diffusion") # additional resize to allow target color sampling
clip = qtgmc.QTGMC(Input=clip, Preset="Fast", InputType=0, TFF=True, TR2=1, SourceMatch=0, Lossless=0, opencl=True, EdiExt=clipEdiExt, TR0=2, TR1=2, Rep0=1, Rep1=0, Rep2=4, DCT=5, ThSCD1=300, ThSCD2=110, Sbb=0, NoiseProcess=2, GrainRestore=0.0, NoiseRestore=0.4, StabilizeNoise=False, NoiseTR=0, NoiseDeint="bob") # new fps: 59.94
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# applying anti aliasing using santiag
clip = antiAliasing.santiag(c=clip, nns=2, qual=2, pscrn=2, opencl=True)
# adjusting frame count and rate with sRestore
clip = srestore.sRestoreMUVs(source=clip, frate=23.9760)
clip = core.std.Crop(clip=clip, left=240, right=240, top=0, bottom=0)# cropping to 1440x1080
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip, sharpness=0.700)
# adjusting color space from YUV420P8 to RGBH for vsDPIRmlrtDeblock
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="709", range_in_s="limited", range_s="full")
# adjusting deblocking using DPIR (mlrt)
clip = vsmlrt.DPIR(clip = clip, strength=50.000, model=3, backend=Backend.TRT(fp16=True,device_id=0,bf16=False,verbose=True,use_cuda_graph=True,num_streams=3,builder_optimization_level=3,engine_folder="J:/TRT"))
# adjusting output color from: RGBH to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_in_s="full", range_s="limited", dither_type="error_diffusion") # additional resize to allow target color sampling
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()Whether you want to denoise or sharpen the content more is up to your preference. (applying for example DetailSharpen seems to be too much for me https://imgsli.com/NDE2ODc5) Cu Selur RE: Problem with QTGMC + EdiExt + Def + more - papageno - 21.09.2025 Honestly, dealing with these videos is a headache. I really appreciate your time and help.
|