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 Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 17th February 2019, 22:22   #4501  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by wonkey_monkey View Post
"All of them will return true if the colourspace is RGB (in an way)"

If that's true, then they would all be true whether it's RGB24, RGB32, or Planar RGB. Which means you'd have no way to distinguish RGB24 and RGB32.
Alright, I'm awake now. So, I guess it should be:
IsRGB() - Returns true for all RGB color spaces
IsRGB24(), IsRGB32, IsRGB48, IsRGB64 - Self-explanatory
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 17th February 2019, 23:10   #4502  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
Quote:
Originally Posted by wonkey_monkey View Post
"All of them will return true if the colourspace is RGB (in an way)"

If that's true, then they would all be true whether it's RGB24, RGB32, or Planar RGB. Which means you'd have no way to distinguish RGB24 and RGB32.
as the only difference between rgb24 and rgb32 is the 8 bit alpha channel you can use both bitperpixel==32 and hasalpha to check it
__________________
powered by Google Translator
Motenai Yoda is offline  
Old 17th February 2019, 23:35   #4503  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,492
Quote:
Originally Posted by Motenai Yoda View Post
as the only difference between rgb24 and rgb32 is the 8 bit alpha channel you can use both bitperpixel==32 and hasalpha to check it
Wouldn't YV24 with Alpha return the same result with those?

Edit: oh, I think you meant if we already knew it was RGB. True, but IsRGB24() and IsRGB32() work as expected anyway, it's the wiki that's wrong.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline  
Old 18th February 2019, 00:58   #4504  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
it's the wiki that's wrong.
Quote:
bool IsRGB() const;
bool IsRGB24() const;
bool IsRGB32() const;

All of them will return true if the colorspace is RGB (in any way). The last two return true if the clip has the specific RGB colorspace (RGB24 and RGB32).
Its a bit [EDIT: well a lot] misleading, is intended to mean 'all RGB colorspaces will return true for IsRGB()'.

Same thing for the IsYUV thing.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th February 2019 at 01:01.
StainlessS is offline  
Old 18th February 2019, 11:01   #4505  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
since there are no way to get avs+ version I made AvsPlusVersionNumber() function to use it in avs scripting, the 1st one (IsAvsPlus) from the wiki but with some edit since there are no need for lower case and other things for all avs+ versions I seen

Code:
function IsAvsPlus()
{
    FindStr(VersionString, "AviSynth+")  != 0
}

function AvsPlusVersionNumber()
{
    IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0
}
blankclip(color=color_white)
Subtitle(String(AvsPlusVersionNumber))

tested with r1576 and above and all fine but let hope nothing will change to make it break in future
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 11:12   #4506  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Hi real.finder, I've seen that too-many-DLLs load-unload issue, why MEGUI is hectic about it?
pinterf is offline  
Old 18th February 2019, 11:24   #4507  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by real.finder View Post
since there are no way to get avs+ version I made AvsPlusVersionNumber() function to use it in avs scripting, the 1st one (IsAvsPlus) from the wiki but with some edit since there are no need for lower case and other things for all avs+ versions I seen

Code:
function IsAvsPlus()
{
    FindStr(VersionString, "AviSynth+")  != 0
}

function AvsPlusVersionNumber()
{
    IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0
}
blankclip(color=color_white)
Subtitle(String(AvsPlusVersionNumber))

tested with r1576 and above and all fine but let hope nothing will change to make it break in future
For your "IsAVSPlus()" function, would you not rather use a try/catch construct around AddAutoloadDir("")? That function is exclusive to AVS+ and seems a safer check than the version string acrobatics.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 18th February 2019, 11:24   #4508  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Hi real.finder, I've seen that too-many-DLLs load-unload issue, why MEGUI is hectic about it?
hi pinterf, I think because it has it own plugins folder and use AvisynthWrapper.dll and so, which mean a lot of dll's load already, and also I test it in full portable mode (with system has no avs at all) and then used ClearAutoloadDirs() AddAutoloadDir("path to plugins folder") in script and it's same thing especially after start encode (since it sometimes work in preview)

same script and folder work ok with x264 alone
__________________
See My Avisynth Stuff

Last edited by real.finder; 18th February 2019 at 11:29.
real.finder is offline  
Old 18th February 2019, 11:28   #4509  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Groucho2004 View Post
For your "IsAVSPlus()" function, would you not rather use a try/catch construct around AddAutoloadDir("")? That function is exclusive to AVS+ and seems a safer check than the version string acrobatics.
that can used too, but as I said those work already since the begin of avs+, and they look nicer than any other methods
__________________
See My Avisynth Stuff

Last edited by real.finder; 18th February 2019 at 11:36.
real.finder is offline  
Old 18th February 2019, 11:38   #4510  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by real.finder View Post
that can used too, but as I said those work already since the begin of avs+, and they look nicer than any other methods
Out of curiosity - Under what circumstances would you need the revision number?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 18th February 2019, 11:49   #4511  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
A check with AddAutoloadDir whould detect Avisynth Neo also as Avisynth+ (it basically is avs+ with cuda stuff) while AvsPlusVersionNumber returns 0. VersionString() returns on avs neo: "Avisynth Neo 0.1 (r2882, Neo, i386)"
It this case a check with AddAutoloadDir would be prefered.
https://github.com/nekopanda/AviSynthPlus/releases
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 18th February 2019 at 11:54.
ChaosKing is offline  
Old 18th February 2019, 12:00   #4512  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Groucho2004 View Post
Out of curiosity - Under what circumstances would you need the revision number?
same circumstances that old VersionNumber be used, like keep support for some older versions
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 12:04   #4513  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by ChaosKing View Post
Avisynth Neo
Arrrgh. Yet another version. Let's confuse the crap out of the average user.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 18th February 2019, 12:05   #4514  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by real.finder View Post
same circumstances that old VersionNumber be used, like keep support for some older versions
What support? Can you be more specific? Maybe a couple of examples?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 18th February 2019, 12:10   #4515  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by ChaosKing View Post
A check with AddAutoloadDir whould detect Avisynth Neo also as Avisynth+ (it basically is avs+ with cuda stuff) while AvsPlusVersionNumber returns 0. VersionString() returns on avs neo: "Avisynth Neo 0.1 (r2882, Neo, i386)"
It this case a check with AddAutoloadDir would be prefered.
https://github.com/nekopanda/AviSynthPlus/releases
I don't have nvidia so and didn't use Avisynth Neo, it already not work with any of IsAVSPlus (both wiki and mine) and AvsPlusVersionNumber, it's better if the Developer of Avisynth Neo make it like this "Avisynth+ 0.1 (r2882, Neo, i386)"
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 12:15   #4516  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Groucho2004 View Post
What support? Can you be more specific? Maybe a couple of examples?
support older avs+ in some scripts, like the old 1576 and so, since there are new functions added every time in avs+
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 12:19   #4517  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by real.finder View Post
support older avs+ in some scripts, like the old 1576 and so, since there are new functions added every time in avs+
If AVS+ had a simple script function "FunctionExists()" (same as the API function), testing for certain features would be a lot easier.

@pinterf
See above.

Edit: Or maybe a few simple utility functions which return true/false such as IsHighBitDepth() (HasHighBitDepth() ?), IsMultiThreaded(), etc. Just thinking out loud...
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 18th February 2019 at 12:34.
Groucho2004 is offline  
Old 18th February 2019, 12:24   #4518  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Groucho2004 View Post
If AVS+ had a simple script function "FunctionExists()" (same as the API function), testing for certain features would be a lot easier.
maybe but I like use it like vanilla AviSynth VersionNumber(), with < or >, simple and nice
__________________
See My Avisynth Stuff
real.finder is offline  
Old 18th February 2019, 12:24   #4519  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
From RT_Stats function list thing,
Code:
AviSynth+_0.1_(r2772,_MT,_i386)_ORDERED_Function_List

FunctionExists    "s"
ie, already implemented. [Of course you have to know that its AVS+ before you can use it, or Try/Catch]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th February 2019 at 12:26.
StainlessS is offline  
Old 18th February 2019, 12:28   #4520  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
already implemented
Ooops, you're right.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Closed Thread

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


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