Log in

View Full Version : AviSynth Q&A


Pages : 1 2 3 4 [5]

Emulgator
7th December 2022, 00:36
EDIT: Found it. The plugin folder was not set correctly within the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth. No idea why.
A remote guess because sometimes my portable AviSynth installs (Groucho Style) got overridden the same way
(just happened recently with RipBot 1.26.3):
Do you have other GUIs like RipBot or StaxRip installed?
I found that RipBot auto-updating forces its own AviSnth preferences.
IIRC StaxRip did that too on me once, but I am not so sure anymore...

wonkey_monkey
7th December 2022, 01:15
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.

qyot27
7th December 2022, 03:49
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/mask.html#addalphaplane

ConvertToYUV444()
AddAlphaPlane()

wonkey_monkey
7th December 2022, 12:00
The plan was to keep the alpha channel that already existed in the RGB32 clip.

qyot27
8th December 2022, 00:08
Ah, I was probably half-asleep when I read that initially, but it certainly is a little inconsistent. Anyway, issue created on Github so it won't get buried.

StainlessS
8th December 2022, 01:14
Thanx Qyot27,
Whata wonderfull fella.

( Chill a bit, sir ) that wonkey fella is a bit messed up, try not to take notice. (Sorry Wonkey :) )

pinterf
8th December 2022, 10:56
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.
I guess I made the following considerations:
- ConvertToYUV444 is the generalization of ConvertToYV24
- Applying ConvertToYUV444 on old formats such as RGB32 must preserve the original behaviour and result in YV24 (YUV444P8) and not YUVA444P8

GAP
13th December 2022, 15:25
Can anyone give a step by step guide to resizing in AVISynth? I will admit that I am still new to this and I am asking becuase I was recommened to deep resize on another thread (https://forum.doom9.org/showthread.php?t=184610).

FranceBB
13th December 2022, 19:39
What do you wanna know? Which kernel is good and which ones should be avoided? The resampling page in the Avisynth wiki does a pretty good job.
As a rule of thumb, however, you can use SinPowResizeMT() to downscale and either Spline64Resize or NNEDI3 to upscale.

GAP
18th December 2022, 21:59
What do you wanna know? Which kernel is good and which ones should be avoided? The resampling page in the Avisynth wiki does a pretty good job.
As a rule of thumb, however, you can use SinPowResizeMT() to downscale and either Spline64Resize or NNEDI3 to upscale.

I want to know how I can upscale my footage for pixel game captures. Here is what I posted on my thread:

Can anyone talk a look at this script? I am to make this setup into a FFMPEG script and even an AVISynth/AVS script. Here is what I am trying to do:


Using Virtualdub I was going to do two resizes using Nearest Neighbor and later Lanzcos3. The Nearest Neighbor resize filter was going to upscale the video while the other filter was for aspect ratio correction via "Compute Height from Ratio" on Lanzcos3. I know you do not have to do this in FFMPEG or AVISynth but you could in Virtualdub2.
I was to resize it to four times bigger than usual since that is considered HD and I do not want it to be bigger than what it can allowed to be.
I was put in a .mp4 video container with .aac as the audio container. Someone recommended me libopus as a possible audio codec but I want to play it safe with .aac.
As for codecs and compression, I mostly use x264 8 bit with a Slower compression with the constant rate factor being either 16 or lossless.
I wanted colorspace from RGB to YUV. I mostly work with pixels from old video games.


I was wondering how can I do so with this FFMPEG script? Do these options that I have about match what I want do? And if possible, how can export it to AVISynth or AVS.

I also wanted to add in a fade in or fade out as I want to prevent the clip from going past a certain time.

FranceBB
22nd December 2022, 20:49
I want to know how I can upscale my footage for pixel game captures.


Fine.


Using Virtualdub I was going to do two resizes using Nearest Neighbor and later Lanzcos3.


No one should be masochist enough to be using PointResize() on his own free will for things that will be used for real.


There are several resizing kernels nowadays, but the most known are:​

- PointResize() -> Nearest Neighbour​

- BilinearResize() -> Bilinear filtering​

- BicubicResize() -> Mitchell-Netravali two-part cubic filtering​

- LanczosResize() -> Two lobes Lanczos windowed sinc function (4 lobes, 2 on each side)​

- BlackmanResize() -> A modified version of Lanczos with better ringing control (higher taps)​

- GaussResize() -> Gaussian filter; unlike bicubic, it does not overshoot, but it's less sharp​

- SincResize() -> Truncated Sinc Function; very sharp but pronte to ringing artifacts​

- Spline16Resize() -> Cubic Spline Based resizer that fit a spline through √16 sample points​

- Spline36Resize() -> Cubic Spline Based resizer that fit a spline through √36 sample points​

- Spline64Resize() -> Cubic Spline Based resizer that fit a spline through √64 sample points​

We're gonna talk about NNEDI3 (Neural Network Edge Directed Interpolation 3) later.


The most basic Algorithm -> PointResize()​

PointResize is a nearest neighbour algorithm which performs interpolation between points.​



Interpolation is the problem of approximating the value of a function for a non-given point in some space when given the value of that function in points around (neighboring) that point. The nearest neighbor algorithm selects the value of the nearest point and does not consider the values of neighboring points at all, yielding a piecewise-constant interpolant.​



Suppose we have a grid with pictures that have 8bit values like so:​


https://i.imgur.com/XOb9E9A.png
https://i.imgur.com/GiqNb7f.png


Let's move to Bilinear:​


Bilinear interpolation is performed using linear interpolation first in one direction, and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not "linear" but rather "quadratic" in the sample location.​


https://i.imgur.com/Z3ugGYB.png
https://i.imgur.com/M5JTvNM.png

Let's move to Spline based resizing:​



Spline16Resize, Spline36Resize and Spline64Resize are three Spline based resizers. They are the cubic spline based resizers from Panorama tools that fit a spline through the sample points and then derives the filter kernel from the resulting blending polynomials. The rationale for Spline is to be as sharp as possible with less ringing artifacts than LanczosResize produces. Spline16Resize uses √16 or 4 sample points, Spline36Resize uses √36 or 6 sample points. The more sample points used, the more accurate the resampling.​

Very loosely and poorly made graphs but that should give you an idea:

https://i.imgur.com/EqdEEBO.png


Now a few comparisons:

https://i.imgur.com/1Xp1Xqz.png
https://i.imgur.com/uTeuXjY.png
https://i.imgur.com/mNdop9A.png
https://i.imgur.com/OU4W4At.png
https://i.imgur.com/4nu6CXg.png



What you should learn from this is:

1) DO NOT use PointResize()
2) It's 2022, use NNEDI3 to upscale or at the very least Spline64Resize()
3) If you want to add black borders to keep aspect ratio, use AddBorders() manually or use ResizeKAR() or FrostyBorders() with frosty = false to do it for you automagically.


Cheers,
Frank

LeXXuz
23rd December 2022, 16:50
Very nice and comprehensive explanation.
I'd like to say thank you for taking the time to put this up. :thanks:

DTL
24th December 2022, 23:44
Pixel-based (may be better pixel-art based) old game may be designed to be rendered as really square pixels. Also it may not contain any real number measured shifts or scaling or other transforms - only integer shifts. So only PointResize with integer ratio (2x,3x,...)is applicable to fit higher resolution screens. Different digital imaging methods of encode images require different visualization and different scaling.

LeXXuz
10th January 2023, 18:47
Simple question regarding Avisynth syntax.

In many scripts I see a decimal point behind numbers in operations. For example: x=(y/2.)

Is this to make the output (x) a float instead of an (depending on y maybe rounded) integer? Or what purpose does this decimal point have?

Boulder
10th January 2023, 18:55
Simple question regarding Avisynth syntax.

In many scripts I see a decimal point behind numbers in operations. For example: x=(y/2.)

Is this to make the output (x) a float instead of an (depending on y maybe rounded) integer? Or what purpose does this decimal point have?

Yes, that's it. Avisynth won't do the conversion if the variables are integers even if the result was a float. For example with BicubicResize, you need b=1/3., c=1/3. (or 1./3) to get the desired values there.

LeXXuz
10th January 2023, 20:06
Thanks for confirming. :thanks:

StainlessS
16th January 2023, 23:42
Also note, a function with a Float arg will accept an int [v2.60+, converted to type float inside the function],
but a function with a type Int arg will NOT accept a float.

A type float arg specifier basically means 'numeric' whereas type Int is strictly int.

LeXXuz
17th January 2023, 19:57
Thanks StainlessS. Appreciate your input. :)

GAP
18th January 2023, 13:22
Edit: Nevermind, Disregard that qusstion as it turned out that Avisynth + and Avisynth wer ein conflict with each other. I was using AVSPmod and it does not detect AVISynth +. My next questions are: How do I make AVSPMod use AVISynth +? And can AVSPmod be a substitute for Virtualdub2? I used the Universal Installer but I installed the latest version of AVISynth + but I am afraid to use it.

Emulgator
18th January 2023, 23:26
Modify the Universal Groucho setavs.cmd to

::Batch script for fast switching of Avisynth versions
::Initial idea and work by Groucho2004
::Modified by jones1913
::Modified and extended by Groucho2004
::Updated for AVSPLUS373 folders by Emulgator

@echo off
cls
setlocal

:Check administrative privileges
fsutil dirty query %systemdrive% > nul
if errorlevel 1 goto :noAdmin


:: ########################## Start Configuration #########################

:: The variable "AVS_SRC_DIR" must be set according to the location of
:: this batch file.

:: The simplest way to have this up and running is to copy the "AvisynthRepository"
:: directory to a location of your choice (avoid "Program Files" or "Program Files (x86)")
:: and create a shortcut to the "setavs.cmd" batch file in the root of "AvisynthRepository".

:: If you want to run the batch file from a different directory
:: (i.e. a directory to which the "PATH" environment variable points),
:: remove the "%~dp0" and use a fully qualified path to the source directory.
:: Example: "set AVS_SRC_DIR=E:\VideoTools\AvisynthRepository"
set AVS_SRC_DIR=%~dp0


:: Default plugin directories
:: If you leave them blank, the respective "plugin" directories within
:: the "AvisynthRepository" source directories will be used.
set PLUGDIR32=
set PLUGDIR64=


:: Additional plugin directories (works only with Avisynth+)
:: If you leave them blank, only the default plugin directories (see above)
:: will be used.
set PLUGDIR32PLUS=
set PLUGDIR64PLUS=


:: **IMPORTANT:
:: If you have customized any of the above directories and their names contain
:: special characters such as '&', '(' or ')', enclose the variable and path
:: in double quotes and use the escape character '^' before the special character(s).
::
:: Example 1:
:: set "AVS_SRC_DIR=C:\Program Files ^(x86^)\Avisynth"
::
:: Example 2:
:: set "PLUGDIR32=C:\Program Files ^(x86^)\Avisynth\Plugins ^& avsi"


:: ########################### End Configuration ##########################



if "%AVS_SRC_DIR%" == "" (
echo.
echo The source directory ^(AVS_SRC_DIR^) is not defined.
echo Please read the instructions above.
echo.
goto :end
)

if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set winarch=x32

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

echo.
echo Installed Avisynth version(s):
echo.
if defined winarch (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
) else (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
echo.
"%AVS_SRC_DIR%\Tools\AVSVersion64.exe"
)
echo.

echo.
echo Select the Avisynth version you want to install/uninstall:
echo.
echo 1 = Avisynth 2.5.8
echo 2 = Avisynth 2.6.0
echo 3 = Avisynth 2.6.1 (Alpha)
echo 4 = Avisynth 2.6.0 (SEt's multi-threaded build)
echo.

echo 5 = Avisynth+ 0.1.0 (x86, r2772)
echo 6 = Avisynth+ 0.1.0 (x64, r2772)
echo 7 = Avisynth+ XP 3.7.0 (x86, r3382)
echo 8 = Avisynth+ XP 3.7.0 (x64, r3382)
echo 9 = Avisynth+ 3.7.3 (x86, r3825)
echo 10 = Avisynth+ 3.7.3 (x64, r3825)

echo.
echo 13 = Uninstall Avisynth x86
echo 14 = Uninstall Avisynth x64
echo.
echo NOTE: 64 bit versions can be installed alongside 32 bit versions.
echo.
echo.
set no=
set /p no= [1-12] (leave blank and [Enter] to exit):
if [%no%]==[] goto :cancel


if %no%==1 set avs=AVS258
if %no%==2 set avs=AVS260
if %no%==3 set avs=AVS261_Alpha
if %no%==4 set avs=AVS260_MT

if %no%==5 (set avs=AVSPLUS010_x86) & set avspl=true
if %no%==6 (set avs=AVSPLUS010_x64) & set avspl=true
if %no%==7 (set avs=AVSPLUS370_x86_XP) & set avspl=true
if %no%==8 (set avs=AVSPLUS370_x64_XP) & set avspl=true
if %no%==9 (set avs=AVSPLUS373_x86) & set avspl=true
if %no%==10 (set avs=AVSPLUS373_x64) & set avspl=true


if %no%==13 (set avs=AVSx86) & goto :uninstall
if %no%==14 (set avs=AVSx64) & goto :uninstall
echo.
if [%avs%]==[] (echo Invalid input...
goto :menu)

if %avs%==AVSPLUS010_x64 set x64=true
if %avs%==AVSPLUS370_x64 set x64=true
if %avs%==AVSPLUS370_x64_XP set x64=true
if %avs%==AVSPLUS373_x64 set x64=true

:install

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

if "%PLUGDIR32%" == "" (
set REGPLUGDIR32=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32=%PLUGDIR32%
)

if "%PLUGDIR64%" == "" (
set REGPLUGDIR64=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64=%PLUGDIR64%
)

if "%PLUGDIR32PLUS%" == "" (
set REGPLUGDIR32PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32PLUS=%PLUGDIR32PLUS%
)

if "%PLUGDIR64PLUS%" == "" (
set REGPLUGDIR64PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64PLUS=%PLUGDIR64PLUS%
)

:: Remove trailing backslash if present
if "%REGPLUGDIR32PLUS:~-1%"=="\" SET REGPLUGDIR32PLUS=%REGPLUGDIR32PLUS:~0,-1%
if "%REGPLUGDIR64PLUS:~-1%"=="\" SET REGPLUGDIR64PLUS=%REGPLUGDIR64PLUS:~0,-1%
if "%REGPLUGDIR32:~-1%"=="\" SET REGPLUGDIR32=%REGPLUGDIR32:~0,-1%
if "%REGPLUGDIR64:~-1%"=="\" SET REGPLUGDIR64=%REGPLUGDIR64:~0,-1%

echo Installing %avs%...
echo.
if defined winarch (
echo setup for 32bit windows system...
echo.

if defined x64 ( echo Attempt to install x64 AVS on x32 Windows.
goto :cancel )

echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo setup for 64bit windows system...
echo.
if defined x64 (
echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR64PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\SysWow64"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWow64
)
)
goto :end

:regWin
echo.
echo adding more registry entries...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f
goto :eof

:regWow64
echo.
echo adding more registry entries (wow64 mode)...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f
goto :eof

:uninstall
echo.
echo Remove %avs% .dll and registry entries from this system?
set /p rm=[y/n]:
if /i not [%rm%]==[y] goto :cancel
echo.
if defined winarch (
if /i %avs%==AVSx64 ( echo Attempt to remove x64 AVS from x32 Windows.
goto :cancel )
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\avisynth.dll"
del "%WINDIR%\System32\devil.dll"
call :unregWin all
) else (
if /i %avs%==AVSx64 (
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\devil.dll"
del "%WINDIR%\System32\avisynth.dll"
if exist "%WINDIR%\SysWow64\avisynth.dll" (call :unregWin) else (
call :unregWin all )
) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
if exist "%WINDIR%\System32\avisynth.dll" (call :unregWow64) else (
call :unregWow64 all )
)
)
goto :end

:unregWin
echo.
echo removing registry entries...
reg delete "HKLM\SOFTWARE\Avisynth" /f
reg delete "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregWow64
echo.
echo removing registry entries (wow64 mode)...
reg delete "HKLM\SOFTWARE\Wow6432Node\Avisynth" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregAll
echo.
echo removing more avs registry entries...
reg delete "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /f
reg delete "HKLM\SOFTWARE\Classes\.avs" /f
reg delete "HKLM\SOFTWARE\Classes\.avsi" /f
reg delete "HKLM\SOFTWARE\Classes\avsfile" /f
reg delete "HKLM\SOFTWARE\Classes\avs_auto_file" /f
goto :eof

:noAdmin
echo This batch file must run with elevated privileges, so:
echo.
echo Right click on it and chose "Run as administrator"
goto :end

:error
echo.
echo something went wrong...
echo.

:cancel
echo.
echo cancelled...
echo.

:end
endlocal
echo.
pause

Fjord
20th January 2023, 08:03
Is there a filter/function/script in Avisynth that will take the average of an entire clip? That is, to create a single frame from a clip, where each pixel in the result frame is the average of all pixels in that position in the clip. The result could be a clip containing 1 frame (ie 32-bit float), or to write the result to a file, fx TIFF in 32-bit float format?

I am only aware of temporal filters that return the average of 3 to 7 frames at a time, for each frame in a clip (TemporalDegrain(), MedianBlurTemporal(), ex_median(), etc.).

The next question will be if this can be done with other statistics, for example maximum, minimum, median?

My objective for this is to create a single-frame mask for a clip that isolates specific areas according to the statistic - for example the areas of an image that are consistently dark for the whole scene. (assuming the clip contains a single scene)

Reel.Deel
20th January 2023, 08:09
Is there a filter/function/script in Avisynth that will take the average of an entire clip?

ClipBlend (http://avisynth.nl/index.php/ClipBlend):
#Or to get a single frame average of all frames in a clip:
AviSource("blah.avi")
ClipBlend()
Trim(FrameCount-1,-1)

Float is not supported only 8-bit and 16-bit stacked.

Fjord
20th January 2023, 09:04
Thanks @Reel.Deel. Spot on! :)

Given that I have 10-bit source (YUV442P10), I assume I should use source.ConvertToStacked() (https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/convertstacked.html#converttostacked) as input to ClipBlend16(), to use all 10 bits in the process (assuming no overflow in the accumulator). Do I need to convert to YUV444P16 first?

I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225), and option for running maximum or minimum. Internal 64-bit float accumulator would also be nice. :D

FranceBB
20th January 2023, 09:11
Thanks @Reel.Deel. Spot on! :)

Given that I have 10-bit source (YUV442P10), I assume I should use source.ConvertToStacked() (https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/convertstacked.html#converttostacked) as input to ClipBlend16()

Almost, you need ConvertBits(16) first 'cause ConverttoStacked() only accepts 16bit planar as input as it will divide it in 8bit MSB and 8bit LSB.
Using the Reel.Deel example, in your case it would be like:


#Indexing the 10bit planar source
LWLibavVideoSource("whatever.mov")

#Going to 16bit planar
ConvertBits(16)

#Go to 16bit stacked (MSB and LSB)
ConverttoStacked()

#Work with 16bit stacked precision
ClipBlend16()

#Go back to 16bit planar
ConvertFromStacked()

#Final result with 16bit planar precision
Trim(FrameCount-1,-1)




I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225)

Just in case, if/when they'll add 16bit planar support, make sure not to remove 16bit stacked support in the meantime as otherwise it won't be possible for legacy Avisynth versions like 2.6.1 to work in high bit depth and also filters that might depend on it.


Cheers,
Frank

Fjord
20th January 2023, 09:26
Thanks Frank! :) Got it.

Reel.Deel
20th January 2023, 09:54
I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225), and option for running maximum or minimum. Internal 64-bit float accumulator would also be nice. :D

Maybe StainlessS will see this. I've been on the his waiting list for almost 2 yearssS :p

If you need 32-bit you can do it with expr but you will have to modify the AvgAll_16 script (https://forum.doom9.org/showthread.php?p=1579509#post1579509).

kedautinh12
20th January 2023, 10:18
Waiting for Staindroid :D

Dogway
20th January 2023, 18:31
Is there a filter/function/script in Avisynth that will take the average of an entire clip?
...
The next question will be if this can be done with other statistics, for example maximum, minimum, median?

That's basically the purpose of SceneStats (https://github.com/Dogway/Avisynth-Scripts/blob/master/ScenesPack.avsi). Generally it's for scenes, but you can also run ClipStats to get global statistics (min, max, median, mean, etc). ClipStats usually hangs AVS+ though (AvsPmod maybe?).

GAP
29th January 2023, 18:51
Modify the Universal Groucho setavs.cmd to

::Batch script for fast switching of Avisynth versions
::Initial idea and work by Groucho2004
::Modified by jones1913
::Modified and extended by Groucho2004
::Updated for AVSPLUS373 folders by Emulgator

@echo off
cls
setlocal

:Check administrative privileges
fsutil dirty query %systemdrive% > nul
if errorlevel 1 goto :noAdmin


:: ########################## Start Configuration #########################

:: The variable "AVS_SRC_DIR" must be set according to the location of
:: this batch file.

:: The simplest way to have this up and running is to copy the "AvisynthRepository"
:: directory to a location of your choice (avoid "Program Files" or "Program Files (x86)")
:: and create a shortcut to the "setavs.cmd" batch file in the root of "AvisynthRepository".

:: If you want to run the batch file from a different directory
:: (i.e. a directory to which the "PATH" environment variable points),
:: remove the "%~dp0" and use a fully qualified path to the source directory.
:: Example: "set AVS_SRC_DIR=E:\VideoTools\AvisynthRepository"
set AVS_SRC_DIR=%~dp0


:: Default plugin directories
:: If you leave them blank, the respective "plugin" directories within
:: the "AvisynthRepository" source directories will be used.
set PLUGDIR32=
set PLUGDIR64=


:: Additional plugin directories (works only with Avisynth+)
:: If you leave them blank, only the default plugin directories (see above)
:: will be used.
set PLUGDIR32PLUS=
set PLUGDIR64PLUS=


:: **IMPORTANT:
:: If you have customized any of the above directories and their names contain
:: special characters such as '&', '(' or ')', enclose the variable and path
:: in double quotes and use the escape character '^' before the special character(s).
::
:: Example 1:
:: set "AVS_SRC_DIR=C:\Program Files ^(x86^)\Avisynth"
::
:: Example 2:
:: set "PLUGDIR32=C:\Program Files ^(x86^)\Avisynth\Plugins ^& avsi"


:: ########################### End Configuration ##########################



if "%AVS_SRC_DIR%" == "" (
echo.
echo The source directory ^(AVS_SRC_DIR^) is not defined.
echo Please read the instructions above.
echo.
goto :end
)

if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set winarch=x32

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

echo.
echo Installed Avisynth version(s):
echo.
if defined winarch (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
) else (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
echo.
"%AVS_SRC_DIR%\Tools\AVSVersion64.exe"
)
echo.

echo.
echo Select the Avisynth version you want to install/uninstall:
echo.
echo 1 = Avisynth 2.5.8
echo 2 = Avisynth 2.6.0
echo 3 = Avisynth 2.6.1 (Alpha)
echo 4 = Avisynth 2.6.0 (SEt's multi-threaded build)
echo.

echo 5 = Avisynth+ 0.1.0 (x86, r2772)
echo 6 = Avisynth+ 0.1.0 (x64, r2772)
echo 7 = Avisynth+ XP 3.7.0 (x86, r3382)
echo 8 = Avisynth+ XP 3.7.0 (x64, r3382)
echo 9 = Avisynth+ 3.7.3 (x86, r3825)
echo 10 = Avisynth+ 3.7.3 (x64, r3825)

echo.
echo 13 = Uninstall Avisynth x86
echo 14 = Uninstall Avisynth x64
echo.
echo NOTE: 64 bit versions can be installed alongside 32 bit versions.
echo.
echo.
set no=
set /p no= [1-12] (leave blank and [Enter] to exit):
if [%no%]==[] goto :cancel


if %no%==1 set avs=AVS258
if %no%==2 set avs=AVS260
if %no%==3 set avs=AVS261_Alpha
if %no%==4 set avs=AVS260_MT

if %no%==5 (set avs=AVSPLUS010_x86) & set avspl=true
if %no%==6 (set avs=AVSPLUS010_x64) & set avspl=true
if %no%==7 (set avs=AVSPLUS370_x86_XP) & set avspl=true
if %no%==8 (set avs=AVSPLUS370_x64_XP) & set avspl=true
if %no%==9 (set avs=AVSPLUS373_x86) & set avspl=true
if %no%==10 (set avs=AVSPLUS373_x64) & set avspl=true


if %no%==13 (set avs=AVSx86) & goto :uninstall
if %no%==14 (set avs=AVSx64) & goto :uninstall
echo.
if [%avs%]==[] (echo Invalid input...
goto :menu)

if %avs%==AVSPLUS010_x64 set x64=true
if %avs%==AVSPLUS370_x64 set x64=true
if %avs%==AVSPLUS370_x64_XP set x64=true
if %avs%==AVSPLUS373_x64 set x64=true

:install

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

if "%PLUGDIR32%" == "" (
set REGPLUGDIR32=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32=%PLUGDIR32%
)

if "%PLUGDIR64%" == "" (
set REGPLUGDIR64=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64=%PLUGDIR64%
)

if "%PLUGDIR32PLUS%" == "" (
set REGPLUGDIR32PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32PLUS=%PLUGDIR32PLUS%
)

if "%PLUGDIR64PLUS%" == "" (
set REGPLUGDIR64PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64PLUS=%PLUGDIR64PLUS%
)

:: Remove trailing backslash if present
if "%REGPLUGDIR32PLUS:~-1%"=="\" SET REGPLUGDIR32PLUS=%REGPLUGDIR32PLUS:~0,-1%
if "%REGPLUGDIR64PLUS:~-1%"=="\" SET REGPLUGDIR64PLUS=%REGPLUGDIR64PLUS:~0,-1%
if "%REGPLUGDIR32:~-1%"=="\" SET REGPLUGDIR32=%REGPLUGDIR32:~0,-1%
if "%REGPLUGDIR64:~-1%"=="\" SET REGPLUGDIR64=%REGPLUGDIR64:~0,-1%

echo Installing %avs%...
echo.
if defined winarch (
echo setup for 32bit windows system...
echo.

if defined x64 ( echo Attempt to install x64 AVS on x32 Windows.
goto :cancel )

echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo setup for 64bit windows system...
echo.
if defined x64 (
echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR64PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\SysWow64"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWow64
)
)
goto :end

:regWin
echo.
echo adding more registry entries...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f
goto :eof

:regWow64
echo.
echo adding more registry entries (wow64 mode)...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f
goto :eof

:uninstall
echo.
echo Remove %avs% .dll and registry entries from this system?
set /p rm=[y/n]:
if /i not [%rm%]==[y] goto :cancel
echo.
if defined winarch (
if /i %avs%==AVSx64 ( echo Attempt to remove x64 AVS from x32 Windows.
goto :cancel )
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\avisynth.dll"
del "%WINDIR%\System32\devil.dll"
call :unregWin all
) else (
if /i %avs%==AVSx64 (
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\devil.dll"
del "%WINDIR%\System32\avisynth.dll"
if exist "%WINDIR%\SysWow64\avisynth.dll" (call :unregWin) else (
call :unregWin all )
) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
if exist "%WINDIR%\System32\avisynth.dll" (call :unregWow64) else (
call :unregWow64 all )
)
)
goto :end

:unregWin
echo.
echo removing registry entries...
reg delete "HKLM\SOFTWARE\Avisynth" /f
reg delete "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregWow64
echo.
echo removing registry entries (wow64 mode)...
reg delete "HKLM\SOFTWARE\Wow6432Node\Avisynth" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregAll
echo.
echo removing more avs registry entries...
reg delete "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /f
reg delete "HKLM\SOFTWARE\Classes\.avs" /f
reg delete "HKLM\SOFTWARE\Classes\.avsi" /f
reg delete "HKLM\SOFTWARE\Classes\avsfile" /f
reg delete "HKLM\SOFTWARE\Classes\avs_auto_file" /f
goto :eof

:noAdmin
echo This batch file must run with elevated privileges, so:
echo.
echo Right click on it and chose "Run as administrator"
goto :end

:error
echo.
echo something went wrong...
echo.

:cancel
echo.
echo cancelled...
echo.

:end
endlocal
echo.
pause


Do you change the name of the folders as well?

Emulgator
29th January 2023, 19:43
Yes, you would match these folder names as given in script.
Or choose your own folder names and match script.

LeXXuz
10th March 2023, 14:14
I have another syntax question.

Is there any difference between these 3 script snips:

1)

PRE1=filter1()
PRE2=filter2(PRE1)
filter3(PRE2)

2)
filter1().filter2().filter3()

3)
filter1()
filter2()
filter3()

If so, I'd appreciate a thorough explanation.
It would help me to understand some of the more advanced scripts any better. :o

DTL
10th March 2023, 17:35
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

LeXXuz
10th March 2023, 23:20
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

I see. So, if I'm only interested in what happens at the very end of those scripts after the last line, the output of all 3 is equivalent?

VoodooFX
10th March 2023, 23:47
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

I think there are other unseen "differences", like in caching behavior.

Anyway, why this thread is treated like "Ask any question about AvS" thread, when it's about AvS wiki?

LeXXuz
11th March 2023, 00:31
Anyway, why this thread is treated like "Ask any question about AvS" thread, when it's about AvS wiki?

My apologies. I misunderstood this thread. Will post questions about AVS somewhere else in future. :o

Jawed
17th February 2025, 02:54
Avisynth.org links in this post go to a host page, i.e. are no longer valid. Shouldn't they be fixed?

Emulgator
17th February 2025, 12:51
You may want to PM Wlbert https://forum.doom9.org/member.php?u=2705