Log in

View Full Version : avisynth script as source in another script?


slavik
29th January 2005, 01:15
MPEG2 -> d2v -> avisynth script (telecide, etc)

I want to make another script where the above avisynth script is the source (I don't want to stick them together for various reasons)

using avisource() doesn't produce the wanted result, is there another way to do this? (besides encoding the first script with quant1)

Mug Funky
29th January 2005, 04:09
there's also import("path\avs.avs"), but that's more for loading functions and i'm not really sure how it would behave with a regular script. by all means try it, because it certainly wont break anything (but it may crash virtualdub, which is no problem).

stickboy
29th January 2005, 05:02
Originally posted by slavik
using avisource() doesn't produce the wanted result, is there another way to do this?Using AVISource on the other .avs script is the proper way.

Why doesn't it produce the wanted result? Exactly what's wrong with it?

actionman133
29th January 2005, 11:53
Import works fine. It doesn't input video frames, like AVISource or DirectShowSource would. Rather it imports and executes the script, which results in the frames that you are looking for.

I use it for an 'AVISynth DVD player', where I input scripts for core processing. I've been using it for the better part of a year without a single hitch.

slavik
29th January 2005, 19:36
all frames appear to be "green" (just green completely)

Originally posted by stickboy
Using AVISource on the other .avs script is the proper way.

Why doesn't it produce the wanted result? Exactly what's wrong with it?

EDIT: here's the script
AviSource("ep6.d2v.avs")
ConvertToYUY2()
MultiDecimate(pass=1)


EDIT2: import worked fine, so I'll use that :)

stickboy
29th January 2005, 20:33
Originally posted by actionman133
Import works fine.Import may work fine for some cases. It can't avoid namespace collisions, and if the source script has an explicit "return" statement, it won't work at all.

slavik:
You only posted one script. What's the other one?

slavik
2nd February 2005, 06:19
the imported script is generated by YATTA (telecide)

Originally posted by stickboy
Import may work fine for some cases. It can't avoid namespace collisions, and if the source script has an explicit "return" statement, it won't work at all.

slavik:
You only posted one script. What's the other one?

kingmob
2nd February 2005, 13:35
Avisource should work fine, i've used it on several occasions already. And as somebody else pointed out already, using import can cause some unnexpected errors, especially in the naming of variables.

actionman133
3rd February 2005, 08:22
some unnexpected errors, especially in the naming of variables
I actually rely on this for my player to function. I have a script that declares values all the necessary variables (filenames, framerates, etc). all it does is assign values to strings, booleans integers and floats. the final line is the import line, which imports core code that all the scripts access.

the core uses the same variables (and of course, variable names) as were used in the assigning script. i do it this way so that when i update the core, it affects everything that i watch with it.

i don't you can call the 'variable names' issue an error or bug in the software. if anything, it is an error in the user's scripting process.

E-Male
3rd February 2005, 08:35
wasn't there a quote like:

"one man's bug is the other man's feature"

[a lil updated :) ]

actionman133
3rd February 2005, 08:43
i get what you mean by it. i suppose i should cherish my treasure...

stickboy
3rd February 2005, 09:38
Originally posted by actionman133
I actually rely on this for my player to function. I have a script that declares values all the necessary variables (filenames, framerates, etc). all it does is assign values to strings, booleans integers and floats. the final line is the import line, which imports core code that all the scripts access.We're talking about two different things.

Of course in your case it's fine; you've written two scripts designed to work together. Import is doing its job and behaving as expected. If this weren't the case, functions couldn't be shared without copying and pasting.

No, what we're talking about here is where the included script represents a self-contained clip that can (and usually should) be treated as a black box.

kingmob
4th February 2005, 11:25
Originally posted by actionman133

i don't you can call the 'variable names' issue an error or bug in the software. if anything, it is an error in the user's scripting process.
That is what i meant. Well, what i really meant was, that by using import, the error would be made faster and would be harder to track down.