View Full Version : CALL command
DDogg
19th February 2003, 23:41
This might be way over the top, but I am wondering if there exists a method or the possibility of implementation of a CALL command (to call an external commandline program) in AviSynth?
The background for the question is this. My wife does some video editing in Movie Maker 2 and then hands it off to me to finish up in Video Vegas. WMM2 creates a Type 1 DV file that nothing seems to like so I have to convert it, or save out the wav and use wavsource or load it in VDub as separate wav audio. If you have 25 files to do this gets to be a real pain, plus I run into many other situations where I wish I could call an external program. Sort of a batch file mentality I guess.
As I was playing around with writing some automatic templates for AVISynthesizer (the real one - the first one), I was struck with how nice it would be to have the ability to call an external program to strip the audio from an AVI as a wav file and then use wavsource. Something like this:
#DV-T1 Template
Call ("avi2wav.exe mytest.avi mytest.wav") #imaginary
V=avisource("mytest.avi")
A=wavsource("mytest.wav")
AudioDub(V,A)
This might also be useful with MPGs and mpasource. I may well be way off target but I sure do wish there was a way to automate this chore from within AviSynth. Am I missing some obvious solution?
Add: Another thing that got me thinking about this was Nic's mpegdecoder and mpasource both do/can call a routine before allowing the script to complete. Nic builds a d2v file if needed and mpasource creates an index. So, it does not seem too big a stretch to think an external executable might be able to run from within Avisynth.
DD
DDogg
20th February 2003, 15:33
Well this went over like a lead ballon. So, let me ask a more straight forward question of the coders:
Is it possible to code a plugin/filter with the single purpose of calling and passing params to a external commandline program? If so, would somebody consider doing it?
sh0dan
20th February 2003, 16:06
Should be easy enough - you could even make it trigger on a certain frame. If someone could device a plugin, I'd be happy to implement it into the core.
DDogg
20th February 2003, 16:38
sh0dan, thanks for the lifeline :D I was starting think this suggestion might be a big hairball. Seriously, IMO, the additional flexibility made possible could be well worth an effort on somebody's part.
Some:
1> One could do both pre-process and post-process operations from within a script.
2> It would open (somewhat) AviSynth to anybody that could write a simple program or even a batchfile to accomplish one-off "individual enthusiasms". If some of those one-offs were of greater interest a more experienced coder could refine them.
Q: Can a plug-in coder send a string to video output? Like "Executing external command, please wait"?
DD
sh0dan
20th February 2003, 17:18
Can a plug-in coder send a string to video output? Like "Executing external command, please wait"?
Yes - but unless you open a new window it will be in the final frame of your video.
MPEGSource opens a new window for a progress bar for instance.
Belgabor
20th February 2003, 18:22
@DDogg, you seem to have a small misconception of avisynth scripts or fell into a small trap of thought. The script is not processed once form start to end like e.g. a bash script on linux, there is no temproal one-command-after-the-other, only a stream of frames so to speak which can be accessed randomly.
The result is that a CALL command could only be (someone correct me if I'm wrong)
executed on open
executed on close
executed each time / the first time a specific frame is requested
so, like sh0dan said, reporting of execution status is not possible via video output.
Cheers
Belgabor
DDogg
20th February 2003, 19:24
... or fell into a small trap of thought.
Yep, I am always doing that. A very little knowledge can be dangerous (ME - I cheerfully admit), but, hopefully can occasionally stimulate thought :p
The result is that a CALL command could only be (someone correct me if I'm wrong)
executed on open
executed on close
executed each time / the first time a specific frame is requested
so, like sh0dan said, reporting of execution status is not possible via video output.
Those three options would be more than enough! Status would just have been frosting on the cake. Who am I to quibble? A guy can dream, yes? :)
Seriously, Belgabor, thanks for helping me understand better and thanks for all the work on VDubMod. So ..., now that I am a toady, would you be interested in writing this plugin? :cool:
Nic
21st February 2003, 10:18
The chances are, for instance with BeSweet, the "call" command would just be doing a ShellExecute or CreateProcess, so the application will popup and have its own progress showing...It may not be the neatest way, but should be enough :)
Ill whip it up tonight if I get time, but any of the coders here could code it if any of us have 5mins to spair (which I fear we rarely do :( )
-Nic
Nic
21st February 2003, 11:24
Actually, here you go :) :
http://nic.dnsalias.com/Call.zip
Has the source and a Avisynth 2.5 version as well as the normal Call.DLL
I havent really tested it, but someone will be able to fix it if its broken easily. Hopefully the readme.txt will help people use it.
Cheers,
-Nic
ps
Thinking about it you probably need it after some sort of source, so use like:
LoadPlugin("MPEG2Dec.dll")
LoadPlugin("Call.dll")
MPEG2Source("e:\rip\movie.d2v")
Call("d:\besweet", "0,-1")
Call probably has to come after a *Source plugin of some sort :)
DDogg
21st February 2003, 20:38
Nic, this was really decent of you to take the time to do this. God knows your plate always seems full. I'll give it a few tests and report back. Thanks, very much, again.
DD
DDogg
22nd February 2003, 04:21
@Nic
The -1 works like a top, but if 0 is used the call command is implemented twice. If 0 is used it activates @ frame 0 and also at the EOF as if it were passed 0,-1 as its args. If you close the player before the end it also activates.
LoadPlugin("call.dll")
LoadPlugin("mpeg2dec.dll")
testcmd="besweet.exe -core( -input matrix.ac3 -output matrix.wav )"
mpeg2source("Matrix.D2V")
Call(testcmd,"-1")
It was great to see one could use a variable as the argument.
I now more fully understand Belgabor's meaning in the post above. I foolishly ( :o ) thought this might work as if the MP3 could have been produced before the clip:
LoadPlugin("call.dll")
LoadPlugin("mpeg2dec.dll")
LoadPlugin("mpasource.dll")
testcmd="besweet.exe -core( -input matrix.ac3 -output matrix.mp3)"
Call(testcmd,"-1")
V=mpeg2source("Matrix.D2V")
A=mpasource("matrix.mp3")
audiodub(V,A)
I freely and cheerfully admit to a case of ******* :confused:. Be that as it may, I still think people may well find some very interesting uses for CALL.
There seems to be a sortof IfThenElse<(kinda) structure that could be used (I think) to change the string of a variable used by CALL? That might open a few more uses.
Q: Anybody know enough about the import command to tell/show me how to read in a file and reset some variables? I think that is possible but the manual is pretty light on the subject.
Nic
22nd February 2003, 09:41
Hmmmm. Ill look into that DDogg. Ill make that if your setting it for frame 0 then frame 0 is only called once (I dont believe that its getting called at the end, just that the film is being rewound to the first frame by the encoder)
To make a version of Call that works before encoding begins could be tricky. But then again, If I did everything in the constructor of the filter then that should do it before encoding begins....Hmmmm, ill give it a go later.
:)
-Nic
Nic
22nd February 2003, 11:43
http://nic.dnsalias.com/Call.zip
This version now lets you do:
LoadPlugin("call.dll")
Call(BlankClip, "lame --decode fatboy.mp3 fatboy.wav", "-2")
WavSource("fatboy.wav")
which creates fatboy.wav just before WavSource trys to load it :)
Also the "calling frame 0 twice bug" should also be fixed.
Cheers & good luck with it,
-Nic
DDogg
22nd February 2003, 17:09
===> Superman cape to Nic
Wow! This works perfectly:
LoadPlugin("call.dll")
LoadPlugin("mpeg2dec.dll")
LoadPlugin("mpasource.dll")
testcmd="besweet.exe -core( -input matrix.ac3 -output matrix.mp3"
Call(BlankClip, testcmd,"-2")
V=mpeg2source("Matrix.D2V")
A=mpasource("matrix.mp3")
audiodub(V,A)
I had come to think it impossible to do something BEFORE the video event. This adds a new dimension. I'm off to do some expermentation with my head spinning....
Nic, tremendous!
DD
neuron2
22nd February 2003, 17:16
Great work, Nic.
I want to commend you also for including the source. This is something we all should do with every binary release.
DDogg
22nd February 2003, 19:37
How would you change this command that uses quotes (from BeSweet GUI) to work with the CALL command? Possible?
"BeSweet.exe" -core( -input "Matrix.ac3" -output "matrix.mp2" ) -azid( -c light -L -3db --maximize ) -2lame( -m d -b 192 -e ) -profile( DSPguru_MP2@192kbps )
The manual says:
"string: surrounded either by "quotation marks" or by ``TeX?-style quotes''. A text string can contain any character except the terminating quotation mark or double-apostrophe. If you need to put a quotation mark inside a string, use the TeX?-style notation. Alternately, you can use Windows extended-ASCII curly-quotes instead of straight quotes to get around this limitation.
I tried replacing the standard double quotes with curly ones “” but that did not work. I don't have a clue what a TeX style quote is.
neuron2
22nd February 2003, 19:46
Originally posted by DDogg
I tried replacing the standard double quotes with curly ones “” but that did not work. I don't have a clue what a TeX style quote is. Use two single back-quotes to begin a quotation and two single quotes to end it. The usual double quote symbol doesn't produce the correct result.
DDogg
22nd February 2003, 20:04
Use two single back-quotes to begin a quotation and two single quotes to end it. The usual double quote symbol doesn't produce the correct result.
I'll go back and try it again. Like this ``stuff''?
Edit: Nope, this no worky for me (just drops through as if it saw a #):
testcmd="``c:\Program Files\DVD2SVCD\BeSweet\BeSweet.exe'' -core( -input ``d:\Matrix\Matrix.ac3'' -output ``d:\Matrix\matrix.mp2'' ) -azid( -c light -L -3db --maximize ) -2lame( -m d -b 192 -e ) -profile( DSPguru_MP2@192kbps )"
Not using the quotes seems to work ok. This works fine.
testcmd="BeSweet.exe -core( -input Matrix.ac3 -output matrix.mp2 ) -azid( -c light -L -3db --maximize ) -2lame( -m d -b 192 -e ) -profile( DSPguru_MP2@192kbps )"
Belgabor
22nd February 2003, 20:33
I think I read somewhere that avisynth also accepts TeX stryle quotes, so that my be the reason why it doesnt work. I belive the quotes for besweet are only needed (like with windows commands) if the argument contains white space. I don't know if avisynth allows to escape quotes in strings, otherwise the plugin has to be modified to replace some special character with "
neuron2
22nd February 2003, 20:34
I was just answering your question about what TeX-style quotes are. Beyond that... :confused:
Glad you have things working, however!
DSPguru
23rd February 2003, 20:50
DDogg :),
you might wanna replace -2lame( ) with -toolame( ) .. ;)
http://forum.doom9.org/showthread.php?s=&threadid=35480
Nic
23rd February 2003, 20:54
How about I update it so you can do:
testcmd="c:\BeSweet.exe -core( -input `d:\The Matrix\Matrix.ac3' -output `d:\The Matrix\matrix.mp2' )"
and then call will convert all 's into "s before creating the process.
Sound good?
-Nic
DDogg
24th February 2003, 00:51
@DSPguru - Hey, long time. Besweet has just got better and better. Congrats! As to your comment:
you might wanna replace -2lame( ) with -toolame( ) ..
Er, I just pasted the command line from DD's GUI..Are you speaking of your new beta version D9 mentioned? I is Cunfoosed :confused:
@Nic, Well (scratching head), I don't think you would want to introduce a new convention. If CALL could honor the same convention tex style quotes as Avisynth like `stuff''<note two single 's as per neuron2's post (below) then wouldn't that be more in keeping with AviSynth? Or, am I completely confused yet again? If so, I am sure your suggestion would work just fine.
Use two single back-quotes to begin a quotation and two single quotes to end it. The usual double quote symbol doesn't produce the correct result.
DSPguru
24th February 2003, 19:57
Originally posted by DDogg
@DSPguru - Hey, long time. Besweet has just got better and better. Congrats! thanks, it's great to see you here :)!
Er, I just pasted the command line from DD's GUI..Are you speaking of your new beta version D9 mentioned? I is Cunfoosed :confused: yes. the latest beta supports, in addition to mp2enc encoding, toolame encoding. check out latest DD's GUI (b70 ;)).
DDogg
6th March 2003, 22:50
@Nic
Is this already possible with the CALL command and I am missing it or would there be a way to add calling a dos command? Like:
testcmd="Echo HELLO NIC > d:\test.txt"
Call(BlankClip, testcmd,"-2")
Your best bet is to try it and see if it works :) It might not because CreateProcess may not be able to call echo (as echo is built into command.com or equivalent)
so if it doesnt work try:
testcmd="cmd.exe /c Echo HELLO NIC > d:\test.txt"
Call(BlankClip, testcmd,"-2")
if on a winnt based system or replace cmd.exe with command.com for Win95/98 systems.
That should definitely work.
Sorry Ive been a bit late with the other version, im swamped with work (& clients who won't pay ;) ) at present :)
Cheers,
-Nic
DDogg
7th March 2003, 17:10
Nic, thanks for your reply and the solution. I had tried the straight commands as well as putting command.com in front and they did not work. However, when the /c parameter you suggested was added IT WORKS perfectly. Also, I found (on XP) just using CMD /c works as well.
This seemingly small thing will allow the CALL command to open up basic disk output for reportage and, I think, the storing of variables for later use in other scripts via the avisynth import command.
Small and poor example of reportage:
loadplugin("call_25.dll")
v=avisource("Tape 1 - Clip 001.avi")
r="Report: "+"%time%"+" "+"%date%"+" " "#duh, how LF or CR to put rest of report on new line after report header???
fct= "Framecount: "+ string(v.framecount)+"
frt="Framerate: "+ string(v.framerate)+" "
w="Width "+ string(v.width)+" "
h="Height "+ string(v.height)+" "
a="Audiorate "+ string(v.audiorate)+" "
sendout=r+fct+frt+w+h+a
testcmd="cmd /c Echo " +sendout+ " > d:\test.txt"
Call(BlankClip,testcmd,"-2")
return(v)
Maybe somebody that really knows what they are doing can do up a proper example. All the clip properties as well as any internal strings, which could be filter parameters, filenames, etc., would be reportable or available to output as reusable variables (import???)
DDogg
8th March 2003, 15:43
Nic, to some degree, the call command introduces a framebased "before, during and after concept", i.e, call("externalprog.exe","0,50,-1") implements the external at frame 0,50, and the last frame of the "video event".
I have some thoughts running around in my head and it would be useful to know if, hypothetically from a code standpoint, would it be possible for CALL to use an internal function as well as an external program,i.e., call ("internalfunction","0,50,-1")?
Oh, a second question, from a code standpoint, what are the ramifications of using the CALL command separately multiple times in a script? Do you see this as a problem? I ran into some problems when I tried something like this:
LoadPlugin("call_25.dll")
version
testcmd="info.bat"
Call(testcmd, "0")
Import("info.avs")
starttime=time
Call(testcmd, "-1")
Import("info.avs")
lasttime = time
#Now you would have a start time and a finish time in variables to use to generate a report.txt using Call and CMD /c echo + stuff + > report.txt
bilu
8th March 2003, 16:16
Nic,
Just to add another concept to Ddogg's idea, do you think it is possible to call (internal functions or external commands) at certain events, like in a WHILE function?
Example: call(internalfunction,my_variable>1) would run internalfunction while the flag I defined is bigger than 1.
[EDIT]
Oh great Master, please look
here (http://forum.doom9.org/showthread.php?s=&threadid=48127) for inspiration :D
Best regards,
Bilu
After reading that thread I get what you mean now :) lol
Well I know theres an Invoke function I could call in AviSynth but I dont know how flexible it is (or anything about it to be honest). Ill look into it.
At present I dont seem to be able to concentrate on one topic, ive fiddled with my mpeg-2 transcoder/my mpeg-2 directshow filter and dvd2avi_nic today and dont feel like doing any more on any of them. So it may be a while before I look into it, but ill try :)
Cheers,
-Nic
DDogg
9th March 2003, 23:19
So it may be a while before I look into it, but ill try
We couldn't ask any more. You have been real decent about considering some of these more "unusual" ideas. I do think the resulting additional power and flexibility would make it worth your time and who knows, maybe a little fun. It would most certainly be appreciated by many (quite a few of who, at the moment, have no idea what this would be useful for :-) lol)
Best regards,
DD
Wilbert
10th March 2003, 10:43
#duh, how LF or CR to put rest of report on new line after report header???
Did you solve this?
bilu
10th March 2003, 11:10
@Wilbert,
Take a look here. (http://forum.doom9.org/showthread.php?s=&threadid=47972&pagenumber=2)
Haven't tried it yet.
Best regards,
Bilu
Nic
10th March 2003, 12:37
Well very quickly thrown together:
http://nic.dnsalias.com/Call.zip
Sorry no "while" feature yet, but now you can use ' as " to allow for long filenames etc
also included is a little app called NicEcho which can be used like:
Call(BlankClip, "d:\NicEcho.exe @d:\report.txt 'Appending\nHello\nAppended'", "-2")
Which would append to a text file called d:\report.txt the text:
Appending
Hello
Appended
etc.
Hope this helps some, sorry its not much but its start, sorry for the hurried post. At work at present.
-Nic
DDogg
10th March 2003, 17:57
Nic, all these superman capes are going to get heavy. This is awesome!
Here is a reference for anybody playing with Nic's new toy. I am not quite sure why the two ' used in addqt works, but it does.
loadplugin("call_25.dll")
loadplugin("chr.dll")
addqt="''"
hdr="'"
systime=(Time("%I:%M:%S"))
MyTextString="Now is the time \nfor all good men\nTime="
stuff=hdr+MyTextString+addqt+systime+addqt+hdr
Call(BlankClip, "nicecho.exe report.txt " + stuff, "-2")
version()
report.txt contains:
Now is the time
for all good men
Time="04:13:00"
@Nic, thinking out loud, if nicecho.exe could grab the present systime and you could provide a variable? (\systime, \sysdate \sysday) in nicecho.exe when it was called ??? Make any sense to you?
I am still after a straightforward way to get elapsed time from "0" to "-1". Maybe this is already in front of me and I have not seen it yet.
bilu
10th March 2003, 19:33
Originally posted by DDogg
I am still after a straightforward way to get elapsed time from "0" to "-1". Maybe this is already in front of me and I have not seen it yet.
It has allways been if the front of us all but we never used it: the time reported in the AVI stream itself, that you can see in media players where you preview an AVS. We just need a filter to grab it! ;)
(I think)
Best regards,
Bilu
DDogg
10th March 2003, 20:02
Delete
DDogg
10th March 2003, 21:22
More reference stuff - added Warpenterprises CHR plugin for date functions. Edit: Well this will definately creates a base report BEFORE the clip starts playing and appends AFTER the last frame. If nicecho could somehow have a \timevariable for use we could do elapsed time.
loadplugin("call_25.dll")
loadplugin("chr.dll")
avifname="Tape 1 - Clip 001.avi"
v=avisource("Tape 1 - Clip 001.avi")
hdr="'"
FmCt= "\nFramecount = " +string(v.framecount)
FmRt="\nFramerate = "+ string(v.framerate)
W="\nWidth = "+ string(v.width)
H="\nHeight = "+ string(v.height)
A="\nAudiorate = "+ string(v.audiorate)
StTime=(Time("%I:%M:%S %p"))
FinTime=(Time("\nFInish Time %I:%M:%S %p"))# until I can figure out how
FilterParams="nada"
Dte=(Time("Date: %A %x Time: %I:%M:%S %p"))
RptHdr="REPORT: "+dte +"\nFilename: "+avifname + "\nStart Time: " + StTime +"\nParameters: " + FilterParams
stuff=RptHdr+Fmct+FmRt+w+h+a
Call(v,"nicecho.exe report.txt " +hdr + stuff + hdr, "-2")
Call(v,"nicecho.exe @report.txt " +hdr+fintime+hdr, "-1")
Outputs:
REPORT: Date: Monday 03/10/03 Time: 07:43:30 PM
Filename: Tape 1 - Clip 001.avi
Start Time: 07:43:30 PM
Parameters: nada
Framecount = 25346
Framerate = 29.970030
Width = 720
Height = 480
Audiorate = 48000
FInish Time 07:43:30 PM
bilu
11th March 2003, 13:11
Nic,
I hope that this post (http://forum.doom9.org/showthread.php?s=&postid=276847#post276847) can be helpful. ;)
Best regards,
Bilu
DDogg
28th March 2003, 03:25
Nic was nice enough to send me another version of NicEcho.exe that now will output the time by using a \t in the output. Just the exe, see the previous package for call.dll and docs. You can get it here:
http://nic.dnsalias.com/NicEcho.exe
I am happy to say you can now do before video and after video events such as start time and end time: This is pretty rough but works well enough for an example.
#loadplugin("call_25.dll") load not needed if in plugin dir
#loadplugin("chr.dll") from WarpEnterprises Website, used for date but does a whole lot more
hdr="'"
avifname="test_MC.avi"
v=avisource(avifname)
FmCt= "\nFramecount = " +string(v.framecount)
FmRt="\nFramerate = "+ string(v.framerate)
W="\nWidth = "+ string(v.width)
H="\nHeight = "+ string(v.height)
A="\nAudiorate = "+ string(v.audiorate)
StTime="\nStart Time \t" # < \t outputs the current time
FinTime="\nFinish Time \t"
Dte=(Time("Date: %A %x Time: %I:%M:%S %p")) #this from chr.dll
RptHdr="REPORT: "+dte +"\nFilename: "+avifname+ StTime
stuff=RptHdr+Fmct+FmRt+w+h+a
Call(v,"nicecho2.exe report.txt " +hdr + stuff + hdr, "-2") #runs before video
Call(v,"nicecho2.exe @report.txt " +hdr+fintime+hdr, "-1") # after video
#The @report.txt above appends to previous report.txt
Outputs Report.txt to disk
REPORT: Date: Thursday 03/27/03 Time: 08:12:16 PM
Filename: test_MC.avi
Start Time 20:12:16
Framecount = 758
Framerate = 29.970030
Width = 720
Height = 480
Audiorate = 48000
Finish Time 20:12:42
DDogg
28th March 2003, 14:43
Sh0dan, Nic, anybody that might know, a theory question:
Main question - In theory would it be possible for the call command to do multiple tasks while it is in an active state?
Not to distract from the main question and just as a poor example: Say we had a separate file called dothis.call with several actions and execute it with:
call(blankclip,"execute d:\dothis.call","-2")
Contents of external file named "dothis.call" (or marked in a script something like a function?)
dothis.call
# whatever multiple avisynth keywords/actions
NicEcho.exe output some variables
Import something using avisynth import command
internal variable=imported variable
end
Bidoche
28th March 2003, 15:47
won't Import("mycalls.avs") do the job ?
DDogg
28th March 2003, 15:54
er, I am not too swift at this, but I did not think the call command would do an internal command? The import command would have to be done within the call command to cause import to activate at the prescribed place in the video event. I will see if I can figure it out and try. If you have an example in mind it would be appreciated.
/edit After quite a few experiments I do not think it is possible to execute a avisynth internal command like Import from within the CALL command. If I find out different I'll update.
Still looking for "Main question - In theory would it be possible for the call command to do multiple tasks while it is in an active state?", Bidoche?
bilu
29th March 2003, 11:44
Hi Ddogg,
I'm still trying to figure out what you want, but please confirm me if it is this:
(from an old example :) )
INFO.BAT
=========
del c:\info.avs
for /F "usebackq" %%i IN (`time /t`) DO @echo Time=%%i > c:\info.avs
for /F "usebackq" %%i IN (`date /t`) DO @echo Date=%%i >> c:\info.avs
In AVS script
==============
CALL(BlankClip,"c:\info.bat","49")
Import("c:\info.avs",50) --> would import at frame 50 ?
I don't know if the script would stop rendering until the CALL command finishes ... :confused: it could be the only way to know if it would be safe to import a generated script at a specific time.
Also the Import command seems to load the script to generate the filter graph at start, but it should be possible (Bidoche? :) ) to modify Import (or use within a funtion that could be applied to a certain frame range, don't know if that's possible) to load an imported script at a specific frame.
Best regards,
Bilu
Nic
29th March 2003, 12:28
The parameter passed to Call.dll is just a string, and that string is taken as the main parameter to call CreateProcess with. By giving it an avs file, all that would happen is the avs file would be run and probably Windows Media Player would pop up ;)
Ill think about the best way of outputing the full elapsed time, the script idea could get complex ;) Ill also start to play with the Invoke command in avisynth soon.
Cheers,
-Nic
DDogg
29th March 2003, 15:52
This is too long but I'll try to stay focused so the reader will actually stay with me, read it, and answer. A lot of this is assumption on my part so >please< correct me if I am wrong :)
As way of background - Because of the way an avisynth script executes as a video event there is no internal command to set a variable value or execute other commands at a specified point like start of video, Frame XX or EOF. Workarounds are needed to accomplish this.
My post, 6 above this one, creates a report with a StartTime and EndTime in d:\report.txt using Nic's CALL command and new version of NicEcho.exe with the \t addition. A variation could have created a report with StartTime = "20:12:16" and EndTime ="20:12:42". It logically follows to import and calculate elapsed time, or even execute an external processing script, and return variables to the present script for further action.
We start running into problems because the avisynth script does not execute sequentially. In a multiple line statement like:
CALL(BlankClip,"blah","50")
Import("blah.txt")
The import commad cannot be depended on to execute at frame 50, only CALL.
The CALL command can not execute multiple commands sequentially. Nor can it execute internal commands individually or in multiple like (poor example)- CALL (blankclip, "NicEcho.exe d:\report.txt 'Starttime=xx EndTime = xx':Import report.txt:VarA=VarB","-2") (see post 5 bove this one)
This is what my twice, now thrice asked: "Main question - In theory would it be possible for the call command to do multiple tasks while it is in an active state?" was about. Forgetting the internal command for a minute, I was curious about whether CALL could in theory do multiple external commands in a stacked sequence.
Because we only have ONE Start of video event to trigger from, multiple commands in one CALL event would be very handy. If an internal command like Import could be added to the stack it would even better.
I have tried to think of solutions via the CALL command as it may not be realistic to expect any core modifications like the one Bilu mentioned. Sure, I hope to be wrong. If the core team could tie the Import or maybe some other internal commands to SOF, frame XX, or EOF, we would have tremendous added flexibility.
A solution not involving core would be if the call command could execute internal commands like Import and/or "varA = varB". I assume Nic said he was looking at "invoke" to see if this would be possible.
@Bilu, I am trying to stay away from DOS based solutions as they add another layer of kludge and DOS flavors vary from OS to OS.
@Nic - As you and Bilu will no doubt appreciate, this whole dialog is not really about elapsed time. Rather just an example of Disk I/O, external, and hopefully internal commands executed at specified trigger points. My intuition tells me this could allow much additional processing power.
enterprise
9th July 2004, 22:01
Hi, nic.
I checked your Call Plugin and I think it's amazing! It's exactly what I was looking for.
However I have to reload the avi everytime because once Call command is launched it's not launched anymore until I reload the avi. I think it's because Cache but I don't know how can I fix it. I think that if I compile again AviSynth with a different cache value it would work but I don't know how it could be compiled and also I would want that Call plugin would work on a standar Avisynth.
Could you help me?
stickboy
9th July 2004, 22:24
Exactly what do you want to do?
Call is invoked when the script is loaded, not on a per-frame-basis or anything like that.
Edit:
Okay, I don't know what I'm talking about it. I obviously haven't used Call in awhile and had forgotten it does per-frame-stuff.
enterprise
10th July 2004, 09:11
Thank you for your reply!
I want to execute an external command at specific frame even if I play several times the AVI.
Call("c:\Command.exe", "100")
If I open AVI with Mediaplayer, call command is executed only 1 time at frame 100. but if I play again the AVI, the command is not executed.
I am looking for a way to solve it.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.