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.

 Doom9's Forum CALL command
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 28th March 2003, 14:43 #41  |  Link DDogg 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.
 28th March 2003, 15:47 #42  |  Link Bidoche Avisynth 3.0 Developer   Join Date: Jan 2002 Location: France Posts: 639 won't Import("mycalls.avs") do the job ?
 28th March 2003, 15:54 #43  |  Link DDogg 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.
 29th March 2003, 11:44 #44  |  Link bilu 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 ... 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
 29th March 2003, 12:28 #45  |  Link Nic 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 Ill also start to play with the Invoke command in avisynth soon. Cheers, -Nic
 9th July 2004, 21:01 #47  |  Link enterprise 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?
 9th July 2004, 21:24 #48  |  Link stickboy 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.
 10th July 2004, 08:11 #49  |  Link enterprise 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.
 22nd December 2011, 08:34 #50  |  Link vampiredom Registered User   Join Date: Aug 2008 Posts: 233 Reviving this ancient thread... Is this any way to send an apostrophe (') inside an argument without CALL_25.dll converting it to a double quote (")? I've tried \' and everything I could think of but no luck.
25th December 2011, 22:04   #51  |  Link
Chikuzen
typo lover

Join Date: May 2009
Posts: 595
Quote:
 Originally Posted by vampiredom Reviving this ancient thread... Is this any way to send an apostrophe (') inside an argument without CALL_25.dll converting it to a double quote (")? I've tried \' and everything I could think of but no luck.
on DOS-prompt, escape sequence is not \ but ^
__________________
my repositories

26th December 2011, 03:03   #52  |  Link
vampiredom
Registered User

Join Date: Aug 2008
Posts: 233
Quote:
 on DOS-prompt, escape sequence is not \ but ^
Nope. Doesn't work either. I believe CALL_25.dll was made to internally translate single-quotes to double-quotes; to make it easier for people to send long strings as arguments without having to triple-quote things in AviSynth. This works great – except, of course, when you want to include single-quotes in the string!

26th December 2011, 13:55   #53  |  Link
Gavino
Avisynth language lover

Join Date: Dec 2007
Location: Spain
Posts: 3,420
Quote:
 Originally Posted by vampiredom I believe CALL_25.dll was made to internally translate single-quotes to double-quotes; to make it easier for people to send long strings as arguments without having to triple-quote things in AviSynth.
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.
__________________
GScript and GRunT - complex Avisynth scripting made easier

26th December 2011, 19:53   #54  |  Link
vampiredom
Registered User

Join Date: Aug 2008
Posts: 233
Quote:
 it always translates single-quotes to double-quotes - unfortunately, there is no escape mechanism, so the implementation is badly conceived
Yeah, unfortunate. I think I will write a "partner" .exe for CALL_25.dll that allows some kind of escape mechanism. Perhaps I could use ^x, followed by a hex character code. (so that ' would be ^x27). Does that sound like a reasonable workaround for this issue?

 30th December 2011, 21:45 #55  |  Link vampiredom 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 These are then unescaped by my .exe 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"""") Note that you need to define the global CALL_25_Helper_Dir so that CALL_25 can find the helper .exe ... so either modify the line in the .avsi or include the "global" statement in the top of your script: Code: global CALL_25_Helper_Dir = "C:\Program Files (x86)\AviSynth 2.5\plugins\" **EDIT** 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
 31st December 2011, 04:14 #56  |  Link vampiredom 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:") Nifty. Last edited by vampiredom; 31st December 2011 at 04:23.
 15th July 2012, 19:38 #57  |  Link martin53 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.
 15th July 2012, 19:55 #58  |  Link um3k Registered User   Join Date: May 2007 Posts: 220 I wonder if it would be better to use stdin and stdout instead of the clipboard?
 15th July 2012, 21:20 #59  |  Link StainlessS 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 ???
16th July 2012, 20:14   #60  |  Link
martin53
Registered User

Join Date: Mar 2007
Posts: 407
Quote:
 Originally Posted by StainlessS mg262's run_25_dll_20050616 dll WarpEnterprises (Runs a system command. Simple source in text file, very succinct)
hmm, indeed, http://avisynth.org/warpenterprises/...l_20050616.zip could be a close to perfect starting point. Today, it just returns the unchanged clip. This would need some work.