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

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th March 2025, 14:34   #3301  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 5,062
According to Compare() the output of A and B are not identical, so I assume the placement argument is being honoured, but in both cases the chroma placement in frame properties after resizing is 3 (YV12 source). Likewise when there's no chroma location in frame properties, no chroma location is written.

propSet("_ChromaLocation", 3)
A = GaussResize(width/2, height/2)
B = GaussResize(width/2, height/2, placement="bottom")

It'd be nice if one day the resizers could also have a placementOut argument too
hello_hello is offline   Reply With Quote
Old 28th March 2025, 14:35   #3302  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 5,062
pinterf,

I don't know if you saw my post a couple of pages back, but is there a way to force the VarExist argument to only accept a variable as a string, even if the variable itself is a string? For consistency the following should output something like "invalid arguments to VarExist", but instead it returns false:
X = "Y"
VarExist(X)

This would return "invalid arguments to VarExist" as expected:
X = 4
VarExist(X)

Similarly, the defined() function probably shouldn't return true for a string.
X = undefined()
defined("X")

Cheers.

One last question.... is there a reason why the subtitle function has to require a value for the LSP argument in order to output multiple lines? I know it's always been that way, but is there a reason why this shouldn't just output multiple lines?

Subtitle("X\nY\nZ")

Last edited by hello_hello; 28th March 2025 at 14:44.
hello_hello is offline   Reply With Quote
Old 28th March 2025, 18:43   #3303  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,442
Quote:
Originally Posted by hello_hello View Post
For consistency the following should output something like "invalid arguments to VarExist", but instead it returns false:
X = "Y"
VarExist(X)
I think you are getting confused between variable names and variable values.
VarExist(X) will pass the value of X, namely the string "Y", into the function.
Now, the argument passed to VarExist() is expected to be a string whose value is interpreted as a name, and it will check if a variable of that name exists.
So the output of false is correct (assuming there is no variable Y).
Quote:
Similarly, the defined() function probably shouldn't return true for a string.
X = undefined()
defined("X")
On the other hand, defined() tests whether the actual value passed in is not equal to undefined(), so this is also correct.
(The variable X is not used here.)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 28th March 2025, 19:33   #3304  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
I forgot the edges... Thanks for the answers.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 28th March 2025, 21:06   #3305  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 5,062
Quote:
Originally Posted by Gavino View Post
I think you are getting confused between variable names and variable values.
VarExist(X) will pass the value of X, namely the string "Y", into the function.
I do understand the way it works, but to my way of thinking, ideally this would return true if X exists and false if it doesn't, and VarExist would never output an "I don't know what X means" error.

VarExist(X)

Maybe the variable has to be specified as a string for technical reasons, and I assume it'd be impractical to change it at this stage anyway.
hello_hello is offline   Reply With Quote
Old 28th March 2025, 21:18   #3306  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,410
HH, Well, if X dont exist, then error would be produced even before VarExist() would be called.
[when the arguement to VarExist is being evaluated by the script parser].

VarExist(), needs to know the name of the variable to see if it exists, not the value of an existing variable,
ie VarExist("Pi") not VarExist(3.1415926)
{
VarExist() scans the variable name table looking for the variable name entry, if it finds it then it exists, if not then it dont exist.
The Local name table is scanned first and if not found then the Global name table. <Local vars hide Global vars>
}

An existing variable can be Undefined [exists but not set to anything], but a non existing variable is not even Undefined, it dont exist at all.
An existing variable can have a type eg Undefined, Clip, String, Float, Int etc, and also value if the type is not Undefined.

EDIT: Inside a script function, an optional arg always exists (is declared as an optional arg to the function),
but if the arg is not provided by the calling code, then it is undefined.

Inside a script function, can use Defined(OptionalArgName) to test if was supplied by script function caller [and was not supplied as eg OptionalArgName=undefined].
Inside a script function, the Default() function eg OptionalArgName = Default(OptionalArgName,OptionalArgDefaultValue) could be implemented like
Code:
OptionalArgName = defined(OptionalArgName) ? OptionalArgName : OptionalArgDefaultValue
but external to a script function you would need to also test if a variable exists before can test if defined [unless you know for sure that it exists].
__________________
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; 28th March 2025 at 22:21.
StainlessS is offline   Reply With Quote
Old 5th April 2025, 20:27   #3307  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
Hi.

I have an issue when i try to build soundtouch.

I have Visual Studio 2019 Update 9.26 installed with clang-llvm built option, but i don't install LLVM provided with VS, instead, i install the last LLVM version provided on the github.
When i want to build with LLVM, in the general settings i choose "LLVM-clang" instead of "Visual Studio".
It always worked with everything i tried on until now (x265, avisynth, DirectShow Source, any of my projects).
But when i tried with soundtouch, it builds with "Visual Studio", but when switched to "LLVM-clang", i have the following error (i've translated some parts):
Code:
2>------ Start of generation : Project : SoundTouch, Configuration : Release x64 ------
2>Building Custom Rule C:/PRG/Visual_2010/soundtouch/CMakeLists.txt
2>In file included from <built-in>:488:
2><command line>(6,9): error : macro name must be an identifier
2><command line>(7,9): error : macro name must be an identifier
2>Generation of project "SoundTouch.vcxproj" ended -- FAIL.
Same for soundstretch.
Does someone know by any chance how to fix this
__________________
My github.
jpsdr is offline   Reply With Quote
Old 6th April 2025, 15:43   #3308  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 594
Quote:
Originally Posted by jpsdr View Post
Hi.

I have an issue when i try to build soundtouch.

I have Visual Studio 2019 Update 9.26 installed with clang-llvm built option, but i don't install LLVM provided with VS, instead, i install the last LLVM version provided on the github.
When i want to build with LLVM, in the general settings i choose "LLVM-clang" instead of "Visual Studio".
It always worked with everything i tried on until now (x265, avisynth, DirectShow Source, any of my projects).
But when i tried with soundtouch, it builds with "Visual Studio", but when switched to "LLVM-clang", i have the following error (i've translated some parts):
Code:
2>------ Start of generation : Project : SoundTouch, Configuration : Release x64 ------
2>Building Custom Rule C:/PRG/Visual_2010/soundtouch/CMakeLists.txt
2>In file included from <built-in>:488:
2><command line>(6,9): error : macro name must be an identifier
2><command line>(7,9): error : macro name must be an identifier
2>Generation of project "SoundTouch.vcxproj" ended -- FAIL.
Same for soundstretch.
Does someone know by any chance how to fix this
What's your cmake command line?
StvG is offline   Reply With Quote
Old 7th April 2025, 17:29   #3309  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
Hello.
My cmake command is:
Code:
@cd .\soundtouch\Build\x86_Broadwell
G:\CMakex64\bin\cmake -G "Visual Studio 16" -A Win32 ../../../../../Visual_2010/soundtouch -DCMAKE_INSTALL_PREFIX="C:\PRG\Visual_2019\AviSynth\Soundtouch\Install\x86_Broadwell" -DCMAKE_CXX_FLAGS_RELEASE="/sdl- /MP /O2 /Ob2 /Oi /Ot /Oy /GT /GL /GF /GS- /Gy /Qpar /arch:AVX2 /MD"

@cd ..\x64_Broadwell
G:\CMakex64\bin\cmake -G "Visual Studio 16" -A x64 ../../../../../Visual_2010/soundtouch -DCMAKE_INSTALL_PREFIX="C:\PRG\Visual_2019\AviSynth\Soundtouch\Install\x64_Broadwell" -DCMAKE_CXX_FLAGS_RELEASE="/sdl- /MP /O2 /Ob2 /Oi /Ot /Oy /GT /GL /GF /GS- /Gy /Qpar /arch:AVX2 /MD"

pause
__________________
My github.
jpsdr is offline   Reply With Quote
Old 7th April 2025, 18:02   #3310  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,501
-G "Visual Studio 16 2019" -T LLVM-clang -A x64 and see what errors CMake spits out directly.
qyot27 is offline   Reply With Quote
Old 7th April 2025, 22:09   #3311  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
It fails saying it can't find the llvm-clang tools.
They are installed and they're working when using from VS, otherwise i would never been able to release all my LLVM builds...
(Except with soundtouch...).
__________________
My github.
jpsdr is offline   Reply With Quote
Old 7th April 2025, 22:49   #3312  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 594
The toolset probably should be -T llvm instead of -T LLVM-clang.

Also you can try with your original command without the -DCMAKE_CXX_FLAGS_RELEASE="... part.
StvG is offline   Reply With Quote
Old 8th April 2025, 19:56   #3313  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
Tried with "llvm", "clang-cl", "llvm-clang-cl", nothing works, always the message saying it can't find the tools.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 9th April 2025, 15:12   #3314  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 594
Did you try:
Code:
@cd ..\x64_Broadwell
G:\CMakex64\bin\cmake -G "Visual Studio 16" -A x64 ../../../../../Visual_2010/soundtouch -DCMAKE_INSTALL_PREFIX="C:\PRG\Visual_2019\AviSynth\Soundtouch\Install\x64_Broadwell"
Btw you're running this command from "x64 Native tools...." not from simple cmd, right?
StvG is offline   Reply With Quote
Old 9th April 2025, 17:50   #3315  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
The full command which creates the solution, i double-click on the .bat file, so it's the same as running from cmd.
When the .bat file is finished and the solution created, i start Visual Studio, open the solution and finish the configuration/settings i can't do with the CMake/bat file.
And then i build the solution.

But, for the command with "-T", i've also do the same.
I'll try running it from "x64 Native tools...".

EDIT:
No change running from "x64 Native tools...", still saying it can't find the tools.

The only error message i have for now when building with llvm is the one provided post #3307...
__________________
My github.

Last edited by jpsdr; 9th April 2025 at 20:42.
jpsdr is offline   Reply With Quote
Old 11th April 2025, 12:44   #3316  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,822
I just had another thought about my inter-filter communication idea which I outlined here (and further up): https://forum.doom9.org/showthread.php?p=2013635

It could also be useful if filters could access their "depth", e.g. so two filters could work out whether they were neighbouring in the chain. It could allow them to avoid unnecessary conversions, for example if you called two filters that knew about each other on an 8-bit clip in succession, the first filter could produce 32-bit float output and leave the downconversion for the second filter (but only if there are no intervening filters that don't understand such negotiations), which would reduce rounding errors. It could similarly help GPU filters decide when writing back to the CPU can (or can't) be avoided.

But maybe such things are best left for the user to make explicit in the script...
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 12th April 2025, 01:13   #3317  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 594
Quote:
Originally Posted by jpsdr View Post
EDIT:
No change running from "x64 Native tools...", still saying it can't find the tools.

The only error message i have for now when building with llvm is the one provided post #3307...
I again ask - did you try:

Code:
@cd ..\x64_Broadwell
G:\CMakex64\bin\cmake -G "Visual Studio 16" -A x64 ../../../../../Visual_2010/soundtouch -DCMAKE_INSTALL_PREFIX="C:\PRG\Visual_2019\AviSynth\Soundtouch\Install\x64_Broadwell"
Then open the solution file, change to clang and try to build.

Your error suggests that some of the options isn't recognized by clang.

Try with default options, if this works, change option by option to see what's the culprit.
StvG is offline   Reply With Quote
Old 12th April 2025, 03:17   #3318  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,501
I was able to replicate the problem from the command line directly with CMake a few days ago. Unpack the upstream LLVM somewhere, use https://github.com/zufuliu/llvm-utils to install the extra toolsets into VS2019, set the LLVMInstallDir environment variable to the bin directory where it was installed (only necessary for the latest release because there currently isn't an installer for 20.1.2, just 20.1.1), and invoke CMake using -G "Visual Studio 16 2019" -A x64 -T LLVM_v142.

Configuration completes successfully, msbuild (cmake --build . - the value of --config doesn't matter) fails. Unfortunately, the error message is exactly the same as above. The closest results from searching come from old questions on Stack Overflow that point toward it being a problem in the source code, like this one: https://stackoverflow.com/questions/...be-identifiers

But since the error message itself doesn't say anything about the actual piece of code that triggers the issue or in which source file, you're left guessing.
qyot27 is offline   Reply With Quote
Old 12th April 2025, 11:14   #3319  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,637
@StvG
I'm using the same exact options on others CMake stuff (avisynth, x265), and everything works fine.
Anyway, i tried exactly what you've asked, both directly or from "Native tools", the same error message.

@qyot27
I thought it was a CMake stuff file error, but according what you said, it may be something in the code, Visual Studio accept, but llvm less permissive don't ?
I never suspect that, but it's somehow a start... It would be indeed better as you said if the file with the problem was identified...

EDIT:
I tried to activate all the warnings in VS, but it didn't allow me to find anything (the fact i didn't see anything doesn't meen there is nothing... ).
__________________
My github.

Last edited by jpsdr; 12th April 2025 at 11:49.
jpsdr is offline   Reply With Quote
Old 12th April 2025, 12:14   #3320  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 594
Quote:
Originally Posted by qyot27 View Post
I was able to replicate the problem from the command line directly with CMake a few days ago. Unpack the upstream LLVM somewhere, use https://github.com/zufuliu/llvm-utils to install the extra toolsets into VS2019, set the LLVMInstallDir environment variable to the bin directory where it was installed (only necessary for the latest release because there currently isn't an installer for 20.1.2, just 20.1.1), and invoke CMake using -G "Visual Studio 16 2019" -A x64 -T LLVM_v142.

Configuration completes successfully, msbuild (cmake --build . - the value of --config doesn't matter) fails. Unfortunately, the error message is exactly the same as above. The closest results from searching come from old questions on Stack Overflow that point toward it being a problem in the source code, like this one: https://stackoverflow.com/questions/...be-identifiers

But since the error message itself doesn't say anything about the actual piece of code that triggers the issue or in which source file, you're left guessing.
May be both of you (you and @jpsdr) should (since you're using not using VS 2022) to try older llvm versions because I don't have any issues with VS 2022.

Edit: I reproduced it. I had removed this line https://codeberg.org/soundtouch/soun...eLists.txt#L10. Removing the line - no issues.

Last edited by StvG; 12th April 2025 at 14:15.
StvG 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 22:51.


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