PDA

View Full Version : How to Monitor a Variable


daveoggy
15th December 2004, 14:52
Is there a way to monitor your variables in avisynth? I have tried using subtitle(myvariable,...) but it just complains. Is there a simple way to achieve this?

Didée
15th December 2004, 15:29
Welcome to our little forum, daveoggy.

Seems you forgot that Subtitle() expects to get a *string* as argument:

subtitle( string( myvariable ), ... )

Sidenote: Things get much more "funny" when one is working in the "conditional environment", aka ScriptClip & Co. ...

daveoggy
15th December 2004, 15:51
Thanks, thats great!

But this now confirms I don't know what I'm doing :D

In a simple test to display the aspect ratio:

AVISource("someclip.avi")
clip1=AVISource("someclip.avi")
aspect=clip1.width() / clip1.height()
Subtitle(clip1,String(aspect, "%1.2f"),font="Arial")

The clips is 4:3 so I expect to see 1.33 displayed but the result is always 1 no matter what I change, what am I doing wrong?

Should I start a new thread?

Didée
15th December 2004, 16:04
clip1.width == integer
clip1.height == integer

integer / integer --> integer

==> aspect = float(clip1.width()) / float(clip1.height())

;)

daveoggy
15th December 2004, 16:09
This is the best response ever thanks so much!

:thanks: