VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Hello! I'm just trying to test out Srestore on VapourSynth using StaxRip, but every time I try to test out the plugin on any random source, it keeps giving me this script error.

    "Explicitly instantiated a Cache with make_linear set. This is no longer possible and the original clip has been passed through instead which may cause severe issues."

    I don't know what that script error means since I'm new to VapourSynth, but it looks like the plugin seems to be installed? (But something I have to do with the script before inserting Srestore?) This is a fresh StaxRip install and the script I only used (along side from StaxRip's built in script for loadplugins and source) was
    Code:
    clip = havsfunc.srestore(clip, frate=23.976)
    There could be something I'm be doing wrong since it looks like I'm the only one having trouble with this.
    Can anyone help me out here, thanks!
    Last edited by themon-master; 29th Oct 2026 at 22:28. Reason: typo
    Quote Quote  
  2. Since I ran into the general problem (havsfunc.srestore) quite a while ago and spend quite some time with it, here are my two cents:

    A. It's not you fault.

    havsfunc.restore has been broken for years; since Vapoursynth R55 (the switch to API4 and the internal changes that went along with it)
    see: https://forum.doom9.org/showthread.php?t=184852&highlight=sRestore

    Originally Posted by HolyWu View Post
    The culprit is that std.Cache filter becomes no-op in API4. Specifically, srestore requires the make_linear functionality from std.Cache in API3 to work as expected because it calculates some global statistics and those statistics get updated every frame inside FrameEval. Without make_linear, some calls inside FrameEval get skipped and the statistics calculated are incorrect. But it seems impossible to achieve the same result by using std.SetVideoCache in API4.
    Originally Posted by Myrsloik View Post
    I'm happy that it worked for you but unfortunately make_linear=True never was a guarantee of frames actually being requested linearly. Maybe it worked well enough for some of you sometimes. I'd honestly suggest turning srestore into a proper plugin.

    As a really stupid plan b create a dummy passthrough filter (like the filter skeleton example), use Unordered as the mode and call setLinearFilter(). Replace the Cache() with this filter instead. Maybe it'll whack things into order enough.
    source:https://forum.doom9.org/showpost.php?p=1986236&postcount=16[

    B. What you can do
    Depending on what you are aiming for and how much you want to get involved, there are multiple option.

    How I see it (others might have other opinions/suggestions), your options are:
    • switch to Avisynth if you want sRestore
    • switch to a StaxRip version which uses an older Vapoursynth version
    • live with the partially broken sRestore
    • report it over at https://github.com/staxrip/staxrip (I know stax76 Passed Away InFebruary, but there are still folks working on StaxRip from time to time.
      And I,
      a. wrote a version of sRestore which is way slower and based on MUV, see: here which does work better, but forces linear handling and thus is slow
      b. re-wrote a new version of sStaxRip which I named DeblendS, that is based on Avisynths sRestore.
      Both could be incorparated in StaxRip, or used with other tools.
      I also (just) ported ExBlend and added a AnimBlend (which is based on ExBlend), but helps with especially animes. (combining AnimBlend/ExBlend and DeblendS works fine for me.
    • Fix the problem yourself and share the fix with the StaxRip devs over at github.
    • Write your own script/tool (and ideally share it others) to do the work sRestore does in Avisynth.

    Cu Selur

    Ps.: Hybrid does offer the stuff I implemented to cope with the broken sRestore, but it lacks any real sort of documentation, like other tools have.
    It's not particulary aimed at folks just starting out and might be a bit confusing at first, might not have all the options StaxRip has, but has tons of other options and features StaxRip at this point in time does not have.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    It's not you fault.

    havsfunc.restore has been broken for years; since Vapoursynth R55 (the switch to API4 and the internal changes that went along with it)
    Oh, that makes sense now, I did not knew it was a problem with the plugin.
    Originally Posted by Selur View Post
    Depending on what you are aiming for and how much you want to get involved, there are multiple option.
    The source I'm using is 50fps PAL, but because it's anime, it's actually 25fps, in the source there's no PAL speed optimization which caused frame blending between the 23.976 and 25fps frames, so that means I have to convert the 25fps to 23.976fps (I used TDecimate to convert the source to 50fps -> 25fps, so most of the fps conversion is already done)
    Originally Posted by Selur View Post
    switch to Avisynth if you want sRestore
    As much as I'd love to switch to AviSynth for Sresotre, I have some plugins that works better with VapourSynth
    Originally Posted by Selur View Post
    switch to a StaxRip version which uses an older Vapoursynth version
    Using an older version of VapourSynth doesn't sound ideal.
    Originally Posted by Selur View Post
    report it over at https://github.com/staxrip/staxrip (I know stax76 Passed Away InFebruary, but there are still folks working on StaxRip from time to time.
    I don't think if that wll do anything but I can try
    Originally Posted by Selur View Post
    wrote a version of sRestore which is way slower and based on MUV, see: here which does work better, but forces linear handling and thus is slow
    b. re-wrote a new version of sStaxRip which I named DeblendS, that is based on Avisynths sRestore.
    Both could be incorparated in StaxRip, or used with other tools.
    I also (just) ported ExBlend and added a AnimBlend (which is based on ExBlend), but helps with especially animes. (combining AnimBlend/ExBlend and DeblendS works fine for me.
    Those plugins sound like a good idea since I can't find any other plugin that is a replicate of Srestore, I'll try that later and see what I can do
    Quote Quote  
  4. I your source is progressive 50fps pal don't use TDecimate, only use sRestore.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  5. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    wrote a version of sRestore which is way slower and based on MUV, see: here which does work better, but forces linear handling and thus is slow
    b. re-wrote a new version of sStaxRip which I named DeblendS, that is based on Avisynths sRestore.
    I downloaded both of the plugins you've recommended to me, and for both plugins, what code do I paste onto my script? (Example:
    Code:
    clip = havsfunc.srestore(clip, frate=23.976)
    As well with the commands for filtering if the default code doesn't work properly.
    Last edited by themon-master; 30th Oct 2026 at 20:08. Reason: just to be more clear on what I'm talking about
    Quote Quote  
  6. Can't really help you with how to integrate stuff into StaxRip, since I never really used it.
    Hopefully a veteran StaxRip user can say more to this.

    Not sure whether this helps, or whether this causes more confusion, but here's how Hybrid would use i.e. DeblendS to deinterlace 25i content to 50p and then use DeblendS to get it down to 23.976:
    Code:
    # Imports
    import sys
    import os
    import vapoursynth as vs
    # using Vapoursynth R81
    # getting Vapoursynth core
    core = vs.core
    # Import scripts folder
    scriptPath = 'F:/Hybrid/64bit/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    # loading plugins
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/znedi3.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/zsmooth/zsmooth.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/akarin/libakarin.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/mvutensils/mvutensils.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/bwdif.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/fmtconv.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/DGDecode.dll")
    # Import scripts
    import deblendS
    import qtgmc
    import validate
    # Source: 'G:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\eis-sample.mpg'
    # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 480x576, fps: 25, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: top field first, full height: true (Source)
    # Loading 'G:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\eis-sample.mpg' using DGDecode
    clip = core.dgdecode.MPEG2Source("J:/tmp/mpg_ce22087fc4d4b8ecf206fd4dc2ddbf0a_853323747.d2v",info=3)# 25 fps, scanorder: top field first
    frame = clip.get_frame(0)
    # setting color matrix to 470bg.
    clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
    # setting color transfer (vs.TRANSFER_BT601), if it is not set.
    if validate.transferIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
    # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
    if validate.primariesIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
    # setting color range to TV (limited) range.
    prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
    clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
    # making sure frame rate is set to 25fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # making sure the detected scan type is set (detected: top field first)
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # scan type: top field first
    # Deinterlacing using QTGMC
    clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=True, tools={'mv': 'mvutensils', 'expr': 'akarin', 'nnedi3': 'znedi3', 'eedi3': 'vszip', 'dfttest': 'neo_fft', 'nlmeans': 'knlm', 'bm3d': 'bm3d', 'rg': 'zsmooth', 'median': 'zsmooth', 'fft3d': 'neo_fft', 'grain': 'noise'}) # new fps: 50
    # Making sure content is perceived as frame based
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
    # adjusting frame count and rate with DeblendS
    clip = deblendS.deblendS(clip, src_fps=50/1, true_fps=24000/1001, tools={'mv': 'mvutensils', 'expr': 'akarin', 'nlmeans': 'vszipcu', 'rg': 'zsmooth'})
    # adjusting output color from YUV420P8 to YUV420P10 for NVEncModel
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
    # set output frame rate to 23.976fps (progressive)
    clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
    # output
    clip.set_output()
    # clip current meta; color space: YUV420P10, bit depth: 10, resolution: 480x576, fps: 23.976, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
    # script was created by Hybrid 2026.10.29.1
    and here's a usage example of using sRestore instead of DeblendS on the same source:
    Code:
    # Imports
    import sys
    import os
    import vapoursynth as vs
    # using Vapoursynth R81
    # getting Vapoursynth core
    core = vs.core
    # Import scripts folder
    scriptPath = 'F:/Hybrid/64bit/vsscripts'
    sys.path.insert(0, os.path.abspath(scriptPath))
    # loading plugins
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/znedi3.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/zsmooth/zsmooth.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/akarin/libakarin.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/mvutensils/mvutensils.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/bwdif.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/fmtconv.dll")
    core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/DGDecode.dll")
    # Import scripts
    import srestore
    import qtgmc
    import validate
    # Source: 'G:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\eis-sample.mpg'
    # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 480x576, fps: 25, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: top field first, full height: true (Source)
    # Loading 'G:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\eis-sample.mpg' using DGDecode
    clip = core.dgdecode.MPEG2Source("J:/tmp/mpg_ce22087fc4d4b8ecf206fd4dc2ddbf0a_853323747.d2v",info=3)# 25 fps, scanorder: top field first
    frame = clip.get_frame(0)
    # setting color matrix to 470bg.
    clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
    # setting color transfer (vs.TRANSFER_BT601), if it is not set.
    if validate.transferIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
    # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
    if validate.primariesIsInvalid(clip):
      clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
    # setting color range to TV (limited) range.
    prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
    clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
    # making sure frame rate is set to 25fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
    # making sure the detected scan type is set (detected: top field first)
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # scan type: top field first
    # Deinterlacing using QTGMC
    clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=True, tools={'mv': 'mvutensils', 'expr': 'akarin', 'nnedi3': 'znedi3', 'eedi3': 'vszip', 'dfttest': 'neo_fft', 'nlmeans': 'knlm', 'bm3d': 'bm3d', 'rg': 'zsmooth', 'median': 'zsmooth', 'fft3d': 'neo_fft', 'grain': 'noise'}) # new fps: 50
    # Making sure content is perceived as frame based
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
    # adjusting frame count and rate with sRestore
    clip = srestore.sRestoreMUVs(clip, frate=23.9760, tools={'expr': 'akarin'})
    # adjusting output color from YUV420P8 to YUV420P10 for NVEncModel
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
    # set output frame rate to 23.976fps (progressive)
    clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
    # output
    clip.set_output()
    # clip current meta; color space: YUV420P10, bit depth: 10, resolution: 480x576, fps: 23.976, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
    # script was created by Hybrid 2026.10.29.1
    Cu Selur

    Ps.: the 'tools' parameter is optional
    Last edited by Selur; 31st Oct 2026 at 00:09.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    clip = srestore.sRestoreMUVs(clip, frate=23.9760, tools={'expr': 'akarin'})
    Thanks for the code I can insert to my script! It seems to load in to StaxRip fine, but I'm getting a script error saying that there's "no module named 'helpers'" and "from helpers import Depth, GetPlane, scale_value, cround, get_expr
    ModuleNotFoundError: No module named 'helpers'"

    I don't know what the plugin "helpers" is, or where I can download it, But it looks like I need to plugin in order for SrestoreMUVs to work

    (Another question, what is "tools={'expr': 'akarin'}" from the script? And what does it help with
    Quote Quote  
  8. see: https://github.com/Selur/VapoursynthScriptsInHybrid/
    the tools option is something I use in Hybrid to force which filter is used for which function, this way speed can be optimized by the user depending on it's system.
    leaving it out should automatically use a tool if finds.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  9. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    see: https://github.com/Selur/VapoursynthScriptsInHybrid/
    the tools option is something I use in Hybrid to force which filter is used for which function, this way speed can be optimized by the user depending on it's system.
    leaving it out should automatically use a tool if finds.
    I didn't realize I had to download a few more plugins in the GitHub batch in order for SrestoreMUVs to work, I tried to use both SrestoreMUVs and deblenderS plugins onto VapourSynth in StaxRip (Both plugins tested separately), but when I try to preview the output video, it just crashes with no script error.
    Quote Quote  
  10. No error => no clue, maybe this is now an mpv issue. (iirc StaxRip uses mpv for preview)
    What does the Script you use now look like?
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  11. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    No error => no clue, maybe this is now an mpv issue. (iirc StaxRip uses mpv for preview)
    What does the Script you use now look like?
    Code:
    import os, sys
    import vapoursynth as vs
    core = vs.core
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\libdelogo.dll", altsearchpath=True)
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\vsncnn.dll", altsearchpath=True)
    sys.path.append(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Apps\Plugins\VS\Scripts")
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Apps\Plugins\Dual\L-SMASH-Works\LSMASHSource.dll", altsearchpath=True)
    clip = core.lsmas.LWLibavSource(r"C:\Users\your name\Downloads\Telegram Desktop\Doraemon - 878 - 2025-11-23.ts", cachefile=r"C:\Users\your name\Downloads\Telegram Desktop\Doraemon - 878 - 2025-11-23.ts_temp\temp.lwi")
    from vsutil import depth
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\libtivtc.dll")
    import srestore
    clip = srestore.sRestoreMUVs(clip, frate=23.9760)
    clip.set_output()
    Is there any problem with it?
    Quote Quote  
  12. sRestoreMUVs has fallbacks to run without any dependencies (slower than needed, but it works), so:
    Code:
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\libdelogo.dll", altsearchpath=True)
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\vsncnn.dll", altsearchpath=True)
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\libtivtc.dll")
    are not needed. My guess is that one of these causes problems.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  13. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    sRestoreMUVs has fallbacks to run without any dependencies (slower than needed, but it works), so:
    Code:
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\libdelogo.dll", altsearchpath=True)
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\StaxRip-v2.52.5-x64\StaxRip-v2.52.5-x64\Settings\Plugins\VapourSynth\vsncnn.dll", altsearchpath=True)
    core.std.LoadPlugin(r"C:\Users\your name\Downloads\libtivtc.dll")
    are not needed. My guess is that one of these causes problems.

    Cu Selur
    Nope, I removed that from the script and it's still crashing (No difference at all), it's most likely an mpv issue then.
    Quote Quote  
  14. Maybe someone who actually has some experience with StaxRip can help, but I'm out of ideas.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!