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 14th October 2022, 12:37   #201  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Folder permissions seem fine. Maybe something wrong with the path variables if Avisynth uses any.

EDIT: Found it. The plugin folder was not set correctly within the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth. No idea why.

Last edited by LeXXuz; 14th October 2022 at 12:45.
LeXXuz is offline   Reply With Quote
Old 6th December 2022, 16:06   #202  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example.
LeXXuz is offline   Reply With Quote
Old 6th December 2022, 16:14   #203  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by LeXXuz View Post
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example.

One way is expr
http://avisynth.nl/index.php/Expr

e.g. In a YUV clip change all values in Y channel to power of 2 , copy Cb, Cr
expr("x 2 ^", "x", "x")
poisondeathray is offline   Reply With Quote
Old 6th December 2022, 16:14   #204  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
x = pow(2,n) (maybe)
kedautinh12 is offline   Reply With Quote
Old 7th December 2022, 00:36   #205  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
Quote:
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...
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 7th December 2022, 01:15   #206  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
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.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 7th December 2022 at 01:23.
wonkey_monkey is offline   Reply With Quote
Old 7th December 2022, 03:49   #207  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by wonkey_monkey View Post
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/...#addalphaplane

ConvertToYUV444()
AddAlphaPlane()
qyot27 is offline   Reply With Quote
Old 7th December 2022, 12:00   #208  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
The plan was to keep the alpha channel that already existed in the RGB32 clip.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 8th December 2022, 00:08   #209  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
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.
qyot27 is offline   Reply With Quote
Old 8th December 2022, 01:14   #210  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanx Qyot27,
Whata wonderfull fella.

( Chill a bit, sir ) that wonkey fella is a bit messed up, try not to take notice. (Sorry Wonkey )
__________________
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; 8th December 2022 at 01:25.
StainlessS is offline   Reply With Quote
Old 8th December 2022, 10:56   #211  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by wonkey_monkey View Post
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
pinterf is offline   Reply With Quote
Old 13th December 2022, 15:25   #212  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
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.
GAP is offline   Reply With Quote
Old 13th December 2022, 19:39   #213  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
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.
FranceBB is offline   Reply With Quote
Old 18th December 2022, 21:59   #214  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Quote:
Originally Posted by FranceBB View Post
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:

Quote:
Originally Posted by GAP View Post
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:
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
GAP is offline   Reply With Quote
Old 22nd December 2022, 20:49   #215  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by GAP View Post
I want to know how I can upscale my footage for pixel game captures.
Fine.

Quote:
Originally Posted by GAP View Post
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:​






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.​





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:




Now a few comparisons:









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

Last edited by FranceBB; 19th May 2023 at 18:34.
FranceBB is offline   Reply With Quote
Old 23rd December 2022, 16:50   #216  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Very nice and comprehensive explanation.
I'd like to say thank you for taking the time to put this up.
LeXXuz is offline   Reply With Quote
Old 24th December 2022, 23:44   #217  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,041
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.
DTL is offline   Reply With Quote
Old 10th January 2023, 18:47   #218  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
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?
LeXXuz is offline   Reply With Quote
Old 10th January 2023, 18:55   #219  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by LeXXuz View Post
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 10th January 2023, 20:06   #220  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Thanks for confirming.
LeXXuz is offline   Reply With Quote
Reply

Tags
avisynth, faq

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 21:57.


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