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).
Example file:
https://drive.google.com/file/d/1X8vu9Sy...sp=sharing
EDIT: It also goes wrong with the same kind of error if, during step 3, I set encoding mode and quantization strength to CRF 1.
Debug Output doesn't contain job creation or job processing, so it's useless.
-> re-read the sticky on how to create a debug output file.
Cu Selur
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.
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:
Send you a link to my current dev version, maybe I already fixed that issue.
Cu Selur
I hope this debug log file works.
Yes, it does.
Vapoursynth script seems fine to me:
Code:
# 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)
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
but, the encoding call:
Code:
"C:\Program Files\Hybrid\64bit\Vapoursynth\vspipe.exe" "C:\Users\Arjan\AppData\Local\Temp\encodingTempSynthSkript_2022-07-22@17_22_53_0510.vpy" - -c y4m | "C:\Program Files\Hybrid\64bit\x264.exe" --preset veryfast --qp 1 --profile high --ref 3 --direct auto --b-adapt 0 --sync-lookahead 6 --partitions i4x4,p8x8,b8x8 --no-fast-pskip --subme 5 --sar 16:15 --non-deterministic --range tv --colormatrix bt709 --demuxer y4m --input-range tv --fps 25/1 --output-depth 8 --output "C:\Users\Arjan\AppData\Local\Temp\2022-07-22@17_22_53_0510_02.264" -
aborts with:
Code:
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
Code:
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
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!