I want to display a variable value in Avisynth for debuggin purpose but this does not work.
varfirsquarter=top_banner.FrameCount*.25
return combined.Subtitle(varfirsquarter , text_color=$000000, x=25, y=11, font ="Arial", size=60, first_frame =0, last_frame = 200, lsp=30, align=7, spc =62, halo_color=$ffffff)
How does one display variable values for debugging?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
-
Originally Posted by lindylex
Is there an error message?
If so, what?
And please post the entire script, the fragment you posted refers to undefined things. I can't tell if your variables refer to numbers, functions, clips or what.
Also for esoteric Avisynth questions the best place to ask is the
Doom 9 forum. -
This is one possible solution. I am interested in how others output variables for debugging?
AlanHK, sorry you do not understand.
I have a variable named "varfirsquarter" I want to store the first quarter in length of the movie "top_banner" in that variable. To do that I do this.
varfirsquarter=top_banner.FrameCount*.25
I wanted to see what the variable value was. So I decided to use the "Subtitle" method but it only takes strings. So I had to convert the number in my variable to a string by doing this "string (varfirsquarter)".
This is a solution.
return combined.Subtitle(string (varfirsquarter), text_color=$000000, x=25, y=11, font ="Arial", size=60, first_frame =0, last_frame = 200, lsp=30, align=7, spc =62, halo_color=$ffffff)
Does anyone have a different, better way of checking variable values for debgging?
Thanks Lindylex -
Originally Posted by lindylex
But if you're just debugging, you don't need to bother with all the parameters of subtitle.
Just:
Code:BlankClip(500) top_banner=last varfirsquarter=top_banner.FrameCount*.25 Subtitle(string (varfirsquarter))
-
AlanHK, thanks I was just using one of my previous used subtitle method calls. It definitely did not need so many parameter to display my variable value.
Thanks -
It looks like you can use the following to help debug also.
filename = "c:\myprojects\output.txt"
# create a test video to get frames
Version()
# the expression here is only a variable, which is evaluated and put in the file
# you will get a file with the framenumber in each line
WriteFile(filename, "current_frame")
# this line is written when the script is opened
WriteFileStart(filename, """ "This is the header" """)
# and this when the script is closed
WriteFileEnd(filename, """ "Now the script was closed" """)
////// AND ScriptClip method //////
.ScriptClip(" Subtitle(String(current_frame)) ") -
I currently use it or maybe even under use it. I'm sure there are good primer out there? What do you recommend?
-
Originally Posted by lindylex
Otherwise browse the topic in Doom 9.
http://forum.doom9.org/showthread.php?t=129385
Unfortunately, after an initial period of rapid development, the author appears to have stopped work on it.
But its extensibility, allowing you to add your own functions and macros, makes it very flexible. -
Originally Posted by lindylex
-
Gavino, do you know how to get the current frame number as a variable? For example, I want to do something like:
Crop(FrameNumber,0,720,480)
to pan across a large frame. -
Originally Posted by Gavino
Code:AviSource("uncompressed rgb.avi") Crop(current_frame,0,320,240)
Code:AviSource("uncompressed rgb.avi") ScriptClip("Crop(current_frame,0,320,240)")
-
Yes, outside the 'run-time environment', the concept of the 'current' frame makes no sense, because it's dealing with entire clips.
Your example could be written as
Animate(0, frameCount-1, "Crop", 0, 0, 320, 240, frameCount-1, 0, 320, 240)
which varies the first parameter from 0 to frameCount-1 over the length of the video. -
Originally Posted by Gavino
Thanks for steering me in the right direction...
Similar Threads
-
Avisynth script built in path variable
By a1s2d3f4 in forum Newbie / General discussionsReplies: 13Last Post: 29th Mar 2018, 18:15 -
How to display .png just for (exam 3 seconds or 100 frames) with Avisynth?
By xicudiz in forum EditingReplies: 2Last Post: 9th Apr 2011, 21:41 -
AViSynth to display two video files in sync: specific requirements
By a1s2d3f4 in forum Newbie / General discussionsReplies: 19Last Post: 12th Nov 2010, 12:59 -
Playing Video on display 2 and display 1 goes black
By sidewaysdriver in forum Software PlayingReplies: 2Last Post: 3rd Aug 2010, 00:36 -
How to get pixel values of MB in x.264
By polovn in forum Newbie / General discussionsReplies: 0Last Post: 2nd Mar 2009, 03:19