Log in

View Full Version : How can I select certain frames, by its numbers?


konstantin1
29th August 2021, 15:14
I would like to make an animation with "animate", but applying some easing function. So I have to create an animation of about 50 frames, and then selecting only specific frames, according to the easing function, to emulate acceleration and deceleration of the movements.
There is an .avsi file, which defines the different easing functions, I think, I can use that for this purpose. But I still have to select those certain frames by their calculated numbers. If I use "selectevery", I always have to use "trim" after that, and this creates a problem, as no one can know in advance, how many frames are left from the 50 after applying the easing function.

StainlessS
29th August 2021, 15:32
Any Good
https://forum.doom9.org/showthread.php?t=167971&highlight=FrameSel


FrameSel/Rep() Plugins for Avisynth v2.58/v2.6 by StainlessS.

FrameSel() is a simple plugin to select individual frames from a clip.

Can select frames numbers by direct arguments to filter, or in a string, or in a command file.


Video:- All Valid colorspaces

Audio:- Returns NO AUDIO (Does not really make sense for individual frames, although now supports ranges).


FrameSel(Clip, int F1, ... , int Fn, string 'scmd',string 'cmd', bool 'show', bool 'ver',bool "reject",bool "ordered",
\ bool "debug", int "Extract"=1)


EDIT:
Something like this maybe, [totally untested]

# NEEDS RT_STATS and FrameSel

FN = ".\SomeFile.avi"
CMD = ".\cmd.txt"

Fn=FN.RT_GetFullPathName
CMD=CMD.RT_GetFullPathName

RT_FileDelete(CMD)

m = 3.1415926

Final_written =-1

for(i=1,50) {
f = i * m
n = Round(f) # Load all n frames
RT_WriteFile(CMD,"%d # i=%d f=%f",n,i,f,Append=True)
Final_written = n

}

RT_DebugF("Last frame written = %d",Final_written) # Needs DebugView(google)

AviSource(FN)

A = FrameSel(cmd=CMD)
B = Trim(Final_written + 1,0) # from frame after Framesel loaded, to end of clip

A + B # result