Grunt is a requirement for newer versions of SRestore, but I haven't had any issues using it with MT that I can recall.
http://avisynth.nl/index.php/Srestore#Requirements
I'm using a Ryzen 7900x (12 core). I actually have hyper-threading disabled in the BIOS (SMT mode). I'd read an article or two where it was claimed that for the Zen 5 CPU's, disabling SMT could speed up certain tasks.
https://www.techspot.com/review/1882-ryzen-9-smt-on-vs-off/
I thought I'd try it myself even though my CPU is a Zen 4, and it could be because I'm running Avisynth in Wine on Linux, but disabling SMT definitely increased encoding speed (I was encoding with x264). I can't remember the exact filtering in the script, or the video resolution, but I do remember encoding speed went from ~25fps with SMT enabled to ~33fps with it disabled, CPU usage went from around 60% to 90% and the CPU temperature dropped by about 7 degrees.
Anyway... for me at least, anything greater than 12 for Prefetch doesn't seem to increase encoding speed, and Prefetch(8) seems to be a little faster much of the time. Your mileage, as they say, may vary. Have you done much testing with different Prefetch values?
Edit: I'd also recommend saving this as an avsi and putting it in the auto-loading folder.
https://publishwith.me/ep/pad/view/ro.rDkwcdWn4k9/latest
Newer plugins register their MT mode with Avisynth Plus so it's mainly for older plugins that don't.
For the record, when a plugin auto-registers it's MT mode, SetFilterMTMode is ignored for that plugin. You can change the MT mode, but you have to use the "force" argument. For example: SetFilterMTMode("RemoveGrain", 1, force=true)
As a side note.....
xy-VSFilter isn't multithreaded, making hard-coding subtitles painfully slow.
https://github.com/pinterf/xy-VSFilter
I mainly encode srt subtitles, so I tried adding SetFilterMTMode("TextSub", MT_NICE_FILTER, force=true) to the script I linked to, and so far I've not had any issues enabling MT when encoding srt subtitles, and it no longer slows encoding to a crawl.
+ Reply to Thread
Results 31 to 45 of 45
-
Last edited by hello_hello; 23rd Feb 2025 at 08:38.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I have always used avisynth+ and in all my scripts to accelerate the speed I use Prefetch(32) at the end and I never have any problem , maybe it is something to do directly with SRestore() , I updated the Grunt plugin to the latest version that is available for download on the website and now the image is displayed but the error message persists .
[Attachment 85713 - Click to enlarge]
I don't know what it is but without Prefetch(32) it works, which I don't think is normal using avisynth+. -
What about a lower value for Prefetch?
I thought I'd looked, and possibly I did but not closely enough, as SRestore has a "mode" argument and it's abbreviated to dm in the function. Line 70:
dm = default(mode, 2)
In theory it's been defined very early on so when it is used as an argument for ScriptClip, Avisynth should know what it means, but I think ScriptClip can change the way scripts are evaluated, however I haven't used it enough to understand it fully.
I don't know why enabling multi-threading is causing a problem as I just ran your sample with Prefetch(32) from start to finish without an error.
Did you try the MT Mode script I linked to?
SRestore also has a cache argument. It uses RequestLinear from the TIVTC plugin to cache frames, but it's not used unless cache is greater than zero, so maybe try cache=50 (the RequestLinear default) to see if that helps.
I used AvsPmod to run a FPS analysis on the first 1000 frames of the script I posted earlier.
Prefetch(4) -> 1 minute, 7 seconds.
Prefetch(6) -> 1 minute, 7 seconds.
Prefetch(8) -> 1 minute, 8 seconds.
Prefetch(12) -> 1 minute, 8 seconds.
Prefetch(32) -> 1 minute, 27 seconds.
No Prefetch -> 1 minute, 10 seconds (see the next post).
Code:QTGMC(EzDenoise=1.5, Preset="very slow") SRestore(frate=30000.0/1001.0) CropResize(0,0, 22,6,-20,-6, InDAR=15.0/11.0, ResizeWO=true, Resizer="Resize8") Levels(12,1.0,255,0,255, coring=false) GradFun3() Trim(0,999) Prefetch(32)
Last edited by hello_hello; 24th Feb 2025 at 14:20.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Something in the above script isn't benefiting from multi-threading much, or there's something odd happening with my PC. I ran a FPS test without Prefetch in the script and it took 1 minute, 10 seconds (I've edited the post above to add the result), so it's not really any slower than with multi-threading enabled.
I tried again with the same script, minus SRestore.
No Prefetch -> 45 seconds.
Prefetch(8) -> 10 seconds.
Prefetch(12) -> 8 seconds.
Prefetch(32) -> 8 seconds.
It looks like SRestore doesn't benefit from multi-threading (probably because it's using ScriptClip) and it's slowing everything else down as a result. Assuming my tests are normal, enabling multi-threading won't make much difference.Last edited by hello_hello; 24th Feb 2025 at 14:46.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Is there any way to replace SRestore ? as it does not work well with Prefetch() .
Thanks for your help -
There's a function in my signature called FixBlend. It's not an automatic thing like SRestore though. I tried it on your sample yesterday and expected it to be much faster than SRestore as it doesn't use ScriptClip but it's about the same speed. For your sample it uses ChangeFPS to increase the frame rate to 299.7fps, then you select one frame in each group of 10 to keep, the idea being the same frame in each group won't be blurred, once you've found it. I thought as Avisynth doesn't actually produce frames unless they're requested (my vague understanding) that it'd be much faster, but even that process must be single threaded. The function works well with your sample, and if the blending pattern doesn't change it can give you the same output as SRestore, although none of that really helps....
QTGMC(EzDenoise=1.0, Preset="very slow")
FixBlendPAL2(5)
I think there's a few other deblending functions, but SRestore is the go-to for this type of deblending, and I suspect they'd be slow anyway.
I know it's not quite the same, but when I ran an encode with SRestore the other day, CPU usage was only about 20%-25%, so if you can't speed up a single encode, maybe running four encodes simultaneously would be the next best thing, assuming you've got more than one video to encode. I sometimes create several identical scripts to encode the same video and add Trim to the end of each one so it only encodes a percentage of the video. Then I run them together and join the output videos while muxing with MKVToolNix. If you're encoding with x264 it pays to add --stitchable to it's command line to ensure each section can be appended without any issues. x265 doesn't have a similar option but I've never had a problem appending it's encodes when the same settings are used each time.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I found this post where they talk about the same problem and this time they found a solution.
I tried using the file that this person shared, but I still can't solve the problem, I can't find the old version of Srestore() that they mention.
https://forum.videohelp.com/threads/394320-Restoring-smooth-motion -
Note that you expect QTGMC().SRestore to run about half as fast as QTGMC() alone. Because SRestore() is keeping only about half the frames that QTGMC() produced. QTGMC() still has to produce those frames for SRestore to analyze them.
-
Hello
, the problem persists with or without Prefetch(), and if I don't use SRestore() everything works fine, is there any effective way to replace SRestore() with Avisynth or Vaporsynth or any other tool?
Or how can I replace SRestore() and get an equal or better result using Avisynth?
There must be a way, whether slow or normal speed, the point is that it works.
please thanks -
As I said, you can use the FixBlend function in my signature. All you need to do is add a number from 1 to 10 as an argument, and step through the frames. If you see blending try another number, but there's only 10 choices so it usually doesn't take long to find the magic one. If there's still no blending at the end of the video it most likely means the blending pattern didn't change. If there's blending towards the end then you'll need to work out where it appears again and choose a new magic number.
There's two older versions of SRestore in the attached zip file. I think they both require GRunT, but give them a try. I put a copy of the dll I'm using in it too, although you're probably using the same GRunT, but you never know. If they don't work I may have a different version on an old external hard drive.... somewhere.
You don't have avstp.dll in your plugins folder do you? If you do, now would be a good time to delete it.Last edited by hello_hello; 26th Feb 2025 at 07:43.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Every sRestore after:
Code:# 10/28/2013 martin53 # - Update v2.7e -> v2.7f # Callable more than once from the same script with help of unique global variables per instance. # Moderate reformatting to re-establish readability with the new variable names. # Needs GRunT plugin
users currently on my ignore list: deadrats, Stears555, marcorocchini -
It couldn't be an issue with Avisynth+ itself could it?
Hippie_forever,
Apparently there's been quite a few bugs fixed in Avisynth+, but there's still no official release that includes them. It's a long shot, but try downloading Avisynth+ from here. There's no installer, however all you need to do is replace the existing dlls with the newer ones, or use the bat file if Avisynth+ is installed in the default location. I've been using r4096 since it was compiled without any issues (the Clang version, if I remember correctly). It appears r4198 was added yesterday though, so I'll be giving it a test drive myself shortly.
Just click the Code button and download the zip file under the "Download Source Code" menu.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
And..... after updating Avisynth+ I discovered it broke AvsPmod (just the 64 bit version though, as the 32 bit version still worked for me).
Fortunately the guy who maintains AvsPmod managed to fix the problem.
https://github.com/gispos/AvsPmod
Or should I say the guy who "was" maintaining AvsPmod, as he recently said he was retiring in a post at doom9. I hope he changes his mind, or it's not forever, but at least he's departed while AvsPmod and Avisynth+ are playing nice together.
Edit: I skimmed through another thread at doom9 and it appears the IntelLLVM builds of Avisynth+ can cause VirtualDub2 to crash while opening scripts, although that seems to be a Visual C++ issue and installing the latest runtime files will fix it. There's a universal installer here: https://github.com/abbodi1406/vcredistLast edited by hello_hello; 26th Feb 2025 at 11:33.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Thanks to all who replied and tried to help, in the end I did NOT manage to fix it and ended up using FixBlendPAL2(5)
in the end I didn't manage to fix the error that happens with SRestore() + GRunT with or without Prefetch() using avisynth+
“I don't know what 'dm' means”.
[Attachment 85835 - Click to enlarge]
I believe that things happen for a reason, and in the end it seems to me that the result is much better with FixBlendPAL2(5).
QTGMC()
FixBlendPAL2(5)
Thanks to all -
It's surprising that FixBlendPAL2(5) actually worked as it's likely the blending pattern would start in a different place for the entire video than for an extracted sample. I suppose the odds are one in ten it'd require the same number. Or is it one in a hundred given there's a one in ten chance a specific number would be correct for the sample, and another one in ten chance the same number would be correct for the entire video?
Anyway... as long as all the bends are gone.Last edited by hello_hello; 28th Feb 2025 at 11:13.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview)
Similar Threads
-
Deinterlace video , help
By Hippie_forever in forum Video ConversionReplies: 0Last Post: 25th Dec 2024, 16:46 -
Is it possible to deinterlace a YouTube video?
By Eddles999 in forum Video ConversionReplies: 2Last Post: 24th Aug 2022, 13:06 -
How to deinterlace this video properly?
By coolgit in forum RestorationReplies: 5Last Post: 24th Sep 2021, 14:22 -
Deinterlace video - help needed
By kilnlast in forum EditingReplies: 2Last Post: 30th Jan 2021, 00:07 -
How to deinterlace video?
By ACKR in forum Video ConversionReplies: 9Last Post: 28th May 2020, 02:26