Thread: Vapoursynth
View Single Post
Old 2nd May 2018, 15:39   #3079  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by HolyWu View Post
Generally I don't recommend invoking filters within FrameEval unless unavoidable, because that introduces extra overhead.

PHP Code:
from vapoursynth import core
import vapoursynth 
as vs
import functools

def frame_eval
(nclip):
    return 
core.misc.AverageFrames(clipweights=[1] * 5)

clip core.std.BlankClip(width=720height=480format=vs.YUV420P8length=10000)

#clip = core.misc.AverageFrames(clip, weights=[1] * 5)
# I get 1014.60 fps

#clip = core.std.FrameEval(clip, functools.partial(frame_eval, clip=clip))
# I get 566.09 fps

clip.set_output() 
You should assign the filtered result to a variable outside FrameEval and then pass it in via functools.partial() as additional argument if possible.
Why didn't I think of that... it works perfectly.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote