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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th August 2020, 16:36   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
AddAlphaPlane

Maybe I'm missing something, but AddAlphaPlane() doesn't always seem to be accepting "last" as the first clip. It seems I can work around it by specifying the mask clip as a named argument, but is this apparent inconsistency expected? I'm running Avisynth+ 3.5 on XP.

Code:
No error

ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
ConvertToYUV420().AddAlphaPlane(Alfa)
Code:
Results in a "greyscale source is not allowed" error

ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
ConvertToYUV420()
AddAlphaPlane(Alfa)
Code:
Results in a "greyscale source is not allowed" error

ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
Add = "AddAlphaPlane(Alfa)"
ConvertToYUV420().Eval(Add)
Code:
Results in a "greyscale source is not allowed" error

ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
Add = "AddAlphaPlane(Alfa)"
ConvertToYUV420()
Eval(Add)
When using Mask=MaskClip, it never produces an error, but I'd be interested to know why only one of the examples above works as I expected it to.

Code:
This sort if thing never results in an error

ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
Add = "AddAlphaPlane(Mask=Alfa)"
ConvertToYUV420()
Eval(Add)
Edit: While I'm here, could somebody please explain this one. I'm using the example from the wiki. Are these functions newer than version 3.5, or were they removed?

Code:
No such function as UToY8

Source = last.AddAlphaPlane()
U8 = source.UToY8()
V8 = source.VToY8()
Y8 = source.ConvertToY()
A8 = source.AddAlphaPlane(128).AToY8()
CombinePlanes(Y8, U8, V8, A8, planes="YUVA", source_planes="YYYY", 
\               sample_clip=source)
Code:
No such function as AToY8 (or ATtoY)

Source = last.AddAlphaPlane()
U8 = source.UToY.ConvertToY8()
V8 = source.VToY.ConvertToY8()
Y8 = source.ConvertToY()
A8 = source.AddAlphaPlane(128).AToY8()
CombinePlanes(Y8, U8, V8, A8, planes="YUVA", source_planes="YYYY", 
\               sample_clip=source)
Code:
No error

Source = last.AddAlphaPlane()
U8 = source.UToY.ConvertToY8()
V8 = source.VToY.ConvertToY8()
Y8 = source.ConvertToY()
A8 = source.AddAlphaPlane(128).ExtractA().ConvertToY8()
CombinePlanes(Y8, U8, V8, A8, planes="YUVA", source_planes="YYYY", 
\               sample_clip=source)
Cheers.

Last edited by hello_hello; 10th August 2020 at 22:01.
hello_hello is offline   Reply With Quote
Old 11th August 2020, 00:55   #2  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
there are bug in how last avs+ read the parameters https://forum.doom9.org/showpost.php...13&postcount=5 and https://forum.doom9.org/showpost.php...&postcount=622
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 11th August 2020, 04:08   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
It's an odd one.

Thanks.
hello_hello is offline   Reply With Quote
Old 11th August 2020, 10:35   #4  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Also https://forum.doom9.org/showthread.p...18#post1920018
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 16th August 2020, 07:49   #5  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
ok, the OP seems not related with avs+ 3.6 problem, simply it not work because Mask is var so it not use the feeded clip unless it forced to do so

UToY8 was there from classic avs 2.6, but I think AToY8/AToY was in some avs+ test and removed later after ExtractA was added
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 18th August 2020, 13:54   #6  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by hello_hello View Post
Maybe I'm missing something, but AddAlphaPlane() doesn't always seem to be accepting "last" as the first clip. It seems I can work around it by specifying the mask clip as a named argument, but is this apparent inconsistency expected? I'm running Avisynth+ 3.5 on XP.

Code:
ConvertToYUV420()
AddAlphaPlane()
Alfa = ExtractA()
ConvertToYUV420()
AddAlphaPlane(Alfa)
Results in a "greyscale source is not allowed" error
The "mask" parameter is a named parameter and is optional.
http://avisynth.nl/index.php/Combine...#AddAlphaPlane

When you call AddAlphaPlane with a simple clip, it is a perfectly valid form of AddAlphaPlane with a single source clip parameter.

In this syntax the single nameless parameter you were given is the interpreted as a source clip. And this clip (Alfa at the moment) is not allowed to be greyscale.

AddAlphaPlane(mask=Alfa) will work, since the source will be "last".
pinterf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 00:12.


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