11.01.2024, 15:51
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'M:\DownloadedClips\Anachnu\Anachnu09.mp4'
# current color space: YUV420P8, bit depth: 8, resolution: 352x288, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading M:\DownloadedClips\Anachnu\Anachnu09.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="M:/DownloadedClips/Anachnu/Anachnu09.mp4")
# Setting detected color matrix (470bg).
clip = core.std.SetFrameProps(clip, _Matrix=5)
# Setting color transfer info (470bg)
clip = core.std.SetFrameProps(clip, _Transfer=5)
# Setting color primaries info (5)
clip = 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=0) # progressive
# Resizing using 10 - bicubic spline
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1320, h=1080, interlaced=False, interlacedd=False) # resolution 1320x1080 before YUV420P8 after YUV420P16
# adjusting output color from: YUV420P16 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'M:\DownloadedClips\Anachnu\Anachnu09.mp4'
# current color space: YUV420P8, bit depth: 8, resolution: 352x288, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading M:\DownloadedClips\Anachnu\Anachnu09.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="M:/DownloadedClips/Anachnu/Anachnu09.mp4")
# Setting detected color matrix (470bg).
clip = core.std.SetFrameProps(clip, _Matrix=5)
# Setting color transfer info (470bg)
clip = core.std.SetFrameProps(clip, _Transfer=5)
# Setting color primaries info (5)
clip = 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=0) # progressive
# Resizing using 10 - bicubic spline
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1320, h=1080, interlaced=False, interlacedd=False) # resolution 1320x1080 before YUV420P8 after YUV420P16
# adjusting output color from: YUV420P16 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited", dither_type="error_diffusion")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()