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.

Restoring badly digitized VHS
#9
For stabilization, try Stab+SpotLess+ReduceFlicker+TemporalFix. (https://www.mediafire.com/file/fygwu6cl4...e.mkv/file)
# Imports
import vapoursynth as vs
# getting Vapoursynth core
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")
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmotionmask.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/vszip.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libfillborders.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/FrameFilter/ReduceFlicker/ReduceFlicker.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/DePan.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/DFTTest.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
import vs_temporalfix
import SpotLess
import stabilize
import qtgmc
import validate
# Source: 'C:\Users\Selur\Desktop\A1_t00-00.00.10.247-00.00.39.835.mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 704x480, frame rate: 29.97fps, scanorder: top field first, yuv luminance scale: limited, matrix: 470bg, transfer: bt.601, primaries: bt.601 ntsc, format: mpeg-2
# Loading C:\Users\Selur\Desktop\A1_t00-00.00.10.247-00.00.39.835.mkv using DGSource
clip = core.dgdecodenv.DGSource("J:/tmp/mkv_1e10dacb566c29e0d6d6d62f9640a558_853323747.dgi",fieldop=0)# 29.97 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_BT601), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# 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 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
clip = qtgmc.QTGMC(Input=clip, Preset="Fast", InputType=0, TFF=True, TR2=1, SourceMatch=0, Lossless=0, opencl=True) # new fps: 59.94
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# stabilizing using Stab
clip = stabilize.Stab(clp=clip,mirror=15,dxmax=0,dymax=2)
# removing flickering using ReduceFlicker
clip = core.rdfl.ReduceFlicker(clip=clip, strength=3, aggressive=1)
# Spot removal using SpotLess
clip = SpotLess.SpotLess(clip=clip, radT=3, rec=True, pel=1, smoother="zsmooth")
# changing range from limited to full range for vsTemporalfix
clip = core.resize.Bicubic(clip, format=vs.YUV420P8, range_in_s="limited", range_s="full")
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_FULL)
# stabilizing using Temporalfix
clip = vs_temporalfix.vs_temporalfix(clip=clip,denoise=True)
# changing range from full to limited range for vsTemporalfix
clip = core.resize.Bicubic(clip, format=vs.YUV420P8,range_in_s="full", range_s="limited")
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# adjusting output color from: YUV420P8 to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# set output frame rate to 59.94fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
# output
clip.set_output()
but the text is still ugly.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
Restoring badly digitized VHS - by Graven - 01.09.2025, 20:52
RE: Restoring badly digitized VHS - by Selur - 01.09.2025, 21:15
RE: Restoring badly digitized VHS - by Graven - 01.09.2025, 22:16
RE: Restoring badly digitized VHS - by Selur - 02.09.2025, 18:01
RE: Restoring badly digitized VHS - by Graven - 02.09.2025, 19:18
RE: Restoring badly digitized VHS - by Selur - 02.09.2025, 19:33
RE: Restoring badly digitized VHS - by Graven - 21.09.2025, 18:41
RE: Restoring badly digitized VHS - by Selur - 21.09.2025, 18:58
RE: Restoring badly digitized VHS - by Selur - 21.09.2025, 19:32
RE: Restoring badly digitized VHS - by Graven - 21.09.2025, 21:54
RE: Restoring badly digitized VHS - by Selur - 22.09.2025, 15:59
RE: Restoring badly digitized VHS - by Graven - 23.09.2025, 19:48
RE: Restoring badly digitized VHS - by Selur - 23.09.2025, 20:01
RE: Restoring badly digitized VHS - by Graven - 23.09.2025, 20:26
RE: Restoring badly digitized VHS - by Selur - 23.09.2025, 20:51
RE: Restoring badly digitized VHS - by Graven - 26.09.2025, 22:30
RE: Restoring badly digitized VHS - by Selur - 27.09.2025, 00:33

Forum Jump:


Users browsing this thread: 1 Guest(s)