Log in

View Full Version : MP_Pipeline 0.18 - run parts of avisynth script in external processes [2014-04-06]


Pages : 1 2 3 4 [5] 6 7

SAPikachu
8th June 2014, 02:35
The alternate avisynth dll is loaded by an external process of which any application that loads the script is not and cannot be aware.
So, determining the version of that avisynth.dll can only happen on the script level unless MP_Pipeline exports a function for that purpose.

It will take non-trivial effort to (cleanly) implement this function, so I think I won't work on it just for displaying the version..

real.finder
10th July 2014, 01:05
AVSmeter reports the system's avisynth dll version rather than what's in the mp-pipeline block. Some examples, with avisynth 2.6 system dll:

version()
MP_Pipeline("""###
### dll: F:\avisynth+.dll
blankclip(1630,1920,1080,"YV12",23.976)
### ###
""")

#version() shows avisynth 2.6

MP_Pipeline("""###
### dll: F:\avisynth+.dll
version()
blankclip(1630,1920,1080,"YV12",23.976)
### ###
""")

#version() shows avisynth+

MP_Pipeline("""###
### dll: F:\avisynth+.dll
blankclip(1630,1920,1080,"YV12",23.976)
### ###
""")
version()

#version() shows avisynth 2.6

I'm not sure avsmeter could or should do anything about it, really up to you.

If you want, you can put avs dll with avsmeter in the same folder

this method work in any thing load avs script, like x264

Groucho2004
10th July 2014, 09:27
If you want, you can put avs dll with avsmeter in the same folder

this method work in any thing load avs script, like x264
That statement is not true. If you load avisynth.dll like this:
LoadLibrary("z:\\whateverpath\\avisynth.dll")
it will load that specific DLL.

However, most applications will load avisynth.dll without specifying a path and in that case the search order would be:

The directory from which the application loaded.
The current directory.
The System32/SysWoW64 directory.
The Windows directory.
The directories that are listed in the PATH environment variable.

aldix
18th December 2014, 18:38
### dll: doesn't seem to work with modified Avisynth for MT.dll

It gives

Unable to create slave process. Unable to load ... avisynth.dll, code=126

Any help or it's hopeless to try?

SAPikachu
19th December 2014, 09:10
### dll: doesn't seem to work with modified Avisynth for MT.dll

It gives

Unable to create slave process. Unable to load ... avisynth.dll, code=126

Any help or it's hopeless to try?

Code 126 is ERROR_MOD_NOT_FOUND, maybe try using full path to the DLL? If it doesn't work either, can you post your full script here for me to check?

aldix
22nd December 2014, 02:27
Oops, sorry for the delayed reply. Recalled about this just now ;)

I did use the full path. It wasn't a "system path," though, just from a folder from desktop. But that shouldn't matter, right?

All the other avisynth versions work fine.

Relevant script snip (retracted):


loadplugin("C:\...\MP_Pipeline.dll")
MP_Pipeline("""

### platform: win32


loadplugin("C:\....\ffms2.dll")
ffvideosource("C:\...\video.mkv").ConvertToYV12()

Crop(0,140,0,-140)
### export clip: last
### prefetch: 96, 64
### ###

...
loadplugin calls/imports
...

last.nnedi3_resize16(1280,532,noring=true,threads=4,lsb=true).ditherpost()


### dll: C:\...\Desktop\MT_07\avisynth.dll

last.denoise()

last.sharpen()

...

SAPikachu
22nd December 2014, 13:19
Oops, sorry for the delayed reply. Recalled about this just now ;)

I did use the full path. It wasn't a "system path," though, just from a folder from desktop. But that shouldn't matter, right?

All the other avisynth versions work fine.

Relevant script snip (retracted):


loadplugin("C:\...\MP_Pipeline.dll")
MP_Pipeline("""

### platform: win32


loadplugin("C:\....\ffms2.dll")
ffvideosource("C:\...\video.mkv").ConvertToYV12()

Crop(0,140,0,-140)
### export clip: last
### prefetch: 96, 64
### ###

...
loadplugin calls/imports
...

last.nnedi3_resize16(1280,532,noring=true,threads=4,lsb=true).ditherpost()


### dll: C:\...\Desktop\MT_07\avisynth.dll

last.denoise()

last.sharpen()

...


Does your dll path contain non-ASCII character? This may be a problem.

If this is not the case, can you upload the problematic version of avisynth.dll and another one that worked correctly to somewhere and send me the link? I suspect it is due to a dependency problem.

aldix
25th December 2014, 19:02
Hiya and merry X-mas :)

Could the case be that dll path contains spaces? I.e. if a path is \user\bla bla bla\else, it might choke?

If that's not it, sure, I'll post them somewhere. Just let me know.

I hope I won't forget about this thread again, sorry about this...

SAPikachu
27th December 2014, 01:51
Hiya and merry X-mas :)

Could the case be that dll path contains spaces? I.e. if a path is \user\bla bla bla\else, it might choke?

If that's not it, sure, I'll post them somewhere. Just let me know.

I hope I won't forget about this thread again, sorry about this...

Merry Christmas (late) and Happy New Year (early). :)

In theory space shouldn't matter, but to be certain can you also try a path without space?

aldix
27th December 2014, 02:59
Happy rest of the running year to you too :)

Sadly, there's no difference. There is still the error code = 126

Avisynth.dll for MT.dll (they're packed together, as per here: http://xhmikosr.1f0.de/_old/avisynth/plugins/ - the original doom9 link in the relevant thread is defunct, but it's the modded 2.5.something version which still supports MT.dll)
http://s000.tinyupload.com/?file_id=86671118413725137164

As for other DLLs that worked, here's 2.6 MT:
http://s000.tinyupload.com/?file_id=18443819082695553005

I'll be very intrigued as to what you'll be able to figure out :)


Thanks!

SAPikachu
27th December 2014, 03:25
This DLL loaded on my system (although I have to rename my plugins folder first, seems there are some plugins that break in this version.). This is likely a VC runtime problem, try installing this: http://thehotfixshare.net/board/index.php?autocom=downloads&showfile=10061

aldix
28th December 2014, 01:38
Thanks for the suggestion.

However, both in trying to install the upgrade and the thing itself (I presume), i.e. Microsoft Visual Studio .NET 2003 (http://www.microsoft.com/en-us/download/confirmation.aspx?id=703),
it fails with a message of the program required being not installed.

I'm on a Windows Server 2008 (I *think*). Might that be the problem to begin with?

SAPikachu
28th December 2014, 02:17
OK, then maybe we need to do a manual installation. You can download the 2 core DLL from https://www.dropbox.com/sh/fxxttnvcrtkzueg/AADS-NBg8-QGHUnA3UxvxwmSa?dl=0 (copied from my system), copy them to C:\Windows\SysWOW64 and try the script again?

aldix
29th December 2014, 07:06
Sorry to say, but exact same problem remains, Error 126 :(

SAPikachu
29th December 2014, 08:32
Sorry to say, but exact same problem remains, Error 126 :(

Well, I am out of guess now.. Maybe we have to use (one of) the last hand, can you use Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645) to capture a log during loading of the script and send me the log? Hope the log can reveal the cause for us..

Groucho2004
29th December 2014, 11:37
If I understand this correctly, an explicitly loaded avisynth.dll will still use the plugins from the directory that is referenced in the registry, right?

If so, I suggest the following:
- Rename the avisynth.dll in SysWOW64 to avisynth.dl (for example)
- Copy the 2.5.7 DLL to SysWOW64

- Run this (http://forum.doom9.org/showthread.php?t=170647) tool
1. File -> Save info
2. Tools -> Plugin Info -> Save plugin info report
3. Post both logs and any error messages you might get.

real.finder
10th January 2015, 01:08
Sorry to say, but exact same problem remains, Error 126 :(

http://forum.doom9.org/showpost.php?p=1657662&postcount=136

mohamedh
10th January 2015, 20:19
Hi,

At first I would like to thank you for this great tool

I'm not sure if I did really understand how it works
so here's my scripte before mp-pipeline


MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)#=41060
trim(2699,0)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
AnimeIVTC(mode=1, omode=1, credconv="mocomp", nnedi3pel=true, e1=36123, i1=38361)
vid=last
op=Import("C:\Users\bassiouny\Desktop\op.avs")

op+vid


GradFun3(thr=0.28) #or any debandning filter
import("C:\Users\bassiouny\Desktop\fansubs\AvsPmod\plugins\DeHaloH.avsi")
DeHaloHmod(radius=4)
vmToon()
mcDAA3()

Crop(2, 0, -2, -0) #not imporatant
spline36resize(720,480)



And in order to increase the encoding speed I'm using Mp-pipeline like this:

MP_Pipeline("""

### platform: win64
SetMemoryMax(2548)
setMTmode(2)
MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)#=41060
trim(2699,0)
### ###
### platform: win32
SetMemoryMax(948)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
setMTmode(2)
AnimeIVTC(mode=1, omode=1, credconv="mocomp", nnedi3pel=true, e1=36123, i1=38361)
vid=last
op=Import("C:\Users\bassiouny\Desktop\op.avs")

op+vid

SoraThread()

GradFun3(thr=0.28) #or any debandning filter
import("C:\Users\bassiouny\Desktop\fansubs\AvsPmod\plugins\DeHaloH.avsi")
DeHaloHmod(radius=4)
vmToon()
mcDAA3()
### ###

### platform: win64
setMTmode(2)
Crop(2, 0, -2, -0) #not imporatant
spline36resize(720,480)
### lock threads to cores

### ###
""")


and here's the op.avs that I called in my script

MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)

trim(0,2698)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
AnimeIVTC(4, omode=1)


does my script contain mistakes? can someone suggest some improvements or tips ?

And thanks in advance

P.S: I'm using a 32 GB of ram, quad core processor, 64bit avisynth and the 64 bit X264 encoder

Dogway
12th January 2015, 11:03
I just came to say thanks for this plugin. The other day I was encoding while I had to do some Photoshop work, it looks like I got out of RAM (got 8Gb though) and quite surprisingly MP_Pipeline paused the encoding and warned that I had to free up some memory. It really shows some professionalism, the only thing I miss for this is better documentation, I always feel like dealing with some kind of voodoo magic when setting it up.

Again thank you.

SAPikachu
12th January 2015, 12:27
Hi,

At first I would like to thank you for this great tool

I'm not sure if I did really understand how it works
so here's my scripte before mp-pipeline


MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)#=41060
trim(2699,0)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
AnimeIVTC(mode=1, omode=1, credconv="mocomp", nnedi3pel=true, e1=36123, i1=38361)
vid=last
op=Import("C:\Users\bassiouny\Desktop\op.avs")

op+vid


GradFun3(thr=0.28) #or any debandning filter
import("C:\Users\bassiouny\Desktop\fansubs\AvsPmod\plugins\DeHaloH.avsi")
DeHaloHmod(radius=4)
vmToon()
mcDAA3()

Crop(2, 0, -2, -0) #not imporatant
spline36resize(720,480)



And in order to increase the encoding speed I'm using Mp-pipeline like this:

MP_Pipeline("""

### platform: win64
SetMemoryMax(2548)
setMTmode(2)
MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)#=41060
trim(2699,0)
### ###
### platform: win32
SetMemoryMax(948)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
setMTmode(2)
AnimeIVTC(mode=1, omode=1, credconv="mocomp", nnedi3pel=true, e1=36123, i1=38361)
vid=last
op=Import("C:\Users\bassiouny\Desktop\op.avs")

op+vid

SoraThread()

GradFun3(thr=0.28) #or any debandning filter
import("C:\Users\bassiouny\Desktop\fansubs\AvsPmod\plugins\DeHaloH.avsi")
DeHaloHmod(radius=4)
vmToon()
mcDAA3()
### ###

### platform: win64
setMTmode(2)
Crop(2, 0, -2, -0) #not imporatant
spline36resize(720,480)
### lock threads to cores

### ###
""")


and here's the op.avs that I called in my script

MPEG2Source("C:\Users\bassiouny\Desktop\bleach disk1\VIDEO_TS\VIDEO_TS.d2v").ThreadRequest()
trim(14580,55640)

trim(0,2698)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
AnimeIVTC(4, omode=1)


does my script contain mistakes? can someone suggest some improvements or tips ?

And thanks in advance

P.S: I'm using a 32 GB of ram, quad core processor, 64bit avisynth and the 64 bit X264 encoder

Here are some tips:
1. You may try setting memory limit of all block to around 2.5G, especially the one with AnimeIVTC, since that's a quite complex filter.
2. Use ### prefetch in each block. 32, 16 is a good start, but you may want to tweak the values for better performance.
3. Not quite sure how setmtmode/ThreadRequest/SoraThread work in MPP but I think I will remove them and use more blocks and prefetch instead, since that will be more stable, and maybe even faster.

SAPikachu
12th January 2015, 12:32
I just came to say thanks for this plugin. The other day I was encoding while I had to do some Photoshop work, it looks like I got out of RAM (got 8Gb though) and quite surprisingly MP_Pipeline paused the encoding and warned that I had to free up some memory. It really shows some professionalism, the only thing I miss for this is better documentation, I always feel like dealing with some kind of voodoo magic when setting it up.

Again thank you.

Well.. if I am not mistaken this is actually message from Windows, I don't remember that I coded this kind of function into MPP. :)

Regarding documentation, I am really not good at that..

surgical
24th June 2015, 17:20
Greetings to all:
First of all, thank you and congratulations for this tool.
It's really useful, and has relieved me of some problems such as crashes and hangs due to some demanding MT scripts, going to encode to x264 in Megui.
My problem, for which I ask your assistance is due to a script, more complex than usual, that I'm unable to transcribe MP pipeline properly.
Setmemorymax(1024)
SetMTMode(3,6)
LoadPlugin("C:\CODIFICACION VIDEO BD\MeGUI 2525\tools\dgindexnv\DGDecodeNV.dll")
DGSource("E:\CARPETA CODIFICACION\*******.dgi")
SelectRangeEvery(10000,500)

SetMTMode(2,0)
l_width = last.width
l_height = last.height
sss=1.5
dispWidth = round(sss*l_width/8)*8
dispHeight = round(sss*l_height/8)*8
mWidth = float(l_width)
mHeight = float(l_height)
ratio = (mWidth/mHeight)
newHeight= round((dispWidth/ratio)/8)*8
newHeight > dispHeight ? Eval("""
newHeight=dispHeight
newWidth=round((newHeight*ratio)/8)*8
""" ) : Eval("""
newWidth=dispWidth
""" )
LanczosResize(newWidth,newHeight)

Repair(Gaussresize(newWidth,newHeight,p=100),1)
source=last
s=60
w=12
w=w*(128/s)
subtract(source.binomialBlur(varY=0.4515, varC=0, Y=3, U=2, V=2, useMMX=true),source)
levels(0+s,1,255-s,0,255)
levels(127-w,1,128+w,127-w,128+w)
subtract(source,last)

LimitedSharpenFasterHC(strength=80)

UnsharpHQ(THRESHOLD=80,SHARPSTR=2.6,SMOOTH=0.0, SHOW=false)
aWarpSharp2(thresh=100, blur=2, type=0, depth=16, chroma=4)

source.mt_makediff(mt_makediff(source.binomialBlur(varY=0.0001, varC=0, Y=3, U=2, V=2, useMMX=true),last),U=2,V=2)

SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb=true,chroma=false,plane=0)
GradFun3()
FastLineDarkenMod()
LinearResize(1920,1080, kernel="spline36", mode=0)

As much as I look at the readme.avs and this thread, performing multiple tests, I didn't do it correctly.
The first problem, and perhaps more importantly, is with a section of the script, which uses a similar syntax MP own code, and that causes problems like "expected to, or)".
The rest, I guess I would find out where and how it should be used, as appropriate, the correct syntax (splitts, export clip, etc ....) to adapt in the best possible way to use in MP; or if I had to even make changes to the syntax of the script itself for adaptation to MP
In normal use, encoding it in Megui, only I managed to make it run more or less stable at 0.5 FPS on my i7 5930x with 16 GB RAM
It is certainly not my intention seems comfortable and simply wait to be others who do the work. I want to learn the proper use of this tool but with this script I'm totally lost.
Thank you all in advance

colours
24th June 2015, 21:01
>binomialBlur(varY=0.4515, varC=0, Y=3, U=2, V=2, useMMX=true)
>binomialBlur(varY=0.0001, varC=0, Y=3, U=2, V=2, useMMX=true)

These probably don't do what you think they do. Unless you think they're supposed to give you black frames instead of blurring, in which case, yes, they do exactly what you think they do. The variance parameters get rounded down to the nearest multiple multiple of 0.5, and var*=0 has special treatment. Either way, this is useless.

Heck, I might as well clean up the whole script while I'm at it. All comments and significant changes are blue.

DGSource("E:\CARPETA CODIFICACION\*******.dgi")
SelectRangeEvery(10000,500)

sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)

source = last
s = 60
w = 24
mt_makediff(source.RemoveGrain(11),source)
mt_lut("x 128 - "+string(128.0/(128.0-s))+" * 128 + "+string(128-w)+" max "+string(128+w)+" min")
mt_makediff(source,last,u=2,v=2)

LimitedSharpenFasterHC(strength=80)

UnsharpHQ(THRESHOLD=80,SHARPSTR=2.6,SMOOTH=0.0, SHOW=false)
aWarpSharp2(thresh=100, blur=2, type=0, depth=16, chroma=4)
# do you really need four sharpening filters in a row?

last.MergeChroma(source)

FastLineDarkenMod() # moved this before denoising/debanding, but is this even necessary?

Spline36Resize(1920,1080)
# don't do the denoising/debanding with supersampling because
# that doesn't help with quality and makes things slower

SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb_in=false,lsb_out=true,chroma=false,plane=0)
GradFun3(lsb_in=true)

As usual, I didn't bother testing this, so while it should be correct, I have no idea whether it actually is.

With all the cruft cleaned up, it should be fairly clear how to use MP_Pipeline with it. Oh, and the reason you were seeing syntax errors is most likely that you didn't appropriately escape the triple quotes used with Eval in the original script.

surgical
24th June 2015, 22:51
Thanks, colours:
The truth is that I'm aware that this script needs to be optimized (in this also I've to learn a lot), but I wanted to reflect as it had it because, mainly, I was interested to learn how to use MP appropriately with a complex script that was valid, although this was not optimized, you know , like a learning script.
As for the quotes of the VAL function, I suppose, if I'm not mistaken, they must be written without spaces; I don't know if there will be any impropriety in the syntax; anyway, the script works.
Anyway I appreciate very much the ideas and corrections that you've reflected in the script; any other that you think will be welcome. I would like to see as well optimized by one skilled as you, but I don't think that this is the right thread for this topic .

BakaProxy
15th August 2015, 03:34
I seem to have an issue as well.

MP_Pipeline("""
LWLibavVideoSource("C:\Users\Yours Truly\Desktop\avs\00002.m2ts")
tfm(pp=0)

### prefetch: 32, 8
### ###
""")

http://i.imgur.com/gn4NxNs.png

http://i.imgur.com/n7TGY1q.png

Problem signature:
Problem Event Name: APPCRASH
Application Name: MP_Pipeline.dll.slave.exe
Application Version: 0.0.0.0
Application Timestamp: 52fde7be
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.18933
Fault Module Timestamp: 55a69ec4
Exception Code: e06d7363
Exception Offset: 0000c42d
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

BakaProxy
15th August 2015, 19:32
nevermind, putting the plugin in "plugins+" instead of plugin fixed it somehow.

using avisynth+.

real.finder
9th November 2015, 08:59
hi SAPikachu

setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()

cpu 75% 34 fps


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
""")


cpu 10% 7.5 fps


MP_Pipeline("""
### platform: win32
setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
distributor()
### ###
""")


cpu 95% 25 fps


MP_Pipeline("""
### platform: win32
setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
### ###
""")


cpu 78% 38 fps


setmtmode(2,12)
MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
""")


https://i.imgur.com/O05E3EZ.png
and if it work it will be very slow


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
""")


and


ColorBars(width=720, height=480, pixel_type="RGB32")
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()


crash

seems that avs mt need setmtmode in the beginning of script!

and seems mp_pipeline has a hiding call in the beginning of every block except the first one

so I think we need something like "### setmtmode" to use it between script blocks

SAPikachu
9th November 2015, 15:20
hi SAPikachu

setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()

cpu 75% 34 fps


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
""")


cpu 10% 7.5 fps


MP_Pipeline("""
### platform: win32
setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
distributor()
### ###
""")


cpu 95% 25 fps


MP_Pipeline("""
### platform: win32
setmtmode(2,12)
ColorBars(width=720, height=480, pixel_type="RGB32")
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
### ###
""")


cpu 78% 38 fps


setmtmode(2,12)
MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
""")


https://i.imgur.com/O05E3EZ.png
and if it work it will be very slow


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
""")


and


ColorBars(width=720, height=480, pixel_type="RGB32")
setmtmode(2,12)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()


crash

seems that avs mt need setmtmode in the beginning of script!

and seems mp_pipeline has a hiding call in the beginning of every block except the first one

so I think we need something like "### setmtmode" to use it between script blocks

SetMTMode outside MPP affects host AVS process and MPP itself, as you can see, generally they are not compatible and will crash. I don't really recommend using SetMTMode, even inside child processes, but if you want, you can either put SetMTMode inside every script block, or use ### inherit start/end to include it automatically.

real.finder
9th November 2015, 15:54
SetMTMode outside MPP affects host AVS process and MPP itself, as you can see, generally they are not compatible and will crash. I don't really recommend using SetMTMode, even inside child processes, but if you want, you can either put SetMTMode inside every script block, or use ### inherit start/end to include it automatically.


MP_Pipeline("""
### platform: win32
### inherit start ###
setmtmode(3,12)
### inherit end ###
ColorBars(width=720, height=480, pixel_type="RGB32")
setmtmode(1)
distributor()
### ###
setmtmode(2)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
""")


7 fps


MP_Pipeline("""
### platform: win32
### inherit start ###
setmtmode(3,12)
### inherit end ###
ColorBars(width=720, height=480, pixel_type="RGB32")
setmtmode(1)
distributor()
### ###
setmtmode(2)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
### ###
""")


and


MP_Pipeline("""
### platform: win32
### inherit start ###
setmtmode(3,12)
### inherit end ###
ColorBars(width=720, height=480, pixel_type="RGB32")
setmtmode(1)
distributor()
### ###
setmtmode(2)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
setmtmode(1)
distributor()
### ###
""")
gradfun3()


crash

My suggestion is to add something like "### setmtmode: x, y" to add setmtmode(x,y) in the top of script block and setmtmode(1) then distributor() in the bottom of block

and with this we can use mt in certain blocks only

thanks :)

SAPikachu
11th November 2015, 05:36
My suggestion is to add something like "### setmtmode: x, y" to add setmtmode(x,y) in the top of script block and setmtmode(1) then distributor() in the bottom of block

and with this we can use mt in certain blocks only

thanks :)

That's only one line less than current.. You can already do this by manually adding these lines to individual blocks.

real.finder
11th November 2015, 05:47
That's only one line less than current.. You can already do this by manually adding these lines to individual blocks.

no, I can't, I will get crash as I mention before, even with using ### inherit start/end, because the setmtmode will be after "MPP_GetUpstreamClip()"

I can do this in first block only because it doesn't have MPP_GetUpstreamClip()

SAPikachu
11th November 2015, 05:58
no, I can't, I will get crash as I mention before, even with using ### inherit start/end, because the setmtmode will be after "MPP_PrepareDownstreamClip()"

I can use do this in first block only because it doesn't have MPP_PrepareDownstreamClip()

MPP_PrepareDownstreamClip is used to pull video from upstream process, it is not thread-safe IIRC, so even you can place SetMTMode before that, it is unlikely to work.

EDIT: Sorry, my comment above is incorrect, I didn't pay attention while writing that.. But anyways, using SetMTMode inside MPP is not supported, it causes many issues and I don't want to add code to support it.

real.finder
11th November 2015, 06:04
MPP_PrepareDownstreamClip is used to pull video from upstream process, it is not thread-safe IIRC, so even you can place SetMTMode before that, it is unlikely to work.

even if it not thread-safe it should work at lest with mode 6 or 5 in setmtmode

and you can make it thread-safe alone for that, right?

real.finder
12th November 2015, 09:06
EDIT: Sorry, my comment above is incorrect, I didn't pay attention while writing that.. But anyways, using SetMTMode inside MPP is not supported, it causes many issues and I don't want to add code to support it.

I make a SetMTMode.avsi and putted setmtmode(2) in it and put SetMTMode.avsi in autoload folder and load


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### ###
### platform: win32
setmtmode(2)
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
distributor()
### ###
""")


in x264 64bit and everything ok, cpu 75% and fps 38

now I installed VS 2012 and successful compile MP_Pipeline and tried to add ### top start/end but my knowledge in C++ zero as I not a programmer in first place

the main problem is I don't now where the top of block

after some tried I could understand a little how MP_Pipeline work

the block start with MPP_SharedMemoryClient() ((plugin)) and MPP_GetUpstreamClip() ((script I think))

real.finder
14th November 2015, 11:29
ok, I did it in a roundabout way

http://www.mediafire.com/download/kvy2wy6k15uj0k1/MP_Pipeline+0.18.1.rar

edit: build with xp support

or with vc10 and no static http://www.mediafire.com/file/wj1v0ydkfhirl5e/MP_Pipeline_0.18.1_vc10_no_static.rar

http://www.mediafire.com/download/3szchn46e0ul6cy/MP_Pipeline-0.18.1+src.rar

test script


MP_Pipeline("""
### platform: win32
ColorBars(width=720, height=480, pixel_type="RGB32")
### setmtmode: 2,0
# setmtmode here for the next block
### ###
### platform: win32
ConvertToYV12()
QTGMC(InputType=1, Ezdenoise=2)
LSFMod(strength=66)
gradfun3()
setmtmode(1)
# enable MT
distributor()
### ###
""")


edit: new one https://github.com/realfinder/MP_Pipeline/releases

real.finder
15th May 2016, 02:19
edit: see here https://github.com/SAPikachu/MP_Pipeline/issues/1

vinnytx
18th May 2016, 21:52
Hi,

I use this script to resize movies during playback
Import("C:\Program Files (x86)\AviSynth\plugins\dither.avsi")
Import("C:\Program Files (x86)\AviSynth\plugins\mt_xxpand_multi.avsi")
Import("C:\Program Files (x86)\AviSynth\plugins\nnedi3_resize16_v3.3.avsi")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\nnedi3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\dither.dll")
SetMemoryMax(512)
SetMTMode(3,8)
ffdshow_source()
SetMTMode(3)
dispWidth = 1920
dispHeight = 1080
mWidth = float(last.width)
mHeight = float(last.height)
ratio = (mWidth/mHeight)
newHeight= round((dispWidth/ratio)/2)*2
newHeight > dispHeight ? Eval("""
newHeight=dispHeight
newWidth=round((newHeight*ratio)/2)*2
""") : Eval("""
newWidth=dispWidth
""")
nnedi3_resize16(newWidth,newHeight)
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last

It has a huge cpu usage
Please, someone can tell me how speed up my script with this plugin?

vinnytx
29th May 2016, 20:32
I installed Avisynth+ and I tried to simplify my script thanks to a previous post of colours

LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins+\MP_Pipeline.dll")
MP_Pipeline("""
### platform: win32
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)
distributor()
### ###
""")


But now I have this error message
MP_Pipeline: Unable to create slave process. Message: Script error: Script error: Invalid arguments to function 'width'. (ffdshow_filter_avisynth_script, line 10)

Groucho2004
29th May 2016, 22:09
I installed Avisynth+ and I tried to simplify my script thanks to a previous post of colours

LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins+\MP_Pipeline.dll")
MP_Pipeline("""
### platform: win32
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)
distributor()
### ###
""")


But now I have this error message
MP_Pipeline: Unable to create slave process. Message: Script error: Script error: Invalid arguments to function 'width'. (ffdshow_filter_avisynth_script, line 10)
1. There is no source filter in your script and therefore the "last" variable is undefined
2. Avisynth+ does not have a function "distributor()"

vinnytx
30th May 2016, 01:03
This script works well
ffdshow_source()
SetMemoryMax(512)
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)


This doesn't work

LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins+\MP_Pipeline.dll")
MP_Pipeline("""
### platform: win32
ffdshow_source()
SetMemoryMax(512)
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)
### ###
""")

I have this error message
MP_Pipeline: Unable to create slave process. Message: Script error: Script error: There is no function named 'ffdshow_source'. (ffdshow_filter_avisynth_script, line 10)

StainlessS
30th May 2016, 06:08
No idea, but try eg


LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins+\MP_Pipeline.dll")
ffdshow_source() # NOT INSIDE MP_PipeLine script
MP_Pipeline("""
### platform: win32
SetMemoryMax(512)
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)
### ###
""")

vinnytx
30th May 2016, 08:03
Ok, now I have another error message
MP_Pipeline: Unable to create slave process. Message: Script error: Script error: Invalid arguments to function 'width' (ffdshow_filter_avisynth_script, line 11)

Groucho2004
30th May 2016, 08:44
Ok, now I have another error message
MP_Pipeline: Unable to create slave process. Message: Script error: Script error: Invalid arguments to function 'width' (ffdshow_filter_avisynth_script, line 11)
The source filter statement has to be within the "MP_Pipeline" construct. This combination may not work at all since ffdshow_source() is not a conventional source filter. My knowledge of Avisynth scripts in ffdshow is very limited though...

DJATOM
31st May 2016, 09:35
No idea, but try eg


LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins+\MP_Pipeline.dll")
ffdshow_source() # NOT INSIDE MP_PipeLine script
MP_Pipeline("""
### platform: win32
SetMemoryMax(512)
sss = 1.5
newWidth = round(sss*width(last)/8)*8
newHeight = round(sss*height(last)/8)*8
LanczosResize(newWidth,newHeight)
### ###
""")


As I know, MP_Pipeline can't pass clips that way. So it will not work.

vinnytx
31st May 2016, 11:41
As I know, MP_Pipeline can't pass clips that way. So it will not work.

Any advice?

Stereodude
31st May 2016, 16:55
I know jack about ffdshow_source. Is it a built in function of AVIsynth/AVIsynth+ otherwise don't you need to load a plugin? Is it auto-loading for 64-bit, but not 32-bit?

StainlessS
31st May 2016, 17:03
Never used it (ffdshow_source), but see here:- http://ffdshow-tryout.sourceforge.net/wiki/video:avisynth

Is installed by ffdshow-tryout.

EDIT: you have to select tick box on install, see below
https://s20.postimg.cc/3tnzz7zi5/ffdshow-tryouts_zpsh2dtglea.jpg (https://postimg.cc/image/qv4l4yz5l/)

EDIT: I dont currently have ffdshow installed, but I think it may install the dll into it's own directory,
perhaps a copy into autoload plugins dir would work for general usage.

vinnytx
31st May 2016, 20:45
ffavisynth.avsi
ffavisynth.dll

They are already in the Avisynth+ plugins+ directory

Chyrka
14th August 2016, 15:46
Hello.
Is it possible to use MP_Pipeline and ScriptClip inside it?
They both started from """ tripple quote marks. ScriptClip does not want to work with a single quotation mark as it is stated in the documentation. :(

real.finder
16th August 2016, 01:32
Hello.
Is it possible to use MP_Pipeline and ScriptClip inside it?
They both started from """ tripple quote marks. ScriptClip does not want to work with a single quotation mark as it is stated in the documentation. :(

made a simple function like this

function ScriptClip_lines(clip c) {
c
*ScriptClip here*
}


and put it in .avs and import that .avs inside MP_Pipeline
then put the "ScriptClip_lines()" line in the place you want