Thread: Vapoursynth
View Single Post
Old 30th April 2018, 00:36   #3071  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Is it possible to compare the value of f.props.PlaneStatsAverage in a FrameEval function with the previous and the next frame (n-1 and n+1)? Sould I use get_frame_async() for that?

Code:
def g(n, f, clip, d_clip):
	clip=clip.text.Text("current: "+ f.props.PlaneStatsAverage)
	clip=clip.text.Text("\nPrev: "+ ???)
	clip=clip.text.Text("\n\nNext: "+ ???)
		
	return clip
clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=x)
Edit
This works but feels more like a hack.
Code:
x= clip.std.PlaneStats()
x1= clip.std.PlaneStats().std.DuplicateFrames(0) #prev
x2= clip.std.PlaneStats().std.Trim(1) #next

clip = clip.std.FrameEval(functools.partial(g, d_clip=d_clip, clip=clip), prop_src=[x, x1, x2])
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 30th April 2018 at 01:11.
ChaosKing is offline   Reply With Quote