Log in

View Full Version : Replacement for Oyster?


asarian
6th November 2024, 19:55
I am trying to use Oyster, but keep getting all sort of errors:

import vapoursynth as vs
import havsfunc as haf
import Oyster

core = vs.core
core.max_cache_size = 65535

vid = core.lsmas.LibavSMASHSource(r"f:\veai\test.mov")
vid = core.fmtc.bitdepth(vid, bits = 32 )
vid = core.fmtc.resample(vid, css = "444" )

ref_s = Oyster.Basic(vid, short_time=True)
vid = Oyster.Deringing(vid, ref_s, block_step=2)

vid = core.resize.Spline64(vid, matrix = 1, format = vs.YUV420P10)
vid = core.cas.CAS (vid, 0.9)
vid = core.neo_f3kdb.Deband (vid, preset="veryhigh", dither_algo=2)

vid.set_output ()


2024-11-06 19:49:45.871
Python exception: No attribute with the name SetFieldBased exists. Did you mistype a plugin namespace?

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2832, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2833, in vapoursynth._vpy_evaluate
File "", line 12, in
File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\Oyster.py", line 267, in Basic
src = core.SetFieldBased(src, 0)
File "src\cython\vapoursynth.pyx", line 2385, in vapoursynth._CoreProxy.__getattr__
File "src\cython\vapoursynth.pyx", line 2228, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name SetFieldBased exists. Did you mistype a plugin namespace?


Is there a way to fix this? Or use a working alternative to Oyster? Thanks.

Selur
7th November 2024, 15:08
Is there a way to fix this?
Changed line 14 from
self.core = vs.get_core()
to
self.core = vs.core
(in Oyster.py)
and it works fine (and as expected terribly slow) here.

core.max_cache_size = 65535
Out of curiosity, how much RAM does your system have that you can spare 64GB for caching?

Cu Selur

Ps.: Not sure whether it's worth it, but one could adjust the code to use:

nnedi3cl or znedi3 instead of normal nnedi3.
neo_dfttest instead of dfttest.

asarian
7th November 2024, 15:19
Changed line 14 from
self.core = vs.get_core()
to
self.core = vs.core
(in Oyster.py)
and it works fine (and as expected terribly slow) here.


Out of curiosity, how much RAM does your system have that you can spare 64GB for caching?

Cu Selur


Thanks. I had already changed to 'vs.core'. :) That solved the immediate error; but the 'AttributeError: No attribute with the name SetFieldBased exists. Did you mistype a plugin namespace?' error remains, so I just figured it's broken beyond my capabilities to fix.

P.S. I have 64G memory, but memory usage never actually seems to exceed around 2/3rd of what I have.

Selur
7th November 2024, 15:24
Change:

import vapoursynth as vs
import havsfunc as haf
import Oyster

core = vs.core
core.max_cache_size = 65535


to

import vapoursynth as vs
core = vs.core
core.max_cache_size = 65535

import havsfunc as haf
import Oyster

_Al_
7th November 2024, 15:48
Looks like oyster script ties mvtools and other core attributes to a particular script instance.

asarian
7th November 2024, 16:20
Change:

import vapoursynth as vs
import havsfunc as haf
import Oyster

core = vs.core
core.max_cache_size = 65535


to

import vapoursynth as vs
core = vs.core
core.max_cache_size = 65535

import havsfunc as haf
import Oyster


I tried that; sadly, got the exact same AttributeError: No attribute with the name SetFieldBased exists. Did you mistype a plugin namespace? error. So, now it looks like this:

import vapoursynth as vs
core = vs.core
core.max_cache_size = 65535

import havsfunc as haf
import Oyster as Oy
import math
import mvmulti

vid = core.lsmas.LibavSMASHSource(r"f:\veai\test.mov")

vid = core.fmtc.bitdepth(vid, bits = 32 )
vid = core.fmtc.resample(vid, css = "444" )

ref_s = Oy.Basic(vid, short_time=True)
vid = Oy.Deringing(vid, ref_s, block_step=2)

Selur
7th November 2024, 17:05
I used:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
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/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import validate
# Source: 'G:\TestClips&Co\files\test.avi'
# Current color space: YUV420P8, bit depth: 8, resolution: 640x352, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, format: MPEG-4 Visual
# Loading G:\TestClips&Co\files\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/test.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
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.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=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: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive


# Loading Support Files
import ctypes
Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3-3.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/libnnedi3.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/BM3D/BM3D.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools_sf_em64t.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
import Oyster

#vid = core.fmtc.bitdepth(clip, bits = 32 )
#vid = core.fmtc.resample(vid, css = "444" )
vid = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")

ref_s = Oyster.Basic(vid, short_time=True)
clip = Oyster.Deringing(vid, ref_s, block_step=2)

# output
clip.set_output()
with: https://pastebin.com/DwhtghH1
and it worked fine.

Anything uncommon with your Vapoursynth setup?

asarian
7th November 2024, 18:07
I used:


#vid = core.fmtc.bitdepth(clip, bits = 32 )
#vid = core.fmtc.resample(vid, css = "444" )
vid = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")

ref_s = Oyster.Basic(vid, short_time=True)
clip = Oyster.Deringing(vid, ref_s, block_step=2)

# output
clip.set_output()
with: https://pastebin.com/DwhtghH1
and it worked fine.

Anything uncommon with your Vapoursynth setup?

Actually, in my latest code, I had used sections from your exact code. :):goodpost:

I don't get it, though. SetFieldBased should be part of 'core.std', like:

clip = core.std.SetFieldBased(clip, 0)

So, why on earth would VapourSynth tell me "No attribute with the name SetFieldBased exists"?


EDIT: I smell a rat! In Oyster, I see this

core = vs.core
src = core.SetFieldBased(src, 0)

Maybe that should indeed now be core.std.SetFieldBased?

Selur
7th November 2024, 19:06
I reuploaded the Oyster.py: https://pastebin.com/faN0jg4a

self.core = vs.core # <-
self.MSuper = self.core.mvsf.Super
self.MAnalyze = self.core.mvsf.Analyze
self.MRecalculate = self.core.mvsf.Recalculate
self.MDegrain = self.core.mvsf.Degrain
self.RGB2OPP = self.core.bm3d.RGB2OPP
self.OPP2RGB = self.core.bm3d.OPP2RGB
self.BMBasic = self.core.bm3d.VBasic
self.BMFinal = self.core.bm3d.VFinal
self.Aggregate = self.core.bm3d.VAggregate
self.DFTTest = self.core.dfttest.DFTTest
self.KNLMeansCL = self.core.knlm.KNLMeansCL
self.NNEDI = self.core.nnedi3.nnedi3
self.Resample = self.core.fmtc.resample
self.Expr = self.core.std.Expr
self.MakeDiff = self.core.std.MakeDiff
self.MergeDiff = self.core.std.MergeDiff
self.Crop = self.core.std.CropRel
self.CropAbs = self.core.std.CropAbs
self.Transpose = self.core.std.Transpose
self.BlankClip = self.core.std.BlankClip
self.AddBorders = self.core.std.AddBorders
self.StackHorizontal = self.core.std.StackHorizontal
self.StackVertical = self.core.std.StackVertical
self.MaskedMerge = self.core.std.MaskedMerge
self.ShufflePlanes = self.core.std.ShufflePlanes
self.SetFieldBased = self.core.std.SetFieldBased # <-

the last line is the important one.

asarian
7th November 2024, 19:11
I reuploaded the Oyster.py: https://pastebin.com/faN0jg4a

self.core = vs.core # <-
self.MSuper = self.core.mvsf.Super
self.MAnalyze = self.core.mvsf.Analyze
self.MRecalculate = self.core.mvsf.Recalculate
self.MDegrain = self.core.mvsf.Degrain
self.RGB2OPP = self.core.bm3d.RGB2OPP
self.OPP2RGB = self.core.bm3d.OPP2RGB
self.BMBasic = self.core.bm3d.VBasic
self.BMFinal = self.core.bm3d.VFinal
self.Aggregate = self.core.bm3d.VAggregate
self.DFTTest = self.core.dfttest.DFTTest
self.KNLMeansCL = self.core.knlm.KNLMeansCL
self.NNEDI = self.core.nnedi3.nnedi3
self.Resample = self.core.fmtc.resample
self.Expr = self.core.std.Expr
self.MakeDiff = self.core.std.MakeDiff
self.MergeDiff = self.core.std.MergeDiff
self.Crop = self.core.std.CropRel
self.CropAbs = self.core.std.CropAbs
self.Transpose = self.core.std.Transpose
self.BlankClip = self.core.std.BlankClip
self.AddBorders = self.core.std.AddBorders
self.StackHorizontal = self.core.std.StackHorizontal
self.StackVertical = self.core.std.StackVertical
self.MaskedMerge = self.core.std.MaskedMerge
self.ShufflePlanes = self.core.std.ShufflePlanes
self.SetFieldBased = self.core.std.SetFieldBased # <-

the last line is the important one.

Haha! You're 10x faster than I am. :) I was painstakingly trying to fix all of them, but I was only at 3.

Anyway, you've been a great help! Thank you.