Log in

View Full Version : Questions about using Avisynth Plugins


kriNon
16th December 2017, 13:57
So I am trying to use a couple of avisynth plugins in a vapoursynth script of mine, namely TIVTC and Deen. So I have setup a x86 Vapoursynth environment, and I have installed all of the x86 versions of plugins that I needed for my script.

My issues are that both Deen and TIVTC are filling my log with errors saying:
Avisynth Compat: requested frame 58 not prefetched, using slow method
And as a result of this my script is very slow, running at under 1fps. The TDecimate function alone is slowing down the script by over %500 of what it runs at otherwise. So my main question is, is there any way that I can setup prefetching to occur?

Also, I am running out of memory when running my script. This is a result of the 4gb limit on x86 software. Would it be possible to somehow split my script into two scripts that occur in two separate processes to get around this limit? If so, how would I go about doing this?

Myrsloik
16th December 2017, 14:14
So I am trying to use a couple of avisynth plugins in a vapoursynth script of mine, namely TIVTC and Deen. So I have setup a x86 Vapoursynth environment, and I have installed all of the x86 versions of plugins that I needed for my script.

My issues are that both Deen and TIVTC are filling my log with errors saying:
Avisynth Compat: requested frame 58 not prefetched, using slow method
And as a result of this my script is very slow, running at under 1fps. The TDecimate function alone is slowing down the script by over %500 of what it runs at otherwise. So my main question is, is there any way that I can setup prefetching to occur?

Also, I am running out of memory when running my script. This is a result of the 4gb limit on x86 software. Would it be possible to somehow split my script into two scripts that occur in two separate processes to get around this limit? If so, how would I go about doing this?

No, prefetch lists are compiled in. Just use VIVTC instead of TIVTC and for deen I'm curious about what settings you used.

kriNon
16th December 2017, 14:20
No, prefetch lists are compiled in. Just use VIVTC instead of TIVTC and for deen I'm curious about what settings you used.

I wanted to use TIVTC's TDecimate over VDecimate because its mode=2 is better for anime, whereas VDecimate doesn't have any of the other
modes of TDecimate implemented.

As for deen, my script is as follows:

test4 = core.avs.Deen(test2, mode="a2d", rad=4, thrY=7, thrUV=9, min=0.5)

ChaosKing
16th December 2017, 15:23
Why not use avisynth then? Btw you can open an avs script via AviSource in Vapoursynth.

kriNon
16th December 2017, 15:45
Why not use avisynth then? Btw you can open an avs script via AviSource in Vapoursynth.

The main reason why I am using Vapoursynth over avisynth is that I am more comfortable with it. I have far more experience using Vapoursynth and I prefer the syntax. I am also using some filters that are Vapoursynth exclusive.

I don't really think it should be a matter of, switching to avisynth. I believe that the problems I'm having should be fixable.

I've thought about maybe trying to find a way of piping the output of my vapoursynth script into an avisynth script, which can then be imported into another vapoursynth script. However I would need to do this twice, meaning I would be going vapoursynth -> avisynth ->vapoursynth -> avisynth -> vapoursynth. Which is hardly an ideal solution.

Myrsloik
16th December 2017, 16:13
Figure out the proper prefetch requirements and I'll add them in
https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp
I never bothered to test most modes and when the source isn't available like with deen I'm just going to leave it to someone else to figure out the numbers. Too much effort otherwise.

And complex decimation is better handled with wobbly or yatta.

ChaosKing
16th December 2017, 16:22
Prefetch info -> https://forum.doom9.org/showthread.php?p=1614400#post1614400 + previous post

//Edit
This helped me with AutoAdjust() in vapoursynth:
clip = clip.std.Cache(size = 100, fixed=False, make_linear=True)

Myrsloik
16th December 2017, 16:30
Prefetch info -> https://forum.doom9.org/showthread.php?p=1614400#post1614400 + previous post

//Edit
This helped me with AutoAdjust() in vapoursynth:
clip = clip.std.Cache(size = 100, fixed=False, make_linear=True)

No surprise a huge cache makes things less bad, would be better to simply ask the author what the required radius is. I think he's still around...

ChaosKing
16th December 2017, 16:33
Max radius is 30 frames. That means vapoursynth needs to prefetch always 30 frames, just to be sure?

kriNon
16th December 2017, 16:35
Figure out the proper prefetch requirements and I'll add them in
https://github.com/vapoursynth/vapoursynth/blob/master/src/avisynth/avisynth_compat.cpp
I never bothered to test most modes and when the source isn't available like with deen I'm just going to leave it to someone else to figure out the numbers. Too much effort otherwise.

And complex decimation is better handled with wobbly or yatta.

I am using Deen in "a2d" mode. In this mode the filter acts spatially and doesn't do any temporal denoising. I've found that in this mode, whenever I access a frame n, i will get the requested frame not prefetched error I got earlier for frames n+1 and n+2. As such, I believe that the answer you are looking for is that it requires the next two frames to be prefetched.

Out of curiosity, would it be possible for prefetching to be something that can be adjusted in scripts? Maybe by adding a field to avs.LoadPlugin?

Thanks for the help!

I'll keep looking to see if either wobbly or yatta work better for decimating my current script.

Myrsloik
16th December 2017, 16:35
Max radius is 30 frames. That means vapoursynth needs to prefetch always 30 frames, just to be sure?

Yes, but prefetch is "free" assuming you have enough ram.

Myrsloik
16th December 2017, 17:14
I am using Deen in "a2d" mode. In this mode the filter acts spatially and doesn't do any temporal denoising. I've found that in this mode, whenever I access a frame n, i will get the requested frame not prefetched error I got earlier for frames n+1 and n+2. As such, I believe that the answer you are looking for is that it requires the next two frames to be prefetched.

Out of curiosity, would it be possible for prefetching to be something that can be adjusted in scripts? Maybe by adding a field to avs.LoadPlugin?

Thanks for the help!

I'll keep looking to see if either wobbly or yatta work better for decimating my current script.

Can't be justified. On average someone suggests a change in prefetch every 2 years. Pointless to waste time on making things with a fixed answer user configurable.