26 (edited by Mystery 05-01-2015 21:40:32)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

OK. I haven't got any such random crashes in 2.6. These are embedded in a software I made so I'll keep 2.5.8 in it for now, perhaps letting them know they can replace with v2.6

If it helps, I can also give it a try with AviSynth+ and let you know what happens.

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Chainik wrote:

why you think we didn't tried? smile
in fact anyone with basic knowledge of JavaScript can "port" it, just edit a few lines in generate.js

replace

avs.WriteLine('SetMTMode(3,threads)');

with

avs.WriteLine('SetFilterMTMode("",2)');
avs.WriteLine('SetFilterMTMode("ffdShow_source",3)');

remove

avs.WriteLine('SetMTMode(2)');

replace

avs.WriteLine("distributor()");

with

avs.WriteLine("Prefetch("+threads+")");

I tried it but get an error that SetFilterMTMode doesn't exist.

Now I get what you're saying that MT isn't in the official AviSynth+ build... so where do I get the MT version then? I searched for it and can't find a MT version of AviSynth+

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery
where do I get the MT version then?

on the GitHub big_smile

====
ok, I can even build it for you smile
this is "pure" git version
"my" own version with some fixes right now has a lot of debugging code inside so I can't give it to you...

Post's attachments

AVSplusMT_git.zip 423.69 kb, 702 downloads since 2015-01-06 

29 (edited by Mystery 06-01-2015 20:48:33)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Oh it doesn't even have a compiled version! Thanks, I really wasn't interested in compiling it myself.

So far it's working, with memory usage between 600-1000MB (similar to 2.5.8)

There might be a slight additional lag when initializing videos.

Anything I should pay attention to when testing it?

The main problem with 2.5.8 MT is that especially when controlling MPC-HC via API, it crashes very regularly and I need to scan the process every few seconds to detect a crash to auto-kill the process.

One question about SVP... if I wanted to patch 'generate.js' during setup, is there a way for me to programmatically know in which folder SVP was installed? MPC-HC has a registry key with its installation path, but I haven't found anything to indicate SVP's location.

And another quick question (perhaps off-topic): when using SVP with Interframe, what happens if I always specify to use the GPU and it runs on a computer that doesn't support it?

Re: SVP with AviSynth 2.6 or AviSynth+ ?

I tried using this build of AviSynth+ MT for encoding videos with EEDI3+NNEDI3, and am getting about 3-4% lower performance than with the official build.

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery
with memory usage between 600-1000MB (similar to 2.5.8)

similar to 2.5.8 "SVP build" roll

Anything I should pay attention to when testing it?

memory leaks especially after script reloading
MT efficiency (how many threads're required to achieve "SVP index" = 1) (more threads => more memory consumption)
overall stability

The main problem with 2.5.8 MT is that especially when controlling MPC-HC via API, it crashes very regularly

I really have no idea how you make it happen. In a real life it doesn't crash at all unless you start seeking the video.

is there a way for me to programmatically know in which folder SVP was installed?

may be via uninstallation path?

what happens if I always specify to use the GPU and it runs on a computer that doesn't support it?

AVS script will give an error


I tried using this build of AviSynth+ MT for encoding videos with EEDI3+NNEDI3, and am getting about 3-4% lower performance than with the official build.

Not my fault  big_smile  Building AVS+ is extremely straightforward - like opening the solution and pressing "Build" button.
May be MT branch doesn't incorporate ALL commits to the main one...

Re: SVP with AviSynth 2.6 or AviSynth+ ?

I have done some performance tests with SVP encoding via Interframe

For each version I tried with and without the first command "Setmemorymax(512)"

2.5.8 MT:   0m45
2.5.8 MT 512MB:   0m41
2.6 MT:   0m43
2.6 MT 512MB:   0m49
+ MT:   1m20
+ MT 512MB:   1m20


AviSynth 2.5.8 / 2.6 MT Script

SetMTMode(3,4)
PluginPath = "Encoder\"
AviSource("Job3_Input.avi", audio=false).ConvertToYV12()
SetMTMode(2)
Spline36Resize(384, 288)
LoadPlugin(PluginPath+"svpflow1.dll")
LoadPlugin(PluginPath+"svpflow2.dll")
Import(PluginPath+"InterFrame2.avsi")
InterFrame(Cores=8, NewNum=60000, NewDen=1001, GPU=true)

AviSynth+ MT Script (not sure I got this right)

SetFilterMTMode("",2)
SetFilterMTMode("ffdShow_source",3)
PluginPath = "Encoder\"
AviSource("Job3_Input.avi", audio=false).ConvertToYV12()
Spline36Resize(384, 288)
LoadPlugin(PluginPath+"svpflow1.dll")
LoadPlugin(PluginPath+"svpflow2.dll")
Import(PluginPath+"InterFrame2.avsi")
InterFrame(Cores=8, NewNum=60000, NewDen=1001, GPU=true)

33 (edited by Mystery 07-01-2015 01:52:31)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Here's another test with a different script.

AviSynth+ (non-MT): 6m21

PluginPath = "Encoder\"
AviSource("Job2_Input.avi", audio=false).ConvertToYV12()
LoadPlugin(PluginPath+"FFT3DFilter.dll")
fft3dfilter(sigma=3, bt=5, bw=48, bh=48, ow=24, oh=24, ncpu=8)
LoadPlugin(PluginPath+"nnedi3.dll")
nnedi3_rpow2 (2)
nnedi3_rpow2 (2)
Spline36Resize(960, 720)
fft3dfilter(bt=-1, sharpen=0.1, ncpu=8)

AviSynth 2.6 MT: 5m36

SetMTMode(3,4)
PluginPath = "Encoder\"
AviSource("Job2_Input.avi", audio=false).ConvertToYV12()
SetMTMode(2)
LoadPlugin(PluginPath+"FFT3DFilter.dll")
fft3dfilter(sigma=3, bt=5, bw=48, bh=48, ow=24, oh=24, ncpu=8)
LoadPlugin(PluginPath+"nnedi3.dll")
nnedi3_rpow2 (2)
nnedi3_rpow2 (2)
Spline36Resize(960, 720)
fft3dfilter(bt=-1, sharpen=0.1, ncpu=8)

That "thing" (2.6 MT) is actually doing quite well (besides memory usage).

If you can tell me what's wrong with my AviSynth+ MT script, I'll give it another try.

34 (edited by Mystery 07-01-2015 02:18:08)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

This isn't good either.

Clock deviation was -2% and was gradually going down (-0.65% on the screenshot)

"1 frame drop every 1.16 seconds" isn't good either; although those don't show up in "dropped frames"

Post's attachments

ClockDeviation.jpg, 34.43 kb, 262 x 489
ClockDeviation.jpg 34.43 kb, 760 downloads since 2015-01-06 

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery

SetFilterMTMode("",2)
SetFilterMTMode("ffdShow_source",3)
PluginPath = "Encoder\"
AviSource("Job3_Input.avi", audio=false).ConvertToYV12()
...

I think you need to overwrite second line:

SetFilterMTMode("AviSource",3)

AviSynth+ (non-MT): 6m21
AviSynth 2.6 MT: 5m36

Looks like MultiThreading is not working. MT result similar to ST result (SingleThreading).

SetMTMode(3,4)
PluginPath = "Encoder\"
AviSource("Job2_Input.avi", audio=false).ConvertToYV12()
SetMTMode(2)
...

You need to add line

Distributor()

to the end of scriprt to make MT working.
* For AVS+ last line of script must be:

Prefetch([threads_number])

Clock deviation was -2%

What mean clock deviation and how it related to AVS-script or Avisynth library version?

36 (edited by Mystery 07-01-2015 07:10:37)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

MAG79 wrote:

You need to add line

Distributor()

to the end of scriprt to make MT working.
* For AVS+ last line of script must be:

Prefetch([threads_number])

Oh, this isn't in SubJunk's instructions for encoding videos in 60fps.

The line "Prefetch([threads_number])" isn't valid. I'm guessing I have to replace [threads_number] by a number? I tried putting 4.

It plays... but with LOTS of visual glitches! If I instead put number 2, there are still visual glitches but much less.

With 2 threads, I got the encoding in 5m54 instead of 5m36 with v2.6. Haven't done SVP encoding test yet.


What mean clock deviation and how it related to AVS-script or Avisynth library version?

You should know more than I do what it means, but it only happens with this version of AviSynth+

and MPC-HC crashes when closing.

This "thing" (AviSynth+ MT) is far from being a finished product...

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery
This "thing" (AviSynth+ MT) is far from being a finished product...

You've just opened my eyes  big_smile

Nevetheless this's the only chance to get SVP in x64 players...

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Chainik
Nevetheless this's the only chance to get SVP in x64 players...
Is VapourSynth integration in any filters less possible?

Re: SVP with AviSynth 2.6 or AviSynth+ ?

https://forum.doom9.org/showthread.php?p=1697689

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Chainik wrote:

You've just opened my eyes  big_smile

That's what the 'Thanks' button is for

For now I'll stick to 2.6 MT for video encoding. With MT enabled, it gives better performance than the official AviSynth+ which also works well just not for SVP.

Development-wise, I think the memory leaks of 2.6 MT would be easier to fix than all the bugs in AviSynth+ MT!

And does SVP really have to work on top of ffdshow and avisynth, which are 2 very old pieces of codes not well maintained? Could it run as a rendering filter like madVR, or in some other way? And if you were to make SVP do its job *after* madVR, what would need to change in its structure?

41 (edited by Mystery 07-01-2015 22:00:16)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Now I did the SVP/Interframe encoding test with AviSynth+ MT. I've set the threads to 14 as that's the default in generate.js for 8 CPU + GPU.

It worked fine and performance is impressive: 31s! (compared to 41-25s with v2.5.8)

What causes massive visual glitches is resizing. A script with a simple Spline32Resize causes problems; so does NNEDI3 resizing.

Bugs so far:
- AviSynth+ MT doesn't work with resizing
- It crashes when closing
- Drop frames / clock desync problem

With v2.5.8 / v2.6 I don't need to enter Prefetch(14) because InterFrame takes care of it. If I specify Prefetch on top of what Interframe does, am I duplicating the thread creation?

The performance, however, looks very promising!!

I believe that getting AviSynth+ MT to work properly, combined with processing frames *after* madVR, would allow for much better output quality (drastically improved performance, but would have to be tested)

Denoise/Sharpen with FFT3DFilter is working (not crashing). Keep in mind that there may be all kinds of subtle bugs that change the output quality and are hard to see.

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery
AviSynth+ MT doesn't work with resizing

I really doubt. MT is working like "one thread per frame" and resizing code should be similar in both "official" and "MT" branches.
But you still free to ask at doom9 wink

getting AviSynth+ MT to work properly

Still don't know if I really want to dig into it any deeper.

Development-wise, I think the memory leaks of 2.6 MT would be easier to fix than all the bugs in AviSynth+ MT!

big_smile try to view original AVS sources before making any conclusions

43 (edited by Mystery 08-01-2015 03:35:01)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Just looking at the file size (twice bigger than 2.5.8), I'm not sure I want to look at it.

It's definitely not working with resize functions. Just create a basic script that has a Spline32Resize function and it has lots of serious visual glitches.

I get what you're saying... and perhaps your time is better spent working on SVP itself while you let others figure out AviSynth MT. That's a WHOLE other project in itself.

Now it's working with either v2.5.8 or v2.6. Perhaps you could give the option during installation as to which version to use. I'd probably recommend v2.6 if they have over 3GB of RAM.

If they want SVP to work in x64, then someone will have to first make a proper AviSynth MT work in x64 first. THEN you can rewrite your assemblies in x64. But for now, most video components are still working in x86. Might be different a few years from now.

When I was looking into testing x64 AviSynth, the people in the community were under the impression that you weren't interested in providing a x64 version of SVP. That's not actually the case. You want to support that, but there just is no version of AviSynth that supports x64, MT and ffdshow. You just have to let them know that. As soon as any version supports x64, MT and ffdshow, you'll be more than happy to provide x64 SVP binaries for it. Until then, there's no point in spending time there.

44 (edited by Mystery 10-01-2015 06:01:19)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

This whole AviSynth versions thing is really nuts.

What I ended up doing is

For SVP: AviSynth 2.6 MT

For my encoder in preview mode: AviSynth+ (official non-MT!), for best stability

For my encoder in rendering mode: AviSynth 2.6 MT, for best performance

And the one you chose was 2.5.8 MT, custom build for SVP

And after all that, none of these versions is ideal.

45 (edited by James D 10-01-2015 08:47:30)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Mystery wrote:

So we have to choose between memory leaks (and performance degradation) or constant freeze & crash.

I was feeling that something was slightly off performance-wise, but I guess I don't feel much the memory leaks with 8GB of RAM. How bad are those memory leaks?

And when it comes to the AviSynth+, does it do a better job besides the one bug you mentioned? I guess even a custom-build of AviSynth+ would be better than an unstable & old version of AviSynth 2.5.8 MT

You know what funny thing and sad joke is? That with those memory leaks anf 8GB onboard I can say "Well, FINALLY that RAM I payed for is used somewhere!" big_smile
Actually I have never known about them.
You should patch player's exe with 4GB patch.
I saw no bugs except 1 isolated in PotPlayer with disabled video processing option. My encoders use the AVS which came with them.
Clock deviation... have you ever thought it shoul be normal due to 59.937 fps ntsc (or whatever standard) being played on 60HZ monitor? Wait... maybe it's vice versa, your monitor's refresh rate is 59.9 instead of 60?

Chainik, Always read your nick as Chainlink until I followed github link)

Re: SVP with AviSynth 2.6 or AviSynth+ ?

I may have a solution.

Until a few days ago, I had the same problem with crashes all the time using Windows 10. Potplayer, MPC, BSplayer, they all crashed within minutes no matter what I replaced, including reinstalling Windows several times. I was pulling my hair out, my wife going bananas.

Solution: install the old SVP version 3.06

Been running it for about a week and it works perfectly. Never crashes and is much, much smoother than the latest version. No distracting artifacts at all in most movies and documentaries. 

To optimize performance install the latest MadVr, LAV, etc.

Re: SVP with AviSynth 2.6 or AviSynth+ ?

I also tried Avisynth 2.6 MT with MPC-HC 1.7.7 on Windows 7 for watching videos
and have no crashes anymore on seek and no memory problems  smile
So good idea to use that!

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Avisynth 2.6 RC was released recently: www.free-codecs.com/download/AviSynth.htm

Re: SVP with AviSynth 2.6 or AviSynth+ ?

will wait there for MT-enabled version...

Re: SVP with AviSynth 2.6 or AviSynth+ ?

Chainik
ahh right, it didn't work, gave me some MT missing error