Vapoursynth scripts that might be useful to someone
Install from AUR
First install the required plugins which are not available in pip:
Install from pip:
pip install soifunc
Or the latest git version:
pip install git+https://github.com/shssoichiro/soifunc.git
Any of the functions will require an import soifunc
prior to where they are used.
clip = soifunc.good_resize(clip, 1920, 1080)
Resizes a clip to the specified dimensions using a high quality method.
For upscaling, luma is resized using nnedi3_resample
.
For downscaling, luma is resized using SSIM_downsample
.
Chroma is always resized using Spline36
.
If this filter causes your video to produce a blank output, see this issue: HomeOfVapourSynthEvolution/VapourSynth-TCanny#14
Additional Params:
gpu
: Whether to use the OpenCL version of supported dependencies. Defaults to auto-detect.
clip = soifunc.retinex_deband(clip, threshold = 16 [, showmask = False])
High quality debanding using a retinex mask, designed to preserve details in both light and dark areas.
threshold
controls debanding strength. 16
is a reasonable starting point. Increase as needed until satisfied.
showmask
is an optional debugging parameter, setting this to True
will output the mask that will be used to preserve edges.
Note that this debander does not automatically add grain.
If you need to add grain before encoding, use vsdeband.AddNoise
.
If you're using AV1 grain synthesis, you do not need to add grain before encoding.
Applies motion compensation to a denoised clip to improve detail preservation. Credit to Clybius for creating this code.
Example usage:
import soifunc
import dfttest2
import functools # functools is built in to python
denoiser = functools.partial(dfttest2.DFTTest, sigma=1.5, backend=dfttest2.Backend.CPU)
clip = soifunc.MCDenoise(clip, denoiser)
Params:
denoiser
: A function defining how to denoise the motion-compensated frames. Denoiser params can be added usingfunctools.partial
.prefilter
: An optional prefiltered input clip to enable better searching for motion vectors
Clybius's magic denoise function.
Uses dark magic to denoise heavy grain from videos. Zero parameters, only magic.
Params:
clip
: The input video to apply deinterlacing togpu
: Whether to use the OpenCL version of supported dependencies.