Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Stab" doesn't work properly on some material #50

Open
BlohoJo opened this issue Jan 15, 2022 · 3 comments
Open

"Stab" doesn't work properly on some material #50

BlohoJo opened this issue Jan 15, 2022 · 3 comments

Comments

@BlohoJo
Copy link

BlohoJo commented Jan 15, 2022

I included an example... the clip jerks all over the place with the Stab filter enabled for no apparent reason. Increse the max x/y shift to 10 to see it better.

This doesn't happen with the AviSynth version of Stab.

I attached a clip that exhibits the issue (github doesn't let me attach, used zippyshare).

I also attached the script and plugins that I am using in AviSynth and Vapoursynth, just to rule out any version issues.

Clip -> https://www101.zippyshare.com/v/6IlzcOER/file.html
avisynthPlugins.zip
vsfilters.zip

@HolyWu
Copy link
Member

HolyWu commented Jan 16, 2022

The Depan filter in MVTools plugin does not support range parameter. I guess it's affected by that. You can try https://github.com/theChaosCoder/lostfunc/blob/0a6816844b8f08ecac0e7a5bb32aacae2f4a3b93/lostfunc.py#L58 which supports range parameter, but I don't know where you can download the Depan plugin since the original repo has been lost in the limbo.

@BlohoJo
Copy link
Author

BlohoJo commented Jan 16, 2022

Yeah, it looks like it's not going to work without DePanEstimate.dll. What I'm not understanding, is that isn't DePan.dll and DePanEstimate.dll part of libmvtools.dll?

You can download the Depan plugin from the above "vsfilters.zip" that I posted above. It's also included in Hybrid.

The script you linked crashed; it appears to have syntax errors. I was able to get it working by changing it to:

# Stab function that uses DePanEstimate from "Depan" plugin which supports 
# the range parameter. DePanEstimate from MvTools is missing that paramater.
# Function copied from https://github.com/HomeOfVapourSynthEvolution/havsfunc
##############################################################################
# Original script by g-force converted into a stand alone script by McCauley #
# latest version from December 10, 2008                                      #
##############################################################################
def Stab(clp, range=1, dxmax=4, dymax=4, mirror=0):
    if not isinstance(clp, vs.VideoNode):
        raise vs.Error('Stab: This is not a clip')

    temp = AverageFrames(clp, weights=[1] * 15, scenechange=25 / 255)
    inter = core.std.Interleave([core.rgvs.Repair(temp, AverageFrames(clp, weights=[1] * 3, scenechange=25 / 255), mode=[1]), clp])
    mdata = core.depan.DePanEstimate(inter, range=range, trust=0, dxmax=dxmax, dymax=dymax)
    last = core.depan.DePan(inter, data=mdata, offset=-1, mirror=mirror)
    return last[::2]

It now works, and fixes the instability issues. Thanks very much for the help as I'm not a coder, the above is just me cutting and pasting lines. But it works; if range isn't specified then it defaults to 1.

@theChaosCoder
Copy link

I restored the Depan source code (hopefully it's the latest version) and the binary here: https://github.com/Vapoursynth-Plugins-Gitify/DePan
Will add it to vsrepo soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants