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 11th April 2020, 18:49   #5421  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Code:
# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo",Int "Col"){
    c.BlankClip(height=20,Color=Default(Col,0))
    (Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Trim(0,-1).Subtitle(Tit)
    Return StackVertical(c).AudioDubEx(c)
}

Colorbars

SHOW=True

TIT="Hello World"

#TSub(TIT,SHOW)

ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))""")

Prefetch(4)
EDIT: Crap, you are right, align does not work with Prefetch, I guess I forgot about that when I was installing same version Avs as you.

Dont work.
Code:
Colorbars
TIT="Hello World"
#ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""),align=4)""")
ScriptClip("Subtitle(string(current_frame),align=4)")  # EDIT: Or shorter without additional subtitle string, still BUG
BUG=True    # <<<<<<<< TOGGLE BUG
(BUG)  ? Prefetch(4) : NOP
Return Last
EDIT: No align bug in v3.5 r3072.
__________________
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; 11th April 2020 at 19:22.
StainlessS is offline  
Old 11th April 2020, 20:34   #5422  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
try with https://forum.doom9.org/showthread.p...16#post1906016

seems fine
__________________
See My Avisynth Stuff
real.finder is offline  
Old 11th April 2020, 20:59   #5423  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
@real.finder: I can confirm that version works fine.
__________________
Hybrid here in the forum, homepage
Selur is offline  
Old 12th April 2020, 01:34   #5424  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by MeteorRain View Post
BTW I just rewrote the temporal median into dual synth interface early this week.
Thank you, MeteorRain, for giving the code under MIT license. Fabulous. Hoping it can help to eliminate code duplication from DGSource(). Built it in VS17 and it runs fine. Really great stuff!

Have to study it closely, though, because like pinterf it's pure C over here. CUDA has C syntax.

Last edited by videoh; 12th April 2020 at 01:39.
videoh is offline  
Old 12th April 2020, 02:26   #5425  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
My pleasure!
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline  
Old 12th April 2020, 06:19   #5426  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Selur View Post
@real.finder: I can confirm that version works fine.
This version is still under development, sometimes I'm leaking an actual test version to have feedback whether common functionalities are still working which will happen next week perhaps.
pinterf is offline  
Old 12th April 2020, 09:08   #5427  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by pinterf View Post
sometimes I'm leaking an actual test version
I use always your bleeding edge releases.
__________________
@turment on Telegram
tormento is offline  
Old 12th April 2020, 11:08   #5428  |  Link
Nuihc88
Registered User
 
Nuihc88's Avatar
 
Join Date: Oct 2016
Location: Tellus, Milky Way Galaxy
Posts: 21
Quote:
Originally Posted by pinterf View Post
And another Avisynth+ test build, please test it thorougly, I need more testers than myself

EDIT: link removed until I check real.finder's bug report
EDIT: test build 2nd edition:
https://drive.google.com/open?id=1iZ...x1C5FZ7PTd-4qw
I just came here to say that this is the fastest (lowest latency) and most stable AviSynth(+) build for real-time usage that i have ever used. Even with the Neo fixes i never would have expected to see latencies or performance this good.

Under 'average stats' MadVR is reporting latencies between 0.2 - 4 ms, averaging <2ms under load with a relatively heavy SVP script, while playing back a 12bit FullHD HEVC encode on a 1.5 decades old computer; while at idle it would be sitting at ~0.15ms...

It's like there's no longer any bottle-necking on the AviSynth side of things; everything just runs incredibly smoothly with no seek glitching and even frame-drop recovery is near-instantaneous.
This build may have rendered AviSynth.dll based performance tweaking obsolete for anything other than synthetic benchmarks.
Nuihc88 is offline  
Old 12th April 2020, 11:18   #5429  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by pinterf View Post
And another Avisynth+ test build
Would you please put prerelease too on GitHub?

I find them easier to find and get notifications too

__________________
@turment on Telegram
tormento is offline  
Old 12th April 2020, 14:28   #5430  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
another out of the range float problem

Code:
ColorBars(width=640, height=480, pixel_type="yv12")
Convertbits(32)
mt_lutxy(last,Invert(),"x x y - 9.9 * +", use_expr=1)
#~ ConvertBits(8)
Converttorgb24
it's ok with ConvertBits(8) but with Converttorgb24() it's not
__________________
See My Avisynth Stuff
real.finder is offline  
Old 12th April 2020, 16:49   #5431  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
There are 3 conversions there, to 444, to 8 bit then to rgb. I'm not sure in the order. I wonder which one fails?
pinterf is offline  
Old 13th April 2020, 12:33   #5432  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by StainlessS View Post
Default Memory Max on my machine with 12GB RAM, x86 1024MB, x64 3055MB [seems a bit high but I guess deliberate in case of HBD, probably fine if you got plenty RAM].
I did really simple tests, my target is max FPS only.

SD material

Script:
PHP Code:
SetMemoryMax(xxxx)
SetFilterMTMode("DEFAULT_MT_MODE"2)
LoadPlugin("D:\eseguibili\media\DGDecNV_x64\DGDecodeNV.dll")
DGSource("E:\in\DVD 1_43 Paradiso + inferno\inferno.dgi",ct=12,cb=12,cl=4,cr=4)
CompTest(1)
SMDegrain (tr=4thSAD=500refinemotion=falsen16=truemode=0contrasharp=falsePreFilter=4truemotion=falseplane=4chroma=true)
Prefetch(6
Code:
AVSMeter 2.9.8 (x64), 2012-2020, (c) Groucho2004
AviSynth+ 3.5 (r3132, master, x86_64) (3.5.0.0)

Number of frames:                 1568
Length (hh:mm:ss.ms):     00:01:02.720
Frame width:                       712
Frame height:                      552
Framerate:                      25.000 (25000/1000)
Colorspace:                       YV12
SetMemoryMax(128)
Code:
FPS (min | max | average):      2.726 | 1000000 | 23.45
Process memory usage (max):     1057 MiB
Thread count:                   77
CPU usage (average):            73.6%
SetMemoryMax(256)
Code:
FPS (min | max | average):      2.630 | 1000000 | 23.61
Process memory usage (max):     1061 MiB
Thread count:                   77
CPU usage (average):            73.9%
SetMemoryMax(512)
Code:
FPS (min | max | average):      3.295 | 1000000 | 23.65
Process memory usage (max):     1066 MiB
Thread count:                   77
CPU usage (average):            73.8%
SetMemoryMax(1000)
Code:
FPS (min | max | average):      3.101 | 1000000 | 23.65
Process memory usage (max):     1064 MiB
Thread count:                   77
CPU usage (average):            73.8%
SetMemoryMax(2000)
Code:
FPS (min | max | average):      2.826 | 1000000 | 23.65
Process memory usage (max):     1067 MiB
Thread count:                   77
CPU usage (average):            73.9%
SetMemoryMax(4000)
Code:
FPS (min | max | average):      3.313 | 1000000 | 23.56
Process memory usage (max):     1062 MiB
Thread count:                   77
CPU usage (average):            73.6%
SetMemoryMax(8000)
Code:
FPS (min | max | average):      3.515 | 1000000 | 23.51
Process memory usage (max):     1062 MiB
Thread count:                   77
CPU usage (average):            73.7%
HD material

Script:
PHP Code:
SetMemoryMax(xxxx)
SetFilterMTMode("DEFAULT_MT_MODE"2)
LoadPlugin("D:\eseguibili\media\DGDecNV_x64\DGDecodeNV.dll")
DGSource("E:\in\1_40 Alla ricerca di Nemo\nemo.dgi")
CompTest(1)
SMDegrain (tr=4thSAD=500refinemotion=falsen16=truemode=0contrasharp=falsePreFilter=4truemotion=falseplane=4chroma=true)
Prefetch(6
Code:
AVSMeter 2.9.8 (x64), 2012-2020, (c) Groucho2004
AviSynth+ 3.5 (r3132, master, x86_64) (3.5.0.0)

Number of frames:                 1456
Length (hh:mm:ss.ms):     00:01:00.727
Frame width:                      1920
Frame height:                     1080
Framerate:                      23.976 (24000/1001)
Colorspace:                       YV12
SetMemoryMax(128)
Code:
FPS (min | max | average):      1.308 | 454542 | 11.16
Process memory usage (max):     1243 MiB
Thread count:                   77
CPU usage (average):            66.3%
SetMemoryMax(256)
Code:
FPS (min | max | average):      1.946 | 285712 | 11.50
Process memory usage (max):     1241 MiB
Thread count:                   77
CPU usage (average):            67.8%
SetMemoryMax(512)
Code:
FPS (min | max | average):      1.772 | 232556 | 12.43
Process memory usage (max):     1341 MiB
Thread count:                   77
CPU usage (average):            69.4%
SetMemoryMax(1000)
Code:
FPS (min | max | average):      1.690 | 270268 | 12.38
Process memory usage (max):     1353 MiB
Thread count:                   77
CPU usage (average):            69.0%
SetMemoryMax(2000)
Code:
FPS (min | max | average):      1.892 | 277780 | 12.17
Process memory usage (max):     1344 MiB
Thread count:                   77
CPU usage (average):            69.0%
SetMemoryMax(4000)
Code:
FPS (min | max | average):      1.716 | 294115 | 12.16
Process memory usage (max):     1336 MiB
Thread count:                   77
CPU usage (average):            68.6%
SetMemoryMax(8000)
Code:
FPS (min | max | average):      2.071 | 232560 | 12.24
Process memory usage (max):     1355 MiB
Thread count:                   77
CPU usage (average):            68.9%
SetMemoryMax()
Code:
FPS (min | max | average):      1.830 | 263160 | 12.38
Process memory usage (max):     1358 MiB
Thread count:                   77
CPU usage (average):            69.2%
Well, it seems we have a winner: SetMemoryMax(512).

SetMemoryMax have impact on encoding speed too.

HD material (the same above)

x264_x64.exe --output-depth 8 --crf 20.0 --preset slow --tune animation --profile high --level 4.1 --keyint 240 --aq-mode 2 --sar 1:1 --output "nemoxxxx.mkv" --frames 1456 --demuxer y4m --stdin y4m

SetMemoryMax(256): 2.99 FPS
SetMemoryMax(512): 8.95 FPS
SetMemoryMax(1000): 8.28 FPS
SetMemoryMax(2000): 8.44 FPS
SetMemoryMax(4000): 8.65 FPS
SetMemoryMax(8000): 8.80 FPS
SetMemoryMax(): 9.12 FPS

Setting tr=6 in SMDegrain and repeating the three bests:

SetMemoryMax(512): 6.52 FPS
SetMemoryMax(8000): 6.68 FPS
SetMemoryMax(): 6.83 FPS

And, as I perhaps suffer from OCD, I redid the test for SD.

SD material (the same above)

x264_x64.exe" --output-depth 8 --crf 20.0 --preset slow --profile high --level 4.1 --keyint 240 --aq-mode 2 --sar 64:45 --output infernoxxxx.mkv --frames 1568 --demuxer y4m --stdin y4m

tr=4

SetMemoryMax(512): 18.79 FPS
SetMemoryMax(8000): 18.83 FPS
SetMemoryMax(): 19:15 FPS

tr=6

SetMemoryMax(512): 13.30 FPS
SetMemoryMax(8000): 14.22 FPS
SetMemoryMax(): 13.40 FPS

Fluctuations are so small that, apart SetMemoryMax(256), we can't tell who is the real winner. Better to minimize occupied RAM or to leave lot of space for AVS to work?

Anyway, I will leave SetMemoryMax(8000).
__________________
@turment on Telegram

Last edited by tormento; 13th April 2020 at 12:38.
tormento is offline  
Old 13th April 2020, 14:07   #5433  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
What is your default [EDIT: x64] SetMemorymax ? [and installed RAM]
Avs+ default is probably gonna be a good all around choice.

Latest updates to Avs+ and Mvtools etc seem to be kicking ass as far as speed goes (nice one guys).

EDIT:
Code:
BlankClip.Subtitle(String(SetMemoryMax))  # using x86[1024MB] and x64[???] app
__________________
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; 13th April 2020 at 14:17.
StainlessS is offline  
Old 13th April 2020, 14:52   #5434  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by StainlessS View Post
What is your default [EDIT: x64] SetMemorymax ? [and installed RAM]
8000 with 16GB installed on x64 Windows 10 enterprise.
Quote:
Originally Posted by StainlessS View Post
Avs+ default is probably gonna be a good all around choice.
I agree. That's why I keep on using it.

Quote:
Originally Posted by StainlessS View Post
Code:
BlankClip.Subtitle(String(SetMemoryMax))  # using x86[1024MB] and x64[???] app
Do you want me to execute that? You need some patience as I am encoding a loooooong job
__________________
@turment on Telegram

Last edited by tormento; 13th April 2020 at 14:59.
tormento is offline  
Old 13th April 2020, 16:21   #5435  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Do you want me to execute that?
Nope, no point really, just shows Avs default setMemoryMax, and as you are encoding, so available ram reduced and will show
what is available for 2nd instance of Avs+ if you were to create one.

When I said "What is your default", I meant result of that blankclip script which shows the avs+ default, not what you set YOUR chosen SetMemoryMax at.
My default was about 3550MB on 12GB ram/9GB avail .
__________________
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 ???
StainlessS is offline  
Old 13th April 2020, 18:08   #5436  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by StainlessS View Post
Nope, no point really
Isn't the AVSMeter a good indicator of how much RAM is used?

The funny thing about SetMemoryMax() is I can't find any reference of what it does when no parameter is given.

Now I am encoding almost everything with SetMemoryMax() instead of SetMemoryMax(8000) as it seems to give a little better speed for the reels and the script I encode.
__________________
@turment on Telegram

Last edited by tormento; 13th April 2020 at 18:12.
tormento is offline  
Old 14th April 2020, 03:42   #5437  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Do we have arrays as parameters in AVS+ now? Or are we still limited by passing strings? I'm looking at dfttest, and while vapoursynth version has moved to arrays, the original version still uses strings.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline  
Old 14th April 2020, 04:27   #5438  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
tormento,
UsedMB=SetMemoryMax() or UsedMB=SetMemoryMax(0) returns the currently used amount, so SetMemoryMax() without assigning to anything is a NOP, well does nothing useful.


Quote:
SetMemoryMax

SetMemoryMax(amount)
Sets the maximum memory that AviSynth uses (in MB) to the value of amount. Setting to zero just returns the current Memory Max value. In the 2.5 series the default Memory Max value is 25% of the free physical memory, with a minimum of 16MB.
The default Memory Max is also limited to 512MB.
In Avisynth+ this limit for default Memory Max is 1024MB for 32 bits and 4096MB on the x64 version
DefaultMemoryMax = minimum(physical_memory / 4, secondary_memory_max_limit)
for classic Avisynth see the table below

Free memory <64 128 256 512 1024 2048 3072
Default Max 16 32 64 192 448 512 512

In some versions there is a default setting of 5MB, which is quite low. If you encounter problems (e.g. low speed) try to set this values to at least 32MB. Too high values can result in crashes because of 2GB address space limit.
Return value: Actual MemoryMax value set.

Examples:

SetMemoryMax(128)

SetMemoryMax

SetMemoryMax(amount)
Sets the maximum memory that AviSynth uses (in MB) to the value of amount. Setting to zero just returns the current Memory Max value. In the 2.5 series the default Memory Max value is 25% of the free physical memory, with a minimum of 16MB.
The default Memory Max is also limited to 512MB.
In Avisynth+ this limit for default Memory Max is 1024MB for 32 bits and 4096MB on the x64 version
DefaultMemoryMax = minimum(physical_memory / 4, secondary_memory_max_limit)
for classic Avisynth see the table below

Free memory <64 128 256 512 1024 2048 3072
Default Max 16 32 64 192 448 512 512

In some versions there is a default setting of 5MB, which is quite low. If you encounter problems (e.g. low speed) try to set this values to at least 32MB. Too high values can result in crashes because of 2GB address space limit.
Return value: Actual MemoryMax value set.

Examples:

SetMemoryMax(128)
http://avisynth.nl/index.php/Interna...s#SetMemoryMax

MeteorRain,
Quote:
Do we have arrays as parameters in AVS+ now?
[EDIT: Below how it was, apparently is changed as per later posts]
Arrays cannot be implemented for script so long as Avs+ supports v2.58 dll loading. [ AvisynthPluginInit2() ]

Arrays have always been usable within C/CPP dll.

So cannot call script or dll function from within script using any arrays.

Exception is where dll accepts any 0 or more, OR 1 or more, args of a type where avisynth converts to array when calling dll (or builtin).
eg
Code:
c2=SomeDllFunction(clip, Int1, int2, int3, int4, int5,"Hello") # dll gets array of 5 int.
You cannot create an array in script, nor can a script function accept an array.

From Framesel() source
Code:
	env->AddFunction("FrameSel",			"ci*[SCmd]s[Cmd]s[Show]b[Ver]b[Reject]b[Ordered]b[Debug]b[Extract]i", Create_FrameSel, 0);
	// The AddFunction has the following paramters:
	// AddFunction(Filtername , Arguments, Function to call,0);
    
	// Arguments is a string that defines the types and optional nicknames of the arguments for you filter.
	// c - Video Clip
	// i - Integer number
	// f - Float number
	// s - String
	// b - boolean
	// . - Any type (dot)
	//      Array Specifiers
	// i* - Integer Array, zero or more
	// i+ - Integer Array, one or more
	// .* - Any type Array, zero or more
	// .+ - Any type Array, one or more
	//      Etc
So FrameSel dll script documentation prototype as so
Code:
FrameSel(Clip, int F1, ... , int Fn, string "scmd"="",string "cmd"="", bool "show"=false, bool "ver"=false,bool "reject"=false,bool "ordered"=true,bool "debug"=false, int "Extract"=1)
Where dll function has variable number of arguements of a type ie Array, then any arg following the array must be of a different type [otherwise Avs does not know where variable number
of args ends] OR, MUST be called using name of the arg following the variable number of args.
eg
Code:
SomeFunction(int Int1, ... ,int IntN, Int "Fred"=0)
If above must be called with fred arg, then must call as eg
Code:
x=SomeFunction(int1,int2,int3,int4,Fred=42)    # Must be called with Fred=42 otherwise 42 added to IntN array and Fred assigned default 0.
__________________
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; 14th April 2020 at 11:12.
StainlessS is offline  
Old 14th April 2020, 06:49   #5439  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,420
Quote:
Originally Posted by MeteorRain View Post
Do we have arrays as parameters in AVS+ now? Or are we still limited by passing strings? I'm looking at dfttest, and while vapoursynth version has moved to arrays, the original version still uses strings.
On Windows, no. Unless you're using a custom build where you passed -DNEW_AVSVALUE to the CXXFLAGS.

On POSIX, yes. NEW_AVSVALUE is on by default on non-Windows.
qyot27 is offline  
Old 14th April 2020, 07:29   #5440  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by qyot27 View Post
On Windows, no. Unless you're using a custom build where you passed -DNEW_AVSVALUE to the CXXFLAGS.

On POSIX, yes. NEW_AVSVALUE is on by default on non-Windows.
Yes, for arrays and other forecoming features I recommend reading the first ~400 lines:
https://github.com/pinterf/AviSynthP...me_history.txt

edit: if I remember well, in NEW_AVSVALUE build colors can be passed to BlankClip in array-style as well.

Last edited by pinterf; 14th April 2020 at 07:33.
pinterf 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 22:13.


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