PDA

View Full Version : FrameNumber Where is it?


dplaton
21st February 2005, 09:31
Obviuosly there must be something like FramrNumber

ShowFrameNumber I think is something like

Subtitle(string(FrameNumber()))

Animate I belive that use something called FrameNumber

I searched the documentation but I didn't find such a thing like FrameNumber

krieger2005
21st February 2005, 09:45
Here (http://www.avisynth.org/ConditionalFilter) or here (http://www.avisynth.org/Showframes) or even here (http://www.avisynth.org/ClipProperties) you can find something about this! Or try simply this:
ScriptClip("subtitle(string(current_frame))")

dplaton
21st February 2005, 10:03
current_frame is not in the ClipProprieties list.

current_frame is in the ConditionalFilter and I don't want to use ConditionalFilter.

I just want to know at a given momment the frame number and to use it

var=FrameNumber

or

var=current_frame

I tryed

subtitle(string(current_frame)) but didn't work

stickboy
21st February 2005, 11:33
What's wrong with the internal ShowFrameNumber function?

If you prefer:
function SubtitleNumber(clip c, int n)
{
return c.Subtitle(String(n), align=2)
}

Animate(0, FrameCount(), "SubtitleNumber", 0, FrameCount())
Originally posted by dplaton
I just want to know at a given momment the frame number and to use itcurrent_frame only has meaning in ScriptClip/FrameEvaluate/et al. Pretend it doesn't exist. Filters generally do not work that way, and ScriptClip and the rest are (IMO) hacks (and this makes them hard to use).

In the pure sense, filters are things that are applied to clips; they generally should be regarded as functional and stateless and without temporal notions of "current frames".

dplaton
21st February 2005, 11:42
I didn't find in the AviSynth Manual

FrameCount()

If this exist and give me the number of the present frame that it's all I want.

stickboy
21st February 2005, 11:51
Originally posted by dplaton
I didn't find in the AviSynth Manual

FrameCount()

If this exist and give me the number of the present frame that it's all I want.As I already tried to explain, there is no concept of a "present frame" outside of ScriptClip/FrameEvaluate/et al. Filters don't work this way, and if you really need them to, you must use ScriptClip or FrameEvaluate, but you should avoid them when possible.

When I say that a filter is functional, I mean in the mathematical sense. Suppose you apply sin(x) to the set of real numbers. What is the "current number" that sin(x) is operating on? There is no such thing; you apply it to a set of numbers, and you get out a set of numbers. There is no current state.

(BTW, you don't need two topics about this.)

dplaton
21st February 2005, 12:08
Animate varies the frames from start to end

I want to compute sin(alpha-x) where x is the frame number variated by Animate.

I need x the frame number showed by ShowFrameNumber.

How can I read FrameNumber.

I tried to convert the string showed by ShowFrameNunber into a number (interger), but I failed.

How works ShowFrameNumber, frome where takes the FrameNumber that shows?

stickboy
21st February 2005, 12:20
Sigh.
Originally posted by dplaton
I want to compute sin(alpha-x) where x is the frame number variated by Animate.

I need x the frame number showed by ShowFrameNumber.Please see my reply to your other thread (http://forum.doom9.org/showthread.php?s=&threadid=90137#post614270).
How can I read FrameNumber.You can't read the frame number. You can determine it indirectly with Animate. Have you tried any of the several examples already provided?
I tried to convert the string showed by ShowFrameNunber into a number (interger), but I failed.The internal ShowFrameNumber filter returns a clip that has the frame numbers drawn onto each frame. It does not return an integer nor a string (it doesn't make sense for it to return such things; it can return only a single value for the entire input clip.)
How works ShowFrameNumber, frome where takes the FrameNumber that shows?The implementation of internal functions/plug-ins is very different from user-defined functions, although when used in scripts, all ideally should behave in the stateless way I described.