30.04.2022, 13:07
Can I do anything to speed up the processing of files which are around 5 - 10 minutes long, and are taking over 2 hours each to process? Is there anything in the filter order which I can change to speed up the processing?
Quote:# Imports
import os
import sys
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = '/Applications/Hybrid.app/Contents/MacOS/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Import scripts
import edi_rpow2
import mvsfunc
import mcdegrainsharp
import havsfunc
# source: '/Volumes/Drobo/Project/PROJECT 01/Finished Intros - HDV/Final 39/Expose Intro updated.mov'
# current color space: YUV420P8, bit depth: 8, resolution: 1440x1080, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: top field first
# Loading /Volumes/Drobo/Project/PROJECT 01/Finished Intros - HDV/Final 39/Expose Intro updated.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="/Volumes/Drobo/Project/PROJECT 01/Finished Intros - HDV/Final 39/Expose Intro updated.mov", format="YUV420P8", cache=0, fpsnum=25, 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 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# 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) # new fps: 50
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=25.0000, omode=6, speed=9, thresh=16, mode=2)
# removing grain using MCDegrain
clip = mcdegrainsharp.mcdegrainsharp(clip=clip, frames=1)
# deringing using HQDeringmod
clip = havsfunc.HQDeringmod(clip, nrmode=2, darkthr=3.0)
# resizing using ZNEDI3
clip = edi_rpow2.nnedi3_rpow2(clip=clip, rfactor=2) # 2880x2160
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=1920, h=1080, kernel="lanczos", interlaced=False, interlacedd=False)
# adjusting output color from: YUV420P16 to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()