Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#41 | Link |
Retired, but still around
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
|
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 Last edited by DDogg; 28th March 2003 at 15:27. |
![]() |
![]() |
![]() |
#43 | Link |
Retired, but still around
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
|
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? Last edited by DDogg; 29th March 2003 at 01:46. |
![]() |
![]() |
![]() |
#44 | Link |
Registered User
Join Date: Oct 2002
Location: Portugal
Posts: 1,182
|
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 ... ![]() Also the Import command seems to load the script to generate the filter graph at start, but it should be possible (Bidoche? ![]() Best regards, Bilu |
![]() |
![]() |
![]() |
#45 | Link |
Moderator
![]() Join Date: Oct 2001
Location: England
Posts: 3,285
|
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 ![]() Cheers, -Nic |
![]() |
![]() |
![]() |
#46 | Link |
Retired, but still around
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
|
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. Last edited by DDogg; 29th March 2003 at 19:25. |
![]() |
![]() |
![]() |
#47 | Link |
Registered User
Join Date: Jul 2004
Posts: 6
|
Call command
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? |
![]() |
![]() |
![]() |
#48 | Link |
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
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. Last edited by stickboy; 10th July 2004 at 09:03. |
![]() |
![]() |
![]() |
#49 | Link |
Registered User
Join Date: Jul 2004
Posts: 6
|
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. |
![]() |
![]() |
![]() |
#51 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
on DOS-prompt, escape sequence is not \ but ^
__________________
my repositories |
![]() |
![]() |
![]() |
#52 | Link | |
Registered User
Join Date: Aug 2008
Posts: 233
|
Quote:
|
|
![]() |
![]() |
![]() |
#53 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,420
|
Looking through the thread (original was before my time), it seems people were unaware you could use triple-quotes, or perhaps that facility didn't exist back then. Anyway, I've had a look at the CALL source code and it always translates single-quotes to double-quotes - unfortunately, there is no escape mechanism, so the implementation is badly conceived.
|
![]() |
![]() |
![]() |
#54 | Link | |
Registered User
Join Date: Aug 2008
Posts: 233
|
Quote:
|
|
![]() |
![]() |
![]() |
#55 | Link |
Registered User
Join Date: Aug 2008
Posts: 233
|
CALL_25_Helper
Download
OK, I made this little "helper" app to allow single-quotes (and just about any other funky chars, theoretically) to be passed via CALL_25.dll The following chars need to be escaped, like such: Code:
^ -> ^x5E ' -> ^x27 \ -> ^x5C " -> ^x22 There is also its buddy-function for AviSynth, CALL_25_Helper(), which does the escaping automatically. Code:
# Modify the CALL_25_Helper_Dir variable to contain the path to CALL_25_Helper.exe # This path should end with a trailing slash (or backslash) # example: # global CALL_25_Helper_Dir = "C:/Program Files (x86)/AviSynth 2.5/plugins/" global CALL_25_Helper_Dir = "" # CALL_25_Helper() # Usage examples: # CALL_25_Helper("c:\path\to\foo.exe", "argument1 argument2 argument3") # CALL_25_Helper("c:\path\to\bar.exe", """-a "quoted string #1" -b "quoted string #2"""") Code:
global CALL_25_Helper_Dir = "C:\Program Files (x86)\AviSynth 2.5\plugins\" Note: In reality, only the ' and " chars truly need to be escaped. The reason ^ gets escaped is to avoid any confusion with the escape sequence (though this is improbable). The \ gets escaped only because my .exe will sometimes interpret it as an escape char when passed inside of an argument (such as the case of \", which would be an escaped quote). Safety first. Last edited by vampiredom; 31st December 2011 at 04:29. Reason: clarification of the escape sequences |
![]() |
![]() |
![]() |
#56 | Link |
Registered User
Join Date: Aug 2008
Posts: 233
|
Another interesting thing about the CALL_25_Helper ...
Since the command is ultimately being executed by the CALL_25_Helper.exe (instead of directly by CALL_25.dll) it now possible to execute system commands ... and you can omit the full path when the the executable is in the system path. A simple example: Code:
# Open up a Windows Explorer window @ drive d: from AviSynth CALL_25_Helper("explorer", "d:") Last edited by vampiredom; 31st December 2011 at 04:23. |
![]() |
![]() |
![]() |
#57 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
Hi nic, vampiredom or anyone interested and capable of doing this,
is there anyone who likes to help me with this idea: - Add a clip parameter to call, and make the call plugin first copy the current frame to the clipboard before executing the command - allow call to execute the command with every frame - wait for the command to finish, then copy the clipboard content to the return clip (you got it: the command changed the frame in the clipboard) - maybe add another clip parameter which gives the assumed return clip properties for the graph creation phase of the AviSynth script The use case I have in mind is to call ImageMagick operations inside an AviSynth script. Even if it might me slow, all available ImageMagick operations would be accessible at one stroke. I am specifically interested in the fourier and other transform features, which are slow anyway. The command would be the ImageMagick script, of course, that would start and end reading/writing the clipboard. Just to allow the command to change the dimensions or other clip properties, it would be useful to give the extended call plugin the 2nd clip as prototype for ImageMagick's return data. Last edited by martin53; 15th July 2012 at 19:55. |
![]() |
![]() |
![]() |
#59 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,155
|
mg262's run_25_dll_20050616 dll WarpEnterprises (Runs a system command. Simple source in text file, very succinct)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#60 | Link | |
Registered User
Join Date: Mar 2007
Posts: 407
|
Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|