Log in

View Full Version : get clip path


puins
14th October 2010, 17:29
Hello

I need to get the clip path so that I can extract the directory and store additional info in that directory. I did not see anything in the Clip class. I saw a thread were it said maybe throw and catch the exception and parse it to get the path. I would like to be able to get the path within the avisynth code itself. Please let me know if possible. Thank you.

Regards

Groucho2004
14th October 2010, 17:59
Not sure what you mean.

If you load a clip with "AVISource" or "DirectShowSource" you can parse the line that loads the clip and get the path from there. If the load statement does not specify a path, the directory is the same as the one that holds the script.

puins
14th October 2010, 18:50
Thanks for the reply. I just realized that what I need is the avs file directory. ie. I run a bbb.avs file via a batch file with WMP as the player. Now within the avisynth plugin layer I need to find the directory for the avs file. If within the script layer I can extract that directory and pass it to the plugin, that would work too. Only thing I can't do is specify the script path as a variable in the script file. The reason for that is scripts are being moved around and use relative path.

puins
14th October 2010, 19:00
I think I just figured it out. I should be able to call GetCurrentDirectory to get current directory of the scirpt. Please correct me if I am wrong. thx.

Gavino
14th October 2010, 19:03
Now within the avisynth plugin layer I need to find the directory for the avs file.
During instantiation of the plugin, the directory of the calling avs file will be the Windows current directory, which can be found through the standard Windows API.