Log in

View Full Version : Avisynth+


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 [76] 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

ryrynz
15th November 2017, 23:43
Gave the sizetmod a try but have it crash every time. Tried a simple script through ffdshow raw.

SetFilterMTMode("DEFAULT_MT_MODE", 2)
ffdshow_source()
aWarp4(Spline36Resize(width*4, height*4, 0.375, 0.375), aSobel.aBlur(), depth=2)
Prefetch(4)

MadVR ends up crashing, no issues with the normal build.

pinterf
16th November 2017, 09:24
Gave the sizetmod a try but have it crash every time. Tried a simple script through ffdshow raw.

SetFilterMTMode("DEFAULT_MT_MODE", 2)
ffdshow_source()
aWarp4(Spline36Resize(width*4, height*4, 0.375, 0.375), aSobel.aBlur(), depth=2)
Prefetch(4)

MadVR ends up crashing, no issues with the normal build.
Thanks. Do you know if anything in this chain is using CPP 2.5 or C interface?

For me they (x64 plugins with CPP 2.5 interface) are crashing with the sizetmod build. No wonder, 2.5 is the "baked" code interface.

I don't like them. For example supporting 2.5 prevented me last year to introduce the array type. Now this.

They badly need at least a recompile for 2.6.

tormento
16th November 2017, 12:08
Experimental x64 crashing here.

SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("ChangeFPS", 3)

SetFilterMTMode("DGSource", 3)
LoadPlugin("D:\eseguibili\media\DGDecNV\x64\DGDecodeNV.dll")
DGSource("E:\in\1_37 Swiss Army man — Un amico multiuso\swiss.dgi")

#CompTest(1)

ChangeFPS(last,last,true)

SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,truemotion=true,plane=4,chroma=true,lsb=true,mode=0)

Prefetch(6)

ryrynz
16th November 2017, 12:10
Thanks. Do you know if anything in this chain is using CPP 2.5 or C interface?


Shouldn't be. Awarp4, asobel and a blur are all part of the x64 build of Awarpsharp you compiled and is the latest version you released, it should be compatible.

pinterf
16th November 2017, 12:32
Shouldn't be. Awarp4, asobel and a blur are all part of the x64 build of Awarpsharp you compiled and is the latest version you released, it should be compatible.
Perhaps the source filter?

For example LSmashSource (CPP v2.5 as Avsmeter64 reports) is crashing for me. ffms2 is OK.

pinterf
16th November 2017, 12:54
Experimental x64 crashing here.

SetMemoryMax(8000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("ChangeFPS", 3)

SetFilterMTMode("DGSource", 3)
LoadPlugin("D:\eseguibili\media\DGDecNV\x64\DGDecodeNV.dll")
DGSource("E:\in\1_37 Swiss Army man — Un amico multiuso\swiss.dgi")

#CompTest(1)

ChangeFPS(last,last,true)

SMDegrain (tr=4,PreFilter=4,thSAD=400,contrasharp=false,refinemotion=false,truemotion=true,plane=4,chroma=true,lsb=true,mode=0)

Prefetch(6)
Thanks.
I don't know about the source filter, I have replaced it with ffms2.
The script still crashed with lsb=true.
Unfortunately dither.dll is a 2.5 style plugin.
With lsb=false the script is working properly with the given parameters.

Edit: rebuilt dither.dll, replaced the 2.5-style avisynth.h with the 2.6-style avs+ header (not even the size_t mod version) and no more crash with lsb=true.

tormento
16th November 2017, 16:37
Edit: rebuilt dither.dll, replaced the 2.5-style avisynth.h with the 2.6-style avs+ header (not even the size_t mod version) and no more crash with lsb=true.

Ahem... post new dither here :)

pinterf
16th November 2017, 16:49
Ahem... post new dither here :)
It does not help at the moment.
LSmashSource, dither, AddGrainC, x264_64, and a lot more cpp 2.5 plugins and 2.5 c interface user apps are out there.
Just have a look at the CPP 2.5 list of avsmeter -avsinfo.

tormento
16th November 2017, 17:01
It does not help at the moment.
LSmashSource, dither, AddGrainC, x264_64, and a lot more cpp 2.5 plugins and 2.5 c interface user apps are out there.
Just have a look at the CPP 2.5 list of avsmeter -avsinfo.

[CPP 2.5 / 64 Bit Plugins]
D:\Programmi\Media\AviSynth+\plugins64\Dither-1.27.2.dll
D:\Programmi\Media\AviSynth+\plugins64\f3kdb-2.020140721-SAPikachu.dll
To me is more than enough! It's the only filter I use still 2.5!

Yanak
17th November 2017, 11:17
https://s14.postimg.org/60ya489nl/81555120171117110558cr.png

Not sure if my used plugins are all up to date and /or if some others could be replaced by something else tho but things like LSmashSource, Avsinpaint, MP_Pipeline are essential for me and i don't think there is any alternative to those :/

Myrsloik
17th November 2017, 15:51
Sigh, I was actually about to do some proper avx2 speed tests. Then I saw that there's no installer and I'm going to go eat cookies instead. That is all.

real.finder
17th November 2017, 16:37
Sigh, I was actually about to do some proper avx2 speed tests. Then I saw that there's no installer and I'm going to go eat cookies instead. That is all.

put the Avisynth dll in same folder as avsmeter and it will work

iirc avsmeter allow you to use Avisynth dll from specific path too

LigH
17th November 2017, 17:00
Also there is the Universal Avisynth Installer (https://forum.doom9.org/showthread.php?t=172124) which is just as regularly updated as the github releases. Just check at least twice how to set up the batch file with custom installation directories before use, especially when the path may contain spaces.

Groucho2004
17th November 2017, 17:11
especially when the path may contain spaces.There's no problem with spaces. However, some special characters such as parentheses and ampersands need an escape character.

jinkazuya
26th November 2017, 03:48
Just get a question for pinterf or anybody else who has experience with avisynth+ MT. Just wonder if it is ok to add support for using more than 10 threads in the next avisynth+ MT build. In other word, will CPU like intel Intel® Core™ i9 series or AMD Ryzen or Threadripper be fully taken advantages of all their cores? Cuz right now whenever I use more than 10 or 11 threads, then MEGUI or the x264 will crash or freeze and cannot use over 10 threads.

DJATOM
26th November 2017, 06:26
jinkazuya
Just set reasonable Prefetch() and SetMemoryMax() and you will have near 100% CPU usage.

pinterf
27th November 2017, 11:19
Yes, as the memory usage (cache) is somewhat linear to the number of Prefetch threads, you are probably experiencing memory full issues. You can try AvsMeter with your script to see whether the memory usage is the bottleneck.
As DJATOM said you can experiment with SetMemoryMax and Prefetch count to see where it saturates your available memory. x64 version is recommended however (I don't know which version you are using)

sneaker_ger
29th November 2017, 17:55
Question.

Script:
ffVideoSource("cut.mkv")
mask=MaskHS(160,180, 100,80).mt_expand().BilinearResize(last.width, last.height)
overlay(last, GreyScale().ColorYUV(cont_y=50), 0, 0, mask)
Sample: https://mega.nz/#!tpUhhSZR!6g1OSKRzZAuu9pYL_t03O32PRlGgPeQwTRxU2dkuTbo

AviSynth 2.6.0:
https://forum.videohelp.com/attachment.php?attachmentid=25221&d=1478969615&thumb=1

AvisynthPlus-r2544-MT:
https://forum.videohelp.com/attachment.php?attachmentid=43857


Why does it become grey?

pinterf
29th November 2017, 18:21
Question.

Script:
ffVideoSource("cut.mkv")
mask=MaskHS(160,180, 100,80).mt_expand().BilinearResize(last.width, last.height)
overlay(last, GreyScale().ColorYUV(cont_y=50), 0, 0, mask)
Sample: https://mega.nz/#!tpUhhSZR!6g1OSKRzZAuu9pYL_t03O32PRlGgPeQwTRxU2dkuTbo

AviSynth 2.6.0:

AvisynthPlus-r2544-MT:



Why does it become grey?
MaskHS is giving a black clip for me on classic avs, and white on current avs+. And the whiteish mask makes the greyscale clip dominant.
Checked: r2173 was still o.k.

Edit: fixed on github. MaskHS was giving the inverse mask.

sneaker_ger
29th November 2017, 19:22
Thank you.

jinkazuya
30th November 2017, 02:21
Yes, as the memory usage (cache) is somewhat linear to the number of Prefetch threads, you are probably experiencing memory full issues. You can try AvsMeter with your script to see whether the memory usage is the bottleneck.
As DJATOM said you can experiment with SetMemoryMax and Prefetch count to see where it saturates your available memory. x64 version is recommended however (I don't know which version you are using)

Ok, What do you guys suggest I do for the prefetch and setMemoryMax?

I have 32GB of ram and 16 cores? Even if I boost the setMemoryMax to higher number, checking and monitoring the RAM, the computer uses only about 3GB or 5GB most. But if I set prefetch over 10 to 11, then MEGUI crashes.

I uses x86 version cuz if I use the x64, most of the older plugins won't work.

DJATOM
30th November 2017, 02:30
I'm using setmemorymax(32000) and prefetch(24) on dual socket Xeon 5675 server with ~50 GB RAM, average load near 99%.

>I uses x86 version cuz if I use the x64, most of the older plugins won't work.
Just forget about high prefetch values with 32 bit avisynth. You will hit 32 bit app memory limit.

jinkazuya
1st December 2017, 02:04
I'm using setmemorymax(32000) and prefetch(24) on dual socket Xeon 5675 server with ~50 GB RAM, average load near 99%.

>I uses x86 version cuz if I use the x64, most of the older plugins won't work.
Just forget about high prefetch values with 32 bit avisynth. You will hit 32 bit app memory limit.

Then I guess you must encode 4k or 1080 bluray videos then. Is there a way for the 32bit plugins work with the x64 avisynth+? Or a way to make them backward compatible?

real.finder
1st December 2017, 02:23
Then I guess you must encode 4k or 1080 bluray videos then. Is there a way for the 32bit plugins work with the x64 avisynth+? Or a way to make them backward compatible?

that already discussed https://forum.doom9.org/showthread.php?p=1824330#post1824330

edcrfv94
1st December 2017, 07:01
Then I guess you must encode 4k or 1080 bluray videos then. Is there a way for the 32bit plugins work with the x64 avisynth+? Or a way to make them backward compatible?

MP_Pipeline
But if you direct export or pass 9-32 bit clip will has green line on top, So need ConvertToStacked first.

real.finder
1st December 2017, 07:20
MP_Pipeline
But if you direct export or pass 9-32 bit clip will has green line on top, So need ConvertToStacked first.

ConvertToDoubleWidth ConvertFromDoubleWidth will be faster

jinkazuya
3rd December 2017, 07:10
Just wonder how to use the universal batch to set up avisynth+ x64...It is so confusing. Cuz whenever I used the regular avisynth+ installer, it always install avisynth+ into the "C:\Program Files (x86)", even I chose the x64 for avisynth+ installation. Then when I loaded the plugins for x64, the pop up appeared saying "cannot load x64 bit plugins dll into x86 avisynth+" something like that.

LigH
3rd December 2017, 08:19
^ You already asked that in the UAI thread where it belongs. This is an installer (usage) issue, not an AviSynth+ issue (the installer is not maintained primarily by AviSynth+ developers).

jinkazuya
3rd December 2017, 22:02
Not sure if somebody could port RedAverage plugin or some other plugins to x64. It would be awesome if somebody could maintain or port most of the old 32 avisynth or avisynth+ plugins to x64. Thanks.

LigH
3rd December 2017, 23:28
This may be impossible in all the cases where the original authors did not provide sources of their plugins, or did not document their algorithms detailed enough to reprogram them. But where it is possible, a lot of efforts were already invested to implement them. The AviSynth Wiki lists many successful attempts (http://avisynth.nl/index.php/AviSynth%2B_x64_plugins). If you know some missing ones, always provide links to their original location, optimally with sources. A few special plugins may even be easily resembled using very generic tools like convolution or LUT functions.

Specifically regarding "RedAverage", Average (http://avisynth.nl/index.php/Average) is reported to do the same, just faster.

jinkazuya
3rd December 2017, 23:44
This may be impossible in all the cases where the original authors did not provide sources of their plugins, or did not document their algorithms detailed enough to reprogram them. But where it is possible, a lot of efforts were already invested to implement them. The AviSynth Wiki lists many successful attempts (http://avisynth.nl/index.php/AviSynth%2B_x64_plugins). If you know some missing ones, always provide links to their original location, optimally with sources. A few special plugins may even be easily resembled using very generic tools like convolution or LUT functions.

Specifically regarding "RedAverage", Average (http://avisynth.nl/index.php/Average) is reported to do the same, just faster.

I know, but I would like to use the detailsharpen function. Unfortunately that function requires the RedAverage plugin.

LigH
3rd December 2017, 23:52
You mean this script function (https://forum.doom9.org/showthread.php?t=163598)? I bet this could be rewritten to use more portable/compatible kernel or plugin functions.

jinkazuya
4th December 2017, 01:50
You mean this script function (https://forum.doom9.org/showthread.php?t=163598)? I bet this could be rewritten to use more portable/compatible kernel or plugin functions.

Yes...This is the one I am talking about. I am a noob when it comes to scripting. But it seems nowadays less people are creating new scripts or plugins for video encodes. There used to be a lot more.

Myrsloik
5th December 2017, 21:41
I just tried to compile avisynth.h with /permissive- in Visual Studio 15.5. It fails. When are you going to change it to be valid C++ code?

Fun fact: this is now the default setting for new projects

pinterf
6th December 2017, 07:33
I have read about it but not yet tried.

pinterf
6th December 2017, 16:57
I just tried to compile avisynth.h with /permissive- in Visual Studio 15.5. It fails. When are you going to change it to be valid C++ code?

Fun fact: this is now the default setting for new projects
I have tried. So what's your problem?

Myrsloik
6th December 2017, 18:23
I have tried. So what's your problem?

4>C:\VapourSynth\AviSynthPlus\avs_core\include\avisynth.h(670): error C3447: third operand to the conditional operator ?: is of type 'void', but the second operand is neither a throw-expression nor of type 'void'

Basically a wall of this whenever you compile a plugin, compiling the core will obviously work since then the proper functions are provided. I even checked out the latest version from your MT branch to test it.

AVFS (and probably any plugin/api user) shows this problem.

pinterf
6th December 2017, 18:27
Ah. Then will try with a plugin. I only had syntax error in a win 7.1 sdk header which i commented out (because the 141xp toolset uses this sdk).

pinterf
8th December 2017, 17:07
4>C:\VapourSynth\AviSynthPlus\avs_core\include\avisynth.h(670): error C3447: third operand to the conditional operator ?: is of type 'void', but the second operand is neither a throw-expression nor of type 'void'

Basically a wall of this whenever you compile a plugin, compiling the core will obviously work since then the proper functions are provided. I even checked out the latest version from your MT branch to test it.

AVFS (and probably any plugin/api user) shows this problem.
Thanks, now it should be OK. There were other surprises as well.

Myrsloik
8th December 2017, 20:19
Thanks, now it should be OK. There were other surprises as well.

Works. As a bonus you can now easily use clang-cl to compile plugins too.

lordsmurf
10th December 2017, 00:32
I had to reinstall 2.6, and use SEt's MT dll.
I could never get the 32-bit + MT to work, and then tmedian2 was not available. That was a deal breaker.

The + x64 worked perfectly.

pinterf
10th December 2017, 10:20
I had to reinstall 2.6, and use SEt's MT dll.
I could never get the 32-bit + MT to work, and then tmedian2 was not available. That was a deal breaker.

The + x64 worked perfectly.What was the problem? Memory issues at large thread count?

ryrynz
11th December 2017, 21:39
Anyone compiled a new build?

pinterf
19th December 2017, 18:45
New version.
Avisynth Plus r2574 (https://github.com/pinterf/AviSynthPlus/releases/tag/r2574)

- Finally with an installer (x86/x64 in one package), thanks to Groucho2004. This is the first time I'm providing installer, there can be glitches. One of the installer comes with the current Visual Studio C++ x86 and x64 Redistributables. In theory the VS2017 redistributables superseed and are compatible with the VS2015 one. Please note that original Avisynth documentation and filter SDK is not provided, they are not up to date.

- A fix for MaskHS, reported by sneaker_ger, thanks for the report.

- The other things are mainly Expr related.

There was a bugfix in jit that took some time to understand and caused many grey hairs.
And new "why not" features to have my entertainment as well :)

The idea for introducing variables came for an earlier test Expr script, in which abs(x-y) was used and computed at least four times. Variables are temporary registers inside an Expr that can be saved, saved and popped from stack and reused many times. A variable is an uppercase letter from A to Z.

The other feature is the pixel-relative addressing. Clip variables can be shifted by (constant) x and y offset.

Both of this two features were found later in davidhorman's great rgba_rpn/y8_rpn filter: https://forum.doom9.org/showthread.php?t=172601

Two other Expr feature idea then was adopted from his filter: 'frameno' and 'time' ('n' and 't' in his version - in Expr lowercase letters are clip references)

Example: Mandelbrot zoomer, syntax rewritten from the above topic (https://forum.doom9.org/showthread.php?p=1738391#post1738391)
a="X dup * Y dup * - A + T^ X Y 2 * * B + 2 min Y^ T 2 min X^ "
b=a+a
c=b+b

blankclip(width=960,height=640,length=1600,pixel_type="YUV420P8")

Expr("sxr 3 * 2 - -1.2947627 - 1.01 frameno ^ / -1.2947627 + A@ X^ syr 2 * 1 - 0.4399695 "+\
"- 1.01 frameno ^ / 0.4399695 + B@ Y^ "+c+c+c+c+c+b+a+"X dup * Y dup * + 4 < 0 255 ?","128","128")


Changes since r2544
# Fix
Fix: MaskHS created inverse mask. Regression after r2173
Fix: jitasm code generation at specific circumstances in Expr filter

# Build
Build: changed avisynth.h, strict C++ conformity with Visual Studio 2017 /permissive- flag

# Other
Installer in two flavours: simple or full (with Microsoft Visual C++ Redistributables)

# New
Expr tweaks:
- Indexable source clip pixels by relative x,y positions.
Syntax: x[a,b] where
'x': source clip letter a..z
'a': horizontal shift. -width < a < width
'b': vertical shift. -height < b < height
'a' and 'b' should be constant. e.g.: "x[-1,-1] x[-1,0] x[-1,1] y[0,-10] + + + 4 /"
When requested pixels come from off-screen the off-screen values are cloned from the appropriate top-bottom-left-right edge.
Optimized version requires SSSE3 (and no AVX2 version is available). On non-SSSE3 CPUs falls back to C.

- sin cos tan asin acos atan (no SSE2/AVX2 optimization, when they appear in Expr a slower C code runs the expression)

- % (modulo). result = x - trunc(x/d)*d.
Note: internally everything is calculated as a 32 bit float.
A float can only hold a 24 bit integer number, don't expect 32 bit accuracy here.

- Variables: uppercase letters A..Z for storing and reuse temporary results, frequently used computations.
Store, result can still be used from stack: A@ .. Z@
Store and remove from stack: A^ .. Z^
Use: A..Z
Example: "x y - A^ x y 0.5 + + B^ A B / C@ x +"

- 'frameno' : use current frame number in expression. 0 <= frameno < clip_frame_count

- 'time' : calculation: time = frameno/clip_frame_count. Use relative time position in expression. 0 <= time < frameno/clip_frame_count

- 'width', 'height': currently processed plane width and height

LigH
19th December 2017, 19:26
Example: Mandelbrot zoomer...

:eek: Bringing another level of "Synth" into AviSynth. :sly:

And installers! :p

Groucho2004
19th December 2017, 19:45
New version.
Avisynth Plus r2574 (https://github.com/pinterf/AviSynthPlus/releases/tag/r2574)
Thank you.

Finally with an installer (x86/x64 in one package)Nice, I can retire my installer. :)

real.finder
19th December 2017, 21:42
Thanks pinterf

Fix: jitasm code generation at specific circumstances in Expr filter

so now it's time for lut/expr upscale things? :)

pinterf
19th December 2017, 22:14
Maybe. As you see I have implemented many masktools syntax elements in Expr: missing functions, modulo, similarly looking operators, basic scaling support. They are mostly similar but by now masktools lut is a bit behind Expr (e.g. variables).

real.finder
19th December 2017, 22:29
Maybe. As you see I have implemented many masktools syntax elements in Expr: missing functions, modulo, similarly looking operators, basic scaling support. They are mostly similar but by now masktools lut is a bit behind Expr (e.g. variables).

masktools syntax especially for float need to change

https://github.com/pinterf/masktools/issues/1

GMJCZP
19th December 2017, 23:55
Thank you pinterf!

A small observation: the only difference I notice with the old avisynth installer is that had by default activated "Select Association", while this installer does not have it.

EDIT: When I tried to directly open a script, instead of starting notepad the Windows Media Player was opened.
As I set the default program the notepad, the file icon naturally changed. To fix it I had to use a program called FileTypesMan, but I suppose the idea is for the installer to do it just like the old avisynth.