I am trying to deinterlace (QTGMC) a video file and denoise it as well, with the least quality loss.
1. I imported an MKV file, which is interlaced and from a DVD (25i, PAL).
2. I set Base > Processing > Video to "x264".
3. I set x264 > Base > General Settings > Encoding mode to "constant quantizer (1-pass)", and Quantization strength to "1", in order to get a (close to) lossless result.
4. I enabled Filtering > Vapoursynth > DeNoise > KNLMeansCL, set Distance to "20", Search radius to "5" and Similarity radius to "1". The other values are left by default.
5. I enabled Filtering > Vapoursynth > DeNoise > TTempSmooth, set Max. temporal radius to "7", Strength to "8". The other values are left by default.
6. I saved the new file as a new MKV file.Please, read the 'Infos needed to fix&reproduce bugs,..'-sticky before you post about a problem.
The process crashes within a few seconds, at 02_video: encoding video to MPEG-4 AVC with x264 (1-pass).
That's really odd. I followed those steps on creating a debug file, and now I did it again but the output TXT file is about the same. No idea what goes wrong here.
22.07.2022, 16:00 (This post was last modified: 22.07.2022, 16:16 by Selur.)
No, you changed the output folder,... wen enabling the debug output creation the HybridDebugOutput.txt is created inside the output folder, if you change the output folder, each time you get another HybridDebugOutput.txt.
The debug output ends with:
Quote: outputDir set to(2): T:
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
y4m [error]: bad sequence header magic
x264 [error]: could not open input file `-'
So it seems to be an issue with the Vapoursynth script or setup.
Broken Hybrid installation (too old version updated with newer one) or a parallel installed Python or Vapoursynth could be the cause of a broken Vapoursynth setup.
-> Does the Vapoursynth Preview show any errors?
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.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/NEO_FFT3DFilter/neo-fft3d.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/Support/EEDI3m.dll")
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/temporalsoften.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/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# source: 'H:\Series\Wilford Clux\CrystalWinx\Season 1\DVD\DE_2015\interlaced clips\S1_clips.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
# Loading H:\Series\Wilford Clux\CrystalWinx\Season 1\DVD\DE_2015\interlaced clips\S1_clips.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="H:/Series/Wilford Clux/CrystalWinx/Season 1/DVD/DE_2015/interlaced clips/S1_clips.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 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# 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) # new fps: 25
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
clip = clip[::2]
# denoising using KNLMeansCL
clip = havsfunc.KNLMeansCL(clip=clip, d=20, a=5, s=1)
# denoising using TTempSmooth
clip = core.ttmpsm.TTempSmooth(clip=clip, maxr=7, strength=8)
# adjusted resizing to achieve PAR 1:1 for preview
# resizing for preview to square pixel to 768x576
clip = core.resize.Bicubic(clip=clip, width=768, height=576)
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
Log:
2022-07-22 17:39:51.524
Failed to evaluate the script:
Python exception: Plugin C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll already loaded (com.vapoursynth.removegrainvs) from C:/Program Files/Hybrid/64bit/Vapoursynth/vapoursynth64/coreplugins/RemoveGrainVS.dll
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2832, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2833, in vapoursynth._vpy_evaluate
File "C:\Users\Arjan\AppData\Local\Temp\tempPreviewVapoursynthFile17_39_50_592.vpy", line 16, in
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
File "src\cython\vapoursynth.pyx", line 2580, in vapoursynth.Function.__call__
vapoursynth.Error: Plugin C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll already loaded (com.vapoursynth.removegrainvs) from C:/Program Files/Hybrid/64bit/Vapoursynth/vapoursynth64/coreplugins/RemoveGrainVS.dll
vapoursynth.Error: Plugin C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll already loaded (com.vapoursynth.removegrainvs) from C:/Program Files/Hybrid/64bit/Vapoursynth/vapoursynth64/coreplugins/RemoveGrainVS.dll
"C:/Program Files/Hybrid/64bit/Vapoursynth/vapoursynth64/coreplugins/RemoveGrainVS.dll"
-> Deinstall Hybrid and install it anew, you installed a newer Hybrid version over an older one where the changelog stated that the old version needed to be uninstalled.
You really need to deinstall!
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Okay, so it seems to be working now. I thought it was crashing but in a different way since it took almost five minutes till it would look different from this:
10 minutes in:
I guess this is quite an intense operation, at least for my PC. And it's just a 1 min 35 secs clip. I'm using a Intel i5-6500 CPU @ 3.20GHz and I don't have a GPU. But I'm switching to a AMD Ryzen 7 5700G 3.8 GHz soon, so maybe that'll improve the speed significantly. Still no GPU though.
But anyway, it seems to be working! I hope the result will be good too, but it'll take some time before I can tell. For now, thanks for helping me fix Hybrid!