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.

[HELP] Possible to go from PNG input stream to PNG output stream in VapourSynth?
#5
Looking at the script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libimwri.dll")
# defining beforeLSFMod-function - START
def beforeLSFMod(clip):
  import os
  import sys
  import ctypes
  # Loading Support Files
  Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
  # Import scripts folder
  scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
  sys.path.append(os.path.abspath(scriptPath))
  # Loading Plugins
  core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
  core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
  # Import scripts
  import havsfunc
  clip = havsfunc.LSFmod(input=clip, strength=100, Smode=2, Smethod=3, secure=True, Lmode=4, soft=-2, edgemaskHQ=True, preblur=1, ss_x=1.5)
  return clip
# defining beforeLSFMod-function - END

# source: 'F:/Test/source/000000.png'
# current color space: RGB24, bit depth: 8, resolution: 1440x960, fps: 23.976, color matrix: 709, yuv luminance scale: full, scanorder: progressive
# Loading F:\Test\source\%06d.png using vsImageReader
clip = core.imwri.Read("F:/Test/source/%06d.png", firstnum=0)
clip = core.std.Trim(clip=clip, length=501)
# Input color space is assumed to be RGB24
# making sure frame rate is set to 23.976
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Setting color range to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
clip = beforeLSFMod(clip)
# adjusting output color from: RGB24 to YUV444P8 for PNGModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="709", range_s="full")
# set output frame rate to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Output
clip.set_output()
Does this work in the Vapoursynth Preview?

I assume it does not, since you apply:
clip = havsfunc.LSFmod(input=clip, strength=100, Smode=2, Smethod=3, secure=True, Lmode=4, soft=-2, edgemaskHQ=True, preblur=1, ss_x=1.5)
on an RGB24 clip which will not work, as LSFMod only works on YV12 content.

Also: Why use LSFmod this way and not through Filtering->Vapoursynth->Sharpen->LSFmod?

Cu Selur
Reply


Messages In This Thread
RE: Possible to go from PNG input stream to PNG output stream in VapourSynth? - by Selur - 13.02.2022, 10:07

Forum Jump:


Users browsing this thread: 1 Guest(s)