-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVISource and DirectShowSource both changing A/V type - where's the flaw? #286
Comments
Two things could be happening, depending on how the graph is being constructed: That said, for the task of
that would probably be better handled by For one, There's also the risk that trying to essentially chainload AviSynth.dll through itself on multiple invocations of |
Thanks for the tip. Switching to |
Ah, yeah, the documentation seems to mention something like that. I don't know if it'd work, but if you wrap the contents of the child script into a function, I would think it would preserve the state of the child script when imported and then invoked by calling the function in the master script. It'd just be woefully inefficient if most of the child scripts use the same or very similar filtering. To illustrate (and somewhat for the benefit of anyone stumbling onto this through Google), test.avs
And test2.avs
And import.avs
import.avs plays back the regular Version info for 10 seconds, then a negative of it for 10 seconds. But we can do something like this in test2.avs instead (the indentation is just for readability):
And then in import.avs
And it outputs exactly the same thing as the first import.avs example, except that test2.avs was changed into a function, and you call the function. |
So would this function do what I think it'll do, i.e. isolate the imported .avs and supply only its video output?
|
If you're defining it as a function, it should be done in the child script, not the master script, and so If you can provide a more concrete example where the variable(s) in the scripts aren't honored when using |
The issue is rather the opposite. I'm trying to keep the .avs I'm importing from, for instance, overwriting e: here's a test case. I created t1.avs:
And t2.avs:
I would expect, on loading t1.avs, to see the contents of test.mkv. Instead, bizarrely, I see a blank clip without the info, meaning I'm getting neither the expected result nor the glitch I expected to get, i.e. the contents of t2.avs! However, if I change t1.avs to:
...then I get test.mkv as intended. |
Okay, I see more of what's going on now. Let me see.
You get Version, same as you would if you were using the implicit last.
You get the contents of t2.avs, same as if you were using the implicit last.
You get Version(). Same with the implicit last.
You get t2.avs. But the implicit last,
is now broken. This seems like it might be a bug, because (as far as I know) variables other than last should not be considered implicit, and last shouldn't be equivocating itself to a declared variable (that part may be up for debate, but if the user explicitly calls last you might be able to make an argument for why it should equivocate; I'd argue that it would make sense for implicit last to ignore declared variables, though). But the more concerning thing is that it breaks at all. Basically, the skip does seem to be functioning, in that it refuses to load z into last without the user having invoked either z or last explicitly, but under other circumstances it should have fallen back to the non-variable-invoked Version() instead.
Which implies that it's mangling the script being imported. Changing t2.avs to
t1.avs's implicit last is still broken, but explicit last returns Version(), and
returns t2.avs. Although to be fair, the z= declaration is meaningless here, because Import is importing the function, not the source (per ce), and something like z=here fails the exact same way the implicit last does above. To make that work, you actually need to do something like:
Honestly, my gut feeling is that a lot of this might simply be undocumented edge case behaviors with an actual explanation, it just rarely occurs because script writing tutorials try to avoid writing scripts with unclear variable usage that end up conflicting this way. For instance, I would never try to At this point I'll say that maybe @pinterf or @magiblot or one of the other contributors might have a much better explanation/take on what it's actually doing here, and so I'll just hand it off to them. So the other part of the t2.avs weirdness:
ffplay displays the alpha channel as a black screen. mpv displays it as the typical transparency checkerboard. The output of Info() is there, but because BlankClip creates an RGBA clip by default, it's being obscured by how libavformat-based players display the alpha channel. If you open it in VirtualDub, it'd display the Info() readout. Similarly, if you either use |
I have a file,
t1.avs
, that's simplyConvertAudioToFloat(BlankClip())
. Running ffprobe on it gives me this:I have a second file,
t2.avs
, that's simplyDirectShowSource("t1.avs")
. Running ffprobe on it gives me this:Changing
DirectShowSource()
toAVISource()
doesn't help. I'm combining the output of several .avs files into a master .avs file, and I don't know if this counts as a bug or if I'm doing something wrong...The text was updated successfully, but these errors were encountered: