Log in

View Full Version : What's a good way to pass information from script to a program?


bigboss97
9th June 2009, 05:16
I'm writing a slideshow program with TransAll (http://avisynth.org/vcmohan/TransAll/docs/index.html) effects, see also (http://forum.videohelp.com/topic339076.html). I basically generate the script and read each avisynth frame and paint it to the screen. I want to display informtion to each image. Now I'm facing the problem that I don't know which image is currnetly on the screen, except I count the frames. But this will fail as soon as the script has been changed slightly.

My question:
Is it possible to pass the file name at a certain position (frame) in the script to my program? i.e. when the script has been created my program only needs to poll the information without worrying the frame number.

Thanks
Phuoc

Gavino
9th June 2009, 10:07
I want to display informtion to each image. Now I'm facing the problem that I don't know which image is currnetly on the screen, except I count the frames. But this will fail as soon as the script has been changed slightly.
Can't you use Subtitle for this?
Instead of generating ImageSource("...", ...)
change this to generate ImageSource("...", ...).Subtitle(" text ")

bigboss97
10th June 2009, 01:48
It's ok to do this because the script will be only generated shortly before movie start. But...
Since I'm already overlaying other information on the movie I would like to put the image specific information dynamically. So, I can allow user turn off the text on runtime or switch to other information.

Another option would be, when I generate the script I put a line of frame information in the first line and my program can count frames based on that number. But I still don't have the filename at certain spot if I don't analyse the entire script :-(

Can't you use Subtitle for this?
Instead of generating ImageSource("...", ...)
change this to generate ImageSource("...", ...).Subtitle(" text ")

Gavino
10th June 2009, 10:10
I don't understand why you have to analyse the script, if it is your program itself that generates the script.
Can't the program keep track of the frames associated with each file as it is generating, building a table for use at run-time?
In fact, in order to generate the script, the program must already 'know' the order of the slides and their duration. :confused: