Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
26th April 2023, 15:52 | #21 | Link |
Registered User
Join Date: Dec 2021
Posts: 3
|
Even though everything in this snippet is bad practice, it can be monkey patched by just forcing the requests
Code:
last0 = source.std.FrameEval(eval=srestore_inside, prop_src=[bclpYStats, dclpYStats, dclipYStats]) def _force_eval(n): for nn in range(max(n-5, 0), min(last0.num_frames, n + 1)): last0.get_frame(nn) return last0 last = last0.std.FrameEval(_force_eval) |
26th April 2023, 19:29 | #22 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,594
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
27th April 2023, 15:54 | #23 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
As a side note, I just stumbled over a workaround:
Using: Code:
# clip is 50fps progressive due to QTGMC clip = sRestore.srestore(clip, frate=29.94) clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001) clip = sRestore.srestore(clip, frate=23.976) clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001) Code:
clip = sRestore.srestore(clip, frate=23.976) clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001) Quote:
Cu Selur Ps.: calling sRestore two times helps, but doesn't fix it (still some blends left, that could be removed and get removed in Avisynth) Last edited by Selur; 29th April 2023 at 06:03. |
|
29th April 2023, 06:36 | #24 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
Okay, since cddeblend and srestore don't properly work (may have never worked as good as the Avisynth alternatives) I was wondering what filters do folks use to remove (random) blends ?
I mean, especially folks filtering animes must deal with blends quite often. Maybe: 1. creating a Vapoursynth script which loads the source and applies some filtering. 2. load that Vapoursynth script as source (using VapourSource) in an Avisynth script, which applies sRestore. 3. loading that AvisynthScript with vsavsreader and apply the rest of the filtering. could work,.... (assuming VapourSource and vsavsreader still work at least on Windows, I have no hope for Linux&Mac) Cu Selur Last edited by Selur; 29th April 2023 at 10:50. |
17th September 2023, 23:46 | #25 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,821
|
Can you test again with:
Quote:
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
|
19th September 2023, 17:21 | #26 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
using (with R63):
Code:
# Imports import vapoursynth as vs import os import ctypes # Loading Support Files Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll") import sys # getting Vapoursynth core core = vs.core # Limit thread count to 1 core.num_threads = 1 # 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/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/scenechange.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV.dll") # Import scripts import havsfunc # source: 'C:\Users\Selur\Desktop\Naruto DVD Folge 4_3 min.m2v' # current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first # Loading C:\Users\Selur\Desktop\Naruto DVD Folge 4_3 min.m2v using DGSource clip = core.dgdecodenv.DGSource("J:/tmp/m2v_89c111c29e9cbbcf0ca7e1f8c9f8aa6b_853323747.dgi",fieldop=0)# 25 fps, scanorder: top field first # Setting detected color matrix (470bg). clip = core.std.SetFrameProps(clip, _Matrix=5) # Setting color transfer info (470bg), when it is not set clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5) # Setting color primaries info (BT.601 PAL), when it is not set clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5) # Setting color range to TV (limited) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1) # making sure frame rate is set to 25 clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2) # tff # Deinterlacing using QTGMC clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 50 # Making sure content is preceived as frame based clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive # adjusting frame count and rate with sRestore clip = havsfunc.srestore(source=clip, frate=23.9760) # adjusting output color from: YUV420P8 to YUV420P10 for QSVEncModel clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited") # set output frame rate to 23.976fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001) # Output clip.set_output() Cu Selur |
23rd September 2023, 18:05 | #27 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,594
|
Exactly how are you outputting it for comparison? Single threaded mode should work identically to the avisynth version.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
23rd September 2023, 18:08 | #28 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
I used vsViewer (= older Vapoursynth Editor), will do a reencode and compare the results.
=> You are right seems to be an issue with the preview, so disabling MultiThreading helps. (Added the file to my Google Drive next to the others.) Is there a way to just disable multithreading for sRestore/cdeblend/...? Cu Selur Last edited by Selur; 23rd September 2023 at 23:51. |
24th September 2023, 10:09 | #29 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,821
|
preview in vsedit is kinda "broken" for cdeblend, but seems to work then using the encode function. Tested with VapourSynth-Editor-r19-mod-5-x86_64
Try Quote:
This editor shows it correct: https://github.com/Irrational-Encodi...dry/vs-preview
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
|
27th October 2023, 17:33 | #30 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
Has anyone tested srestore from https://github.com/WolframRhodium/mu...er/muvsfunc.py ?
"srestore with serialized execution by explicit node processing dependency" sounds promising. Okay, did a quick test. Decimation works wonderful, but the serialization basically means if you jump to frame X, all frames before X have to be processed first. So still hoping for someone to implement this in a filter or that the muvsfunc.srestore will be tweaked,... Cu Selur Last edited by Selur; 27th October 2023 at 18:15. |
31st October 2023, 10:40 | #31 | Link | |
Registered User
Join Date: Jan 2016
Posts: 163
|
Quote:
Another problem of this approach is that, after jumping to frame X, previewing any frame long before X is time consuming. In this case, re-processing is currently out of my control (from a script writer perspective) because that is related to vapoursynth's caching of frames. And I think it can't be perfect here because for immediate jumping one will need to cache all frames in memory. An improvement could be like, allowing the user to specify what frames should be cached. This can be implemented as a standalone caching plugin, but I'm not sure whether that is useful. Last edited by WolframRhodium; 31st October 2023 at 10:48. |
|
1st November 2023, 11:29 | #33 | Link |
Registered User
Join Date: Jan 2016
Posts: 163
|
I have no clear thoughts in favor or against this approach. From a user perspective, similar to your approach, I would expect the program provide an option to specify what frames need to be cached (although not all of them may be processed before previewing). Initial thought on implementation of this kind of program is they seem too restrictive and each sequential filter (Cdeblend, srestore) would require a new plugin.
|
9th November 2024, 11:22 | #34 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
Trying to adjust srestore (https://github.com/Selur/Vapoursynth...sfunc.py#L2656) like cdeblend (https://github.com/WolframRhodium/mu...82f3a0eb8cddee) was adjusted.
(Having no clue) I thought it would be basically replacing: Code:
###### evaluation call & output calculation ###### bclpYStats = bclp.std.PlaneStats() dclpYStats = dclp.std.PlaneStats() dclipYStats = core.std.PlaneStats(dclip, dclip.std.Trim(first=2)) last = source.std.FrameEval(eval=srestore_inside, prop_src=[bclpYStats, dclpYStats, dclipYStats]) ###### final decimation ###### return ChangeFPS(last.std.Cache(make_linear=True), source.fps_num * numr, source.fps_den * denm) Code:
###### evaluation call & output calculation ###### bclpYStats = bclp.std.PlaneStats() dclpYStats = dclp.std.PlaneStats() dclipYStats = core.std.PlaneStats(dclip, dclip.std.Trim(first=2)) prop_src = [] for i in range(preroll, 0, -1): prop_src.extend([bclpYStats[0] *i + bclpYStats, dclpYStats[0]*i+dclpYStats, dclipYStats[0]*i+dclipYStats]) prop_src.extend([bclpYStats, dclpYStats, dclipYStats]) last = source.std.FrameEval(functools.partial(srestore_inside), prop_src=prop_src) ###### final decimation ###### return ChangeFPS(last, source.fps_num * numr, source.fps_den * denm) Standalone version of the current script: https://pastebin.com/ycrgv45t => does someone know how to fix this? Cu Selur |
Today, 11:54 | #35 | Link |
Registered User
Join Date: Jun 2004
Location: Salzburg, Austria
Posts: 220
|
Are there any updates or workarounds for using srestore in Vapoursynth like in AviSynth?
The bug report here resulted (as far as I can tell) in the removal of srestore altogether (affecting newer versions of VapourSynth). Is there any workaround or combination of filters around it or does this mean that there is currently no way to use srestore in VapourSynth (and to fall back to AviSynth instead)?
__________________
The number you dialed is imaginary. Please turn your phone by 90° and try again |
Today, 15:11 | #36 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,495
|
No update.
a. you could use sRestore which forces linear processing in muvsfunc.py (this is what Hybrid does atm.) b. write a mod of havsfunc sRestore which adds a preroll to it, like Myrsloik did for cdeblend. If you get this working, please share. Cu Selur |
Thread Tools | Search this Thread |
Display Modes | |
|
|