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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 22nd July 2026, 09:43   #3721  |  Link
LigH
I shot my foot with sugar
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Leipzig, Saxony, Germany
Posts: 7,392
Core filters: Overlay and mask filters: The entry for Mask links to Layer instead of Mask.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 28th July 2026, 18:48   #3722  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
The format support in avs+ is genuinely confusing. I tried to construct the constant for YUV440. And it doesn't error on construction. Instead it errors when creating a frame.

The relevant code is here:
https://github.com/AviSynth/AviSynth...ynth.cpp#L4377

Why have such an elaborate set of flags for subsamplings if I can't use them?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 28th July 2026, 19:42   #3723  |  Link
v0lt
Registered User
 
Join Date: Dec 2008
Posts: 2,449
Quote:
Originally Posted by Myrsloik View Post
The format support in avs+ is genuinely confusing. I tried to construct the constant for YUV440. And it doesn't error on construction. Instead it errors when creating a frame.
You can't just come up with a new format ID and hope it works.
v0lt is offline   Reply With Quote
Old 28th July 2026, 19:56   #3724  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,701
Quote:
Originally Posted by v0lt View Post
You can't just come up with a new format ID and hope it works.
Sure can. Just did.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th July 2026, 07:14   #3725  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,558
I'm on long holiday till July 31st w/o PC, and will continue pending tasks in August.
pinterf is offline   Reply With Quote
Old 29th July 2026, 19:07   #3726  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,515
The enums to control for color constants are basically just for being pieced together for the core's I/O, any new format needs to be explicitly defined and exported rather than made on the fly. It probably wouldn't hurt to actually provide some mechanism for that, albeit with a massive caveat utilitor attached.

That said, https://github.com/AviSynth/AviSynthPlus/pull/502

If there is some sort of problem for C++ plugins accepting what's in that PR, then sure. But it worked for libavformat being able to display the output of Version(pixel_type="YUV440") (or YUV440P10, P12).
qyot27 is offline   Reply With Quote
Old 17th August 2026, 23:17   #3727  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 465
How much headache would it be to add namespaces to .avs scripts?

C++ supports namespaces and it looks fairly simple but I have no idea how the script parser works so it could be a nightmare for all I know.

I need namespaces for 2 reasons:

1. I use many ScriptClips all in the one .avs file, and to "see" outside of ScriptClip from within you need to use globals and gosh I have a lot of them now cause my ScriptClips uitlize many runtime frame counters, thresholds etc. that need to be read and/or modified by all ScriptClips at runtime. If I could put it all into a namespace then that avoids polluting the global namespace.

2. I can only call my main function once otherwise the second call would start overriding globals used by the previous call. With a namespace I could assign each function call a new namespace and avoid the issue.

Currently my plan to reduce my global namespace pollution is to append some random numbers or characters to the end of every one of my global names (big job) and then put some logic to disallow multiple calls.

But obviously a namespace would be much nicer.

If we take ScriptClip out of the equation, namespaces wouldn't be needed as we could just pass everything as function arguments. But actually even that might not work because there is a very conservative limit to the number of function arguments allowed by Avisynth, which I'm already brushing up against.

I had thought to maybe put all variables into 1 big array and pass that around as an argument, but that won't work either cause they can only be accessed by an integer index not a string index - you can't go globals["variable_name"]. And then if you want to modify it you can't go globals[0] = 3.14 because that's invalid you have to go globals = ArraySet(globals , 3.14, 0) which is probably slow too.

flossy_cake is offline   Reply With Quote
Old 18th August 2026, 00:47   #3728  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,888
I feel like I may have asked this before, but is there any way to access frame properties without having to get a PVideoFrame via GetFrame, and if not, should there be?

For example: some source filters will put the frame type (I, P, B) in a frame property. It could be very useful to scan all of these when a script loads, but if it means generating every frame then then it'll take far too long.

Conceptually it seems like frame properties should exist somewhere independent of video frame pixels. Or are the two inexorably tied together for backwards compatibility?
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 18th August 2026, 03:58   #3729  |  Link
v0lt
Registered User
 
Join Date: Dec 2008
Posts: 2,449
Quote:
Originally Posted by flossy_cake View Post
How much headache would it be to add namespaces to .avs scripts?
I don't want new features right now. I'm waiting for the release!
v0lt is offline   Reply With Quote
Old 18th August 2026, 06:29   #3730  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 465
Quote:
Originally Posted by wonkey_monkey View Post
I feel like I may have asked this before, but is there any way to access frame properties without having to get a PVideoFrame via GetFrame, and if not, should there be?

For example: some source filters will put the frame type (I, P, B) in a frame property. It could be very useful to scan all of these when a script loads, but if it means generating every frame then then it'll take far too long.

Conceptually it seems like frame properties should exist somewhere independent of video frame pixels. Or are the two inexorably tied together for backwards compatibility?
I think I've asked a question like that before too but in the context of scripts, whether doing a PropGet forces a GetFrame.

The answer was yes, and I think it's by design since frame properties could be derived from the pixels, so the pixels have to be evaluated anyway.

eg. filters that write frame difference metrics, or scenechange status, or update the field order would need to evaluate the frame to calculate such properties.

But the source filter seems to be an exception to the rule, because its frame properties aren't calculated from Avisynth clip pixels, so I think you are right and it should be theoretically possible to make a special code path for source filter frame properties that doesn't require an internal GetFrame.

But I'm having trouble understanding how this could be a performance issue if you are getting the frame properties immediately after the source filter in which case you should be getting probably thousands of frames per second in a benchmark. What's your use case scenario? Are you trying to prescan the source filter's frame properties of every frame? Like, potentially hundreds of thousands of frames?

Last edited by flossy_cake; 18th August 2026 at 06:32.
flossy_cake is offline   Reply With Quote
Old 18th August 2026, 15:58   #3731  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 609
Quote:
Originally Posted by wonkey_monkey View Post
I feel like I may have asked this before, but is there any way to access frame properties without having to get a PVideoFrame via GetFrame, and if not, should there be?

For example: some source filters will put the frame type (I, P, B) in a frame property. It could be very useful to scan all of these when a script loads, but if it means generating every frame then then it'll take far too long.

Conceptually it seems like frame properties should exist somewhere independent of video frame pixels. Or are the two inexorably tied together for backwards compatibility?
This is more related to the source filters. They know the frame type without decoding needed. So, the source filter can expose function to get only frame type without decoding / getting the pixel data.
StvG is offline   Reply With Quote
Old 20th August 2026, 01:10   #3732  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,114
Quote:
Originally Posted by wonkey_monkey View Post
...
For example: some source filters will put the frame type (I, P, B) in a frame property. It could be very useful to scan all of these when a script loads, but if it means generating every frame then then it'll take far too long.
+1
It would be wonderful to have functions for communicating directly with the source filter. Two things would be of interest: '_PictType' and '_AbsoluteTime'.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 20th August 2026, 05:19   #3733  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 465
Quote:
Originally Posted by v0lt View Post
I don't want new features right now. I'm waiting for the release!
Fair enough, maybe it's more appropriate to implement it as a standalone plugin kind of like GScript, something like this...

Code:
GScript("""

	namespace MySpace {
	
		global MyCounter = 0   # only stuff inside MySpace sees this
	
		ScriptClip(last, """
		
			global MyCounter = MyCounter+1
			return last.Text(String(MyCounter))
			
		""")

	}
	
""")
Because then we don't have to mess around with Avisynth script parser and risk breaking stuff .
flossy_cake is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.