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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd April 2021, 09:43   #4281  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Nico8583 View Post
Thank you Myrsloik ! The Windows portable installation is the same than previous versions (except Python 3.9 instead of 3.8 - Decompress R53 into Python 3.9 embeddable folder) ? Thank you.
Yes, same procedure as every year.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 19th May 2021, 20:45   #4282  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Is there anything similar to a 'vibrance' filter in photoshop and similar in Vapoursynth (some sort of restricted saturation filtering)?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 20th May 2021, 17:21   #4283  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
We looked a bit at the mess that is mask handling recently and now I have one simple question:

Is there any script out there that actually passes a YUV clip as the mask argument of MaskedMerge and doesn't set first_plane=1? (and doesn't simply discard the output UV planes later).
Code:
MaskedMerge(YUVclipA, YUVclipB, YUVmask)
I think the answer is no. Counterexamples welcome.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 1st June 2021, 18:52   #4284  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
any plan to replace this with a real font? It can't even display tabs...
feisty2 is offline   Reply With Quote
Old 1st June 2021, 21:27   #4285  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by feisty2 View Post
any plan to replace this with a real font? It can't even display tabs...
Nope, the whole point is that it adds no external dependencies at all for basic printing. If there's particular control shit or a like tabs simply create an issue for it and maybe someone will look at it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 13th June 2021, 16:23   #4286  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Hi, I'm trying to get VSGAN running in a fresh portable Vapoursynth setup, see: https://github.com/rlaphoenix/VSGAN/issues/7
at the end I use this script:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()

# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))

# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")

# Import scripts
import mvsfunc

# source: 'G:\TestClips&Co\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="G:/TestClips&Co/test.avi",cachefile="E:/Temp/avi_9dec25d3f707eb4813d42334c7f1a8d6_853323747.ffindex",format=vs.YUV420P8,alpha=False)

# adjusting color space from YUV420P8 to RGB24 for vsVSGAN
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="limited")

# resizing using VSGAN
from vsgan import VSGAN
vsgan = VSGAN("cuda")
model = "I:/Hybrid/64bit/vsgan_models/4x_BSRGAN.pth"
vsgan.load_model(model)
clip = vsgan.run(clip=clip)

# Output
clip.set_output()
call it using:
Code:
i:\Vapoursynth\VSPipe.exe --info C:\Users\Selur\Desktop\testvsgan.vpy -
and end up with:
Code:
Script evaluation failed:
Python exception: cannot import name 'VSGAN' from 'vsgan' (i:\Vapoursynth\Lib\site-packages\vsgan\__init__.py)

Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 2242, in vapoursynth.vpy_evaluateScript
  File "src\cython\vapoursynth.pyx", line 2243, in vapoursynth.vpy_evaluateScript
  File "C:\Users\Selur\Desktop\testvsgan.vpy", line 26, in <module>
    from vsgan import VSGAN
ImportError: cannot import name 'VSGAN' from 'vsgan' (i:\Vapoursynth\Lib\site-packages\vsgan\__init__.py)
Problem is I have no clue where to look or what I might need to adjust.

When I use the FATPACK as basis instead of using the portable Python and Vapoursynth the was I did, it does work.
-> does anyone have an idea what I might have to adjust to make this work?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 13th June 2021, 17:06   #4287  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Got it working by creating a fake I:\Vapoursynth\Lib\site-packages\VapourSynth-53.dist-info folder with some fake info and uninstalling and reinstalling VSGAN I got it working!
Side note: the portable version should contain a Lib\site-packages\VapourSynth-53.dist-info-folder with proper infos.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 25th June 2021, 04:45   #4288  |  Link
EnC
Registered User
 
Join Date: Jun 2021
Posts: 1
Quote:
Originally Posted by Selur View Post
Got it working by creating a fake I:\Vapoursynth\Lib\site-packages\VapourSynth-53.dist-info folder with some fake info and uninstalling and reinstalling VSGAN I got it working!
Side note: the portable version should contain a Lib\site-packages\VapourSynth-53.dist-info-folder with proper infos.

Cu Selur
This little trick did work for me too to install awsmfunc too. Strange it fails during 'requirements' without fake 'VapourSynth-53.dist-info' folder.
EnC is offline   Reply With Quote
Old 26th June 2021, 09:13   #4289  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Since my python skills aren't that high I'm not sure whether I made a mistake or this is a bug.
Using vs-placebo with shader="path to file" works fine for me, but using 'shader_s' does not.

Calling:
Code:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# source: 'G:\TestClips&Co\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="G:/TestClips&Co/test.avi",cachefile="E:/Temp/avi_9dec25d3f707eb4813d42334c7f1a8d6_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# GLSL filter: adaptive-sharpen.glsl
# adjusting color space from YUV420P8 to YUV444P16 for VsGLSLFilter
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
with open("I:/Hybrid/64bit/vsfilters/GLSL/adaptive-sharpen.glsl") as glslf:
  glsl = glslf.read()
glsl = glsl.replace('#define curve_height    1.0', '#define curve_height    2.0');
clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=640, height=352)
# adjusting output color from: YUV444P16 to YUV420P10 for x265Model (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
I get:
Code:
Failed to evaluate the script:
Python exception: Shader: Function does not take argument(s) named shader_s

Traceback (most recent call last):
  File "src\cython\vapoursynth.pyx", line 2242, in vapoursynth.vpy_evaluateScript
  File "src\cython\vapoursynth.pyx", line 2243, in vapoursynth.vpy_evaluateScript
  File "C:\Users\Selur\Desktop\test.vpy", line 23, in <module>
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=640, height=352)
  File "src\cython\vapoursynth.pyx", line 2040, in vapoursynth.Function.__call__vapoursynth.Error: Shader: Function does not take argument(s) named shader_s
according to:
Code:
placebo.Shader(clip clip, [string shader, int width, int height, int chroma_loc = 1, int matrix = 2, int trc = 1, string filter = "ewa_lanczos", float radius, float clamp, float taper, float blur, float param1, float param2, float antiring = 0.0, int lut_entries = 64, float cutoff = 0.001, bool sigmoidize = 1, bool linearize = 1, float sigmoid_center = 0.75, float sigmoid_slope = 6.5, string shader_s])
this should work, shouldn't it?

Cu Selur

Ps.: I also posted this to the vs-placebo github issue tracker (https://github.com/Lypheo/vs-placebo/issues/12).
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 26th June 2021, 10:02   #4290  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Okay, that got solved, only master contained the shader_s-path not the current (1.1.0) release,..
-> if someone got a build environment for this would be nice if he could build and share a current 64bit Windows build of VSGAN
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 26th June 2021 at 11:05.
Selur is offline   Reply With Quote
Old 27th June 2021, 14:18   #4291  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
anyone wants a general remap filter?
Code:
clip = core.std.Remap(clip, lambda y, x: [clip.height - y - 1, x]) # equivalent to FlipVertical
clip = core.std.Remap(clip, lambda y, x: [y, clip.width - x - 1]) # equivalent to FlipHorizontal

clip = core.std.StackVertical([clip, clip])
clip = core.std.StackHorizontal([clip, clip])
clip = core.std.Remap(clip, lambda y, x: [y // 2, x // 2]) # equivalent to 2x upscale by point resize
feisty2 is offline   Reply With Quote
Old 27th June 2021, 14:27   #4292  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by feisty2 View Post
anyone wants a general remap filter?
Code:
clip = core.std.Remap(clip, lambda y, x: [clip.height - y - 1, x]) # equivalent to FlipVertical
clip = core.std.Remap(clip, lambda y, x: [y, clip.width - x - 1]) # equivalent to FlipHorizontal

clip = core.std.StackVertical([clip, clip])
clip = core.std.StackHorizontal([clip, clip])
clip = core.std.Remap(clip, lambda y, x: [y // 2, x // 2]) # equivalent to 2x upscale by point resize
That's a fun thing to have. I think you should have destination width/height arguments so the point resize-ish cases don't require the dummy steps.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 10th July 2021, 18:28   #4293  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
hi, I'm trying to convert the Avisynth function:
Code:
function filldrops(clip c, float "thresh")
{
  thresh = default(thresh, 0.1)
  
  super=MSuper(c,pel=2)
  vfe=MAnalyse(super,truemotion=true,isb=false,delta =1)
  vbe=MAnalyse(super,truemotion=true,isb=true,delta= 1)
  filldrops = MFlowInter(c,super,vbe,vfe,time=50)
  fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", String(thresh))
  return fixed
}
slightly modified, source: https://forum.doom9.org/showthread.php?p=17751849

to Vapoursynth, and got:
Code:
def filldrops(c, thresh=0.1)

  def YDifferenceFromPrevious(n, f, clips):
    if f.props['_SceneChangePrev']:
     return clips[0]
    else:
     return clips[1]

  super=core.mv.Super(clip=c,pel=2)
  vfe=core.mv.Analyse(clip=super,truemotion=true,isb=false,delta =1)
  vbe=core.mv.Analyse(clip=super,truemotion=true,isb=true,delta= 1)
  filldrops = core.mv.FlowInter(clip=c,super,mvbw=vbe,mvfw=vfe,time=50)
  #fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", String(thresh))
  fixed = core.std.FrameEval(...)
  return fixed
but I'm stuck at the ConditionalFilter-line. :/
-> can someone tell me how FrameEval(...) should look like to do what ConditionalFilter(...) does ?

Thanks!

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 10th July 2021 at 18:51.
Selur is offline   Reply With Quote
Old 11th July 2021, 15:45   #4294  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Code:
def filldrops(c, thresh=0.1)
  diffclip = core.std.PlaneStats(c, c[0] + c)
  super=core.mv.Super(clip=c,pel=2)
  vfe=core.mv.Analyse(clip=super,truemotion=true,isb=false,delta =1)
  vbe=core.mv.Analyse(clip=super,truemotion=true,isb=true,delta= 1)
  filldrops = core.mv.FlowInter(clip=c,super,mvbw=vbe,mvfw=vfe,time=50)
  def selectFunc(n, f):
    if f.props['PlaneStatsDiff'] < thresh:
     return c
    else:
     return filldrops

  fixed = core.std.FrameEval(c, selectFunc, prop_src=diffclip)
  return fixed
Didn't test it but it should be 99% of the way there. Simple selection.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th July 2021, 16:36   #4295  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Thanks !
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 12th July 2021, 00:32   #4296  |  Link
JKyle
App Digger
 
JKyle's Avatar
 
Join Date: Sep 2018
Posts: 411
Thanks, @Selur and @Myrsloik.

I fixed some syntax errors and slightly modified the script to make it work in StaxRip.

Here's the source code.

Last edited by JKyle; 12th July 2021 at 01:27.
JKyle is offline   Reply With Quote
Old 16th July 2021, 12:36   #4297  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
R54-RC1

This release makes the handling of floating point masks consistent (now always 0-1 range, even for UV planes) and fixes some other minor bugs. Should be a very stable build overall.

Code:
r54:
updated visual studio 2019 runtime version
updated zimg to 3.0.2
cliptoprop now uses the length of the second clip instead of the first one
added sin and cos operator to the expr filter (AkarinVS)
made handling of floating point masks consistent (AkarinVS and more)
fixed memory leak on free in expr filter on linux (AkarinVS)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th July 2021, 17:21   #4298  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
btw. is there a way to stop auto-loading so that only explicitly loaded filters are loaded nowadays?

@JKyle: Any plans to port Dejump to Vaporusynth?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 16th July 2021, 21:57   #4299  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Selur View Post
btw. is there a way to stop auto-loading so that only explicitly loaded filters are loaded nowadays?

@JKyle: Any plans to port Dejump to Vaporusynth?
An option to disable auto loading is probably coming soon. With more exciting things as well.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 17th July 2021, 08:26   #4300  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
An option to disable auto loading is probably coming soon. With more exciting things as well.
Nice! Thanks for the info, looking forward to it.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.