This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Hilfe für Denoise, DeBlock und Upscale von DVD
#10
Hatte voll übersehen, dass Du ein neues Sample gepostet hattest. Big Grin
# Imports
import vapoursynth as vs
import os
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("i:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import sys
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'i:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/DePan.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeblockFilter/DeblockPP7/DeblockPP7.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/RemoveDirt/RemoveDirtVS.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/EdgeFixer/EdgeFixer.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/fft3dfilter.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import edi_rpow2
import lostfunc
import killerspots
import havsfunc
# source: 'C:\Users\Selur\Desktop\VTS_01_1 (1)-005.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
# Loading C:\Users\Selur\Desktop\VTS_01_1 (1)-005.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/VTS_01_1 (1)-005.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=2)
# 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)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# 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, opencl=True) # new fps: 25
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
clip = clip[::2]
clip = havsfunc.DeHalo_alpha(clip)
# Fix bright and dark line artifacts near the border of an image using EdgeFixer
clip = core.edgefixer.Continuity(clip=clip,left=8)
clip = killerspots.KillerSpots(clip=clip)
# applying deblocking using DeblockPP7
clip = core.pp7.DeblockPP7(clip=clip, qp=3.50, mode=2)
# stabilizing using Stab
clip = lostfunc.Stab(clp=clip,mirror=0)
# cropping the video to 714x572
clip = core.std.CropRel(clip=clip, left=4, right=2, top=2, bottom=2)
clip = core.std.AddBorders(clip=clip, left=0, right=2, top=0, bottom=0) # add borders to archive mod 4 (vsMCT) - 716x572
# denoising using MCTemporalDenoise
clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", ncpu=1)
clip = core.std.CropRel(clip=clip, left=0, right=2, top=0, bottom=0) # removing borders (vsMCT) -  714x572
# adjusting color space from YUV420P8 to YUV444P16 for vsGLSLLumaSharpen
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
with open("i:/Hybrid/64bit/vsfilters/GLSL/parameterized/LumaSharpenHook.glsl") as glslf:
  glsl = glslf.read()
glsl = glsl.replace('#define sharp_strength 0.30', '#define sharp_strength 1.2000')
glsl = glsl.replace('#define sharp_clamp    0.035', '#define sharp_clamp    0.0350')
glsl = glsl.replace('#define pattern 2', '#define pattern 2')
glsl = glsl.replace('#define offset_bias 1.0', '#define offset_bias 1.0000')
clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=clip.width, height=clip.height)
clip = core.std.AddBorders(clip=clip, left=0, right=2, top=0, bottom=0) # add borders to archive mod 4 (NNEDI3(CL)) - 716x572
# resizing using NNEDI3CL
# current: 716x572 target: 1920x1080 -> pow: 4
clip = edi_rpow2.nnedi3cl_rpow2(clip=clip, rfactor=4) # 2864x2288
clip = core.std.CropRel(clip=clip, left=0, right=8, top=0, bottom=0) # removing borders (NNEDI3(CL)) -  2856x2288
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=1920, h=1080, kernel="lanczos", interlaced=False, interlacedd=False)
with open("i:/Hybrid/64bit/vsfilters/GLSL/parameterized/filmgrain.glsl") as glslf:
  glsl = glslf.read()
glsl = glsl.replace('#define INTENSITY 0.05', '#define INTENSITY 0.01')
clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=clip.width, height=clip.height)
# adjusting output color from: YUV444P16 to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, dither_type="none", format=vs.YUV420P10, range_s="limited")
# set output frame rate to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
macht Folgendes:
https://imgsli.com/MTM1NzE4
https://imgsli.com/MTM1NzE5
https://imgsli.com/MTM1NzIw
https://imgsli.com/MTM1NzIx

Das problematischste ist das Deblocking, teste mal die Filter an. (hab da DeblockPP7 verwendet, DPIR = ai Deblocker, liefert bessere Ergebnisse (https://imgsli.com/MTM1NzIz), benötigt aber ne CUDA GPU und ein extra Add-on für Hybrid)
Beim Denoising ist KillerSpots + MCTemporalDenoise ne ordentliche Kombi.


Cu Selur

Ps.: bin jetzt erstmal ins Bettchen (morgen 4:30 Uhr aufstehen, 2:30 Uhr zur Arbeit (wegen Streckensperrung bei der Bahn(, arbeiten und Abends zu 'The Hu' Big Grin) -> werde vermutlich erst Freitag wieder wirklich reagieren.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
RE: Hilfe für Denoise, DeBlock und Upscale von DVD - by Selur - 23.11.2022, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)