View Single Post
Old 13th March 2022, 16:36   #11  |  Link
Couleur
Registered User
 
Couleur's Avatar
 
Join Date: Jan 2022
Location: France
Posts: 21
Quote:
Originally Posted by Selur View Post
for the fun of it, I did a small test:
Code:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# defining beforeDeCross-function - START
def beforeDeCross(clip):
  core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/vs_average.dll")
  
  sourceFps = clip. fps
  divider = 5
  targetFPS  = clip.fps/divider
  
  #convert to YUV420P16
  clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P16, range_s="limited")
  num = clip.num_frames;
  
  out = clip[0]
  count = int(num/divider)
  for i in range(count):
    clips = [None]*divider
    for j in range(divider):
      clips[j]=clip[i+j]
    i = i + divider;
    out =  out + core.average.Mean(clips)
  clip = out
  # colorformat YUV420P16
  # framerate 56
  return clip
# defining beforeDeCross-function - END

# source: 'C:\Users\Selur\Desktop\OMbBiTFQnwnFrNeBAbwb.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 280, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading C:\Users\Selur\Desktop\OMbBiTFQnwnFrNeBAbwb.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/OMbBiTFQnwnFrNeBAbwb.mkv", format="YUV420P8", cache=0, prefer_hw=0)
# Setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=1)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 280
clip = core.std.AssumeFPS(clip=clip, fpsnum=280, fpsden=1)
clip = beforeDeCross(clip)
# current meta; color space: YUV420P16, bit depth: 16, resolution: 1920x1080, fps: 56, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# adjusting output color from: YUV420P16 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
# set output frame rate to 56.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=56, fpsden=1)
# Output
clip.set_output()
-> 56fps.mkv
]
Seems to slow down the video and end prematurely, I can't wrap my head around how you made vs_average work
Couleur is offline   Reply With Quote