Log in

View Full Version : Can a script load another script as it's source file?


FredThompson
6th July 2003, 23:20
The best way to illustrate this question is with a real-world example:

I've got a 1 hour TV capture which has 9 distinct content segments to be kept and made into individual encodes because this is a safe/easy way to set/enforce chapter points, especially because TV content is organized in this manner.

I've got a filtering script which is working very well on this source.

Obviously, each segment could be processed and stored as a distinct file. However, this has some real drawbacks; space and possible corruption by the storage codec.

Is there a way to import a script as the source by another script?

This would allow construction of a 9 short scripts. Each would load the primary filtering script and limit what they return to a range of frames.

Those short scripts could, in turn, be used to build a batch job for compression.

The result, after compression, would be 9 separate compressed files.

It would also make analog capture and editing of TV source a much quicker process: capture the source, tune the processing script, pick your break points, write the mini-scripts, start a batch encode.

Guest
7th July 2003, 00:39
Originally posted by FredThompson
Is there a way to import a script as the source by another script? Import(). :)

FredThompson
7th July 2003, 00:50
Huh...that makes sense. Variables in an imported script have the same scope and naming or do they have to be accessed like: scriptname.variablename?

Guest
7th July 2003, 01:36
It is as if the imported script is written in-line.

stickboy
7th July 2003, 02:46
From the documentation:
AVISource takes as argument one or more file name in quotes, and reads in the file(s) using either the Video-for-Windows "AVIFile" interface, or Avisynth's built-in OpenDML code (taken from VirtualDub). This filter can read any file for which there's an AVIFile handler. This includes not only AVI files but also WAV files, AVS (Avisynth script) files, and VDR (VirtualDub frameserver) files.Note that you if you use AVISource, you won't be able to access the namespace of the included script.

Dark-Cracker
7th July 2003, 12:01
for using params (like source name) beetween original and imported script u can use "global" variables.