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 21st April 2023, 17:52   #4801  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
How can I get the current scan type (tff/bff/progressice) of the clip I'm using, so that I can use it in a script? (I don't want to display it.)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 22nd April 2023, 20:05   #4802  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
from the props, not sure if I understand
Code:
n = 0
try:
    field_based = clip.get_frame(n).props.get('_FieldBased', None)
except (vs.Error, IndexError) as e:
    raise ValueError(f'requesting prop for a frame: {n} failed, {e}')
print(field_based)
_Al_ is online now   Reply With Quote
Old 23rd April 2023, 07:25   #4803  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Strange, I would have bet I tried that and it didn't work.
Worked now, must have made a typo.
Thanks.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 25th April 2023, 19:54   #4804  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Cdblend and srestore both use std.Cache(make_linear=True) which turned in to a noop function in API4 (are there more noop functions? is there some documentation about this?)
Is there a way to get the same effect as "std.Cache(make_linear=True)" with API4 Vapoursynth that would allow to fix those two scripts which now return worse results than before?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 25th April 2023, 21:44   #4805  |  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
Cdblend and srestore both use std.Cache(make_linear=True) which turned in to a noop function in API4 (are there more noop functions? is there some documentation about this?)
Is there a way to get the same effect as "std.Cache(make_linear=True)" with API4 Vapoursynth that would allow to fix those two scripts which now return worse results than before?
http://www.vapoursynth.com/doc/funct...ideocache.html
Basically this is the closest you get. You can't set the linear mode from scripts but if you need it something else is wrong. Which source filter are you using?

Create an issue where you link the specific versions of the functions you're using, full script and source filter and I'll check it. Should be fairly quick to figure out where things go wrong.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 29th April 2023, 06:31   #4806  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Trying to assess how broken of a state current filter scripts are, are there more such 'dummy' functions in API4?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 29th April 2023, 10:07   #4807  |  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
Trying to assess how broken of a state current filter scripts are, are there more such 'dummy' functions in API4?
Nope. Also it only worked by accident previously. The world is threaded now.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 29th April 2023, 10:15   #4808  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
Nope. Also it only worked by accident previously.
Okay, good to know, I just need to throw away all functions containing 'std.Cache(make_linear=True)'.
Thanks for the info.

Since I have little hope that anyone will write a sRestore filter, I will have to rethink some of my workflows and probably add an intermediate step to filter with Avisynth.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 3rd May 2023, 19:08   #4809  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
I can't find any deblenders in Vapoursynth that work with current Vapoursynth R61/62, does anyone know one?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 14th June 2023, 21:14   #4810  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
R63 has been released. Minor bug fixes mostly. This is also the last release I'm going to make official 32 bit binaries for. Nobody downloads them anyway except by accident.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 15th June 2023, 08:51   #4811  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by Myrsloik View Post
R63 has been released. Minor bug fixes mostly. This is also the last release I'm going to make official 32 bit binaries for. Nobody downloads them anyway except by accident.
Half of the compiled plugins on Github are only available as 64 bit anyway.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 21st June 2023, 19:25   #4812  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Speaking of deprecating things. How many win7 users remain nowadays? I'm curious if there actually is a real userbase still remaining.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 24th June 2023, 15:01   #4813  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
2x Win10, 2x Win7, 5x WinXP here, 7 single and 1 dual-boot Win7+WinXP.
Paid, abandoned, but working and irreplaceable softwares made that necessary.

Win7 should be minimum supported, or does that restrict coding seriously?
The default compiler switches that intentionally introduce incompatibilities are well known by now and can be avoided most of the time.
Well, I won't need VapourSynth to work under WinXP, I can use a Win10 machine for that.

As long as there is one Swiss Army Knife that can run under more than the latest forced-updating-and then-bluescreening (again) OS...

AviSynth works under these 3 Win generations, and the just recently introduced XP-compatible Audio preview makes it fun again to edit, even restore and encode on WinXP machines.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 24th June 2023 at 15:03.
Emulgator is offline   Reply With Quote
Old 25th June 2023, 11:01   #4814  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,783
A major difference between Windows 7 and 10 is in hardware access and security aspects; most software focused on just calculations should be quite compatible, even when using more modern SIMD instructions Windows 7 did not yet prepare well for, with some caution.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 25th June 2023, 17:08   #4815  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by LigH View Post
A major difference between Windows 7 and 10 is in hardware access and security aspects; most software focused on just calculations should be quite compatible, even when using more modern SIMD instructions Windows 7 did not yet prepare well for, with some caution.
I have no reason to remove win7 support yet as it doesn't require additional work to maintain. The only problem is that I can't be bothered to test win7 (or 8.1 for that matter) anymore and therefore check now and then if anyone still actually use it and it receives testing. This is simply a check I do now and then to see if any actual (and possibly bug reporting) users remain.

One of the previous posts also mention xp support in avs+ still but that's intermittent due to a very low volume of testing, even the visual studio runtime breaks now and then because Microsoft doesn't care that much either. Once win7 reaches the same level of neglect or the latest visual studio drops support I'll also drop it in VapourSynth. Obviously.

If someone wants to encode on winxp level hardware with VapourSynth it's still very possible. Just install linux, it'll run much faster due to vastly superior memory management too.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 26th June 2023, 14:31   #4816  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
I'm using R63 with this script:
Code:
# Imports
import vapoursynth as vs
import os
import sys
# getting Vapoursynth core
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/Support/libmvtools.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow2_vs64.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow1_vs64.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
import filldrops
# source: 'C:\Users\Selur\Desktop\002 - Copia.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 23.976, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading C:\Users\Selur\Desktop\002 - Copia.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/002 - Copia.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
# making sure frame rate is set to 23.976
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
clip = filldrops.InsertSingle(clip=clip,method="mv")
#clip = filldrops.InsertSingle(clip=clip,method="svp_gpu")
#clip = filldrops.InsertSingle(clip=clip,method="svp")

# Output
clip.set_output()
and filldrops.py:
Code:
import vapoursynth as vs
core = vs.core

def fillWithMVTools(clip):
  super = core.mv.Super(clip, pel=2)
  vfe = core.mv.Analyse(super, truemotion=True, isb=False, delta=1)
  vbe = core.mv.Analyse(super, truemotion=True, isb=True, delta=1)
  return core.mv.FlowInter(clip, super, mvbw=vbe, mvfw=vfe, time=50)
    
def fillWithRIFE(clip, firstframe=None, rifeModel=1, rifeTTA=False, rifeUHD=False, rifeThresh=0.15):
  clip1 = core.std.AssumeFPS(clip, fpsnum=1, fpsden=1)
  start = core.std.Trim(clip1, first=firstframe-1, length=1)
  end = core.std.Trim(clip1, first=firstframe+1, length=1)
  startend = start + end
  if clip.format != vs.RGBS:
    r = core.resize.Point(startend, format=vs.RGBS, matrix_in_s="709")
  if rifeThresh != 0:
    r = core.misc.SCDetect(clip=r,threshold=rifeThresh)
  r = core.rife.RIFE(r, model=rifeModel, tta=rifeTTA,uhd=rifeUHD)
  if clip.format != vs.RGBS:
    r = core.resize.Point(r, format=clip.format, matrix_s="709")

  r = core.std.Trim(r, first=1, last=1) 
  r = core.std.AssumeFPS(r, fpsnum=1, fpsden=1)
  a = core.std.Trim(clip1, first=0, last=firstframe-1) 
  b = core.std.Trim(clip1, first=firstframe+1)
  join = a + r + b
  return core.std.AssumeFPS(join, src=clip)


def fillWithGMFSSUnion(clip, firstframe=None, gmfssModel=0, gmfssThresh=0.15):
  from vsgmfss_fortuna import gmfss_fortuna
  clip1 = core.std.AssumeFPS(clip, fpsnum=1, fpsden=1)
  start = core.std.Trim(clip1, first=firstframe-1, length=1)
  end = core.std.Trim(clip1, first=firstframe+1, length=1)
  startend = start + end
  if clip.format != vs.RGBH:
    r = core.resize.Point(startend, format=vs.RGBH, matrix_in_s="709")
  r = gmfss_fortuna(r, model=gmfssModel, sc_threshold=gmfssThresh)
  if clip.format != vs.RGBH:
    r = core.resize.Point(r, format=clip.format, matrix_s="709")
  r = core.std.Trim(r, first=1, last=1) 
  r = core.std.AssumeFPS(r, fpsnum=1, fpsden=1)
  a = core.std.Trim(clip1, first=0, last=firstframe-1) 
  b = core.std.Trim(clip1, first=firstframe+1)
  join = a + r + b
  return core.std.AssumeFPS(join, src=clip)



def fillWithSVP(clip, firstframe=None, gpu=False):
  clip1 = core.std.AssumeFPS(clip, fpsnum=1, fpsden=1)
  start = core.std.Trim(clip1, first=firstframe-1, length=1)
  end = core.std.Trim(clip1, first=firstframe+1, length=1)
  startend = start + end
  
  if gpu:
    super  = core.svp1.Super(startend,"{gpu:1}")
  else:
    super  = core.svp1.Super(startend,"{gpu:0}")
  vectors= core.svp1.Analyse(super["clip"],super["data"],startend,"{}")
  r = core.svp2.SmoothFps(startend,super["clip"],super["data"],vectors["clip"],vectors["data"],"{}")
  
  r = core.std.Trim(r, first=1, last=1) 
  r = core.std.AssumeFPS(r, fpsnum=1, fpsden=1)
  a = core.std.Trim(clip1, first=0, last=firstframe-1) 
  b = core.std.Trim(clip1, first=firstframe+1)
  join = a + r + b
  return core.std.AssumeFPS(join, src=clip)
    
def FillSingleDrops(clip, thresh=0.3, method="mv", rifeModel=0, rifeTTA=False, rifeUHD=False, rifeThresh=0.15, gmfssModel=0, gmfssThresh=0.15, debug=False):
  core = vs.core
  if not isinstance(clip, vs.VideoNode):
      raise ValueError('This is not a clip')
      
  def selectFunc(n, f):
    if f.props['PlaneStatsDiff'] > thresh or n == 0:
      if debug:
        return core.text.Text(clip=clip,text="Org, diff: "+str(f.props['PlaneStatsDiff']),alignment=8)
      return clip
    else:
      if method == "mv":
        filldrops=fillWithMVTools(clip)
      elif method == "svp":
        filldrops=fillWithSVP(clip,n)
      elif method == "svp_gpu":
        filldrops=fillWithSVP(clip,n,gpu=True)
      elif method == "rife":
        filldrops = fillWithRIFE(clip,n,rifeModel,rifeTTA,rifeUHD,rifeThresh)
      elif method == "gmfssfortuna":
        filldrops = fillWithGMFSSUnion(clip,n,gmfssModel,gmfssThresh)
      else:
        raise vs.Error('FillDrops: Unknown method '+method)   
    if debug:
       return core.text.Text(clip=filldrops,text=method+", diff: "+str(f.props['PlaneStatsDiff']),alignment=8)
    return filldrops
          
  diffclip = core.std.PlaneStats(clip, clip[0] + clip)
  fixed = core.std.FrameEval(clip, selectFunc, prop_src=diffclip)
  return fixed


def InsertSingle(clip, afterEveryX=2, method="mv", rifeModel=0, rifeTTA=False, rifeUHD=False, rifeThresh=0.15, gmfssModel=0, gmfssThresh=0.15, debug=False):
  core = vs.core
  if not isinstance(clip, vs.VideoNode):
      raise ValueError('This is not a clip')
      
  def selectFunc(n):
    if n == 0 or n%afterEveryX != 0:
      return clip
    else:
      if method == "mv":
        insertFrame=fillWithMVTools(clip)
      elif method == "svp":
        insertFrame=fillWithSVP(clip,n)
      elif method == "svp_gpu":
        insertFrame=fillWithSVP(clip,n,gpu=True)
      elif method == "rife":
        insertFrame = fillWithRIFE(clip,n,rifeModel,rifeTTA,rifeUHD,rifeThresh)
      elif method == "gmfssfortuna":
        insertFrame = fillWithGMFSSUnion(clip,n,gmfssModel,gmfssThresh)
      else:
        raise vs.Error('InsertSingle: Unknown method '+method)   
    return insertFrame.text.Text("Interpolated")

  return core.std.FrameEval(clip, selectFunc)
When using method="mv", I get:
Code:
Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
I think this is the effect of:
Quote:
added a warning every time the deprecated cache filter is instantiated and ignored
source: https://github.com/vapoursynth/vapou...leases/tag/R63
and somehow this is triggered by:
Code:
def fillWithMVTools(clip):
  super = core.mv.Super(clip, pel=2)
  vfe = core.mv.Analyse(super, truemotion=True, isb=False, delta=1)
  vbe = core.mv.Analyse(super, truemotion=True, isb=True, delta=1)
  return core.mv.FlowInter(clip, super, mvbw=vbe, mvfw=vfe, time=50)

=> How can I fix this or does this require a mvtools update/fix/change to be really compatible with Vapoursynth R63?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 26th June 2023, 21:36   #4817  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
It's just a warning. The actual behavior hasn't changed from previous versions. I've added it to flush out the last pieces of not fixed code.

In this case I guess mvtools was never updated to api4. I'll have to add it to my todo list...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 26th June 2023 at 21:38.
Myrsloik is online now   Reply With Quote
Old 27th June 2023, 03:58   #4818  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Okay, thanks for the info.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 30th August 2023, 07:24   #4819  |  Link
Patman
Registered User
 
Patman's Avatar
 
Join Date: Jan 2015
Posts: 286
Can anyone help with the following issue?
http://forum.doom9.org/showthread.ph...55#post1991055

For me the changes made by DJATOM are correct.
__________________
Tools for StaxRip | x264 - x265
Patman is offline   Reply With Quote
Old 18th September 2023, 21:31   #4820  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
R64-RC1

Just your average bug fix release to keep up with new things. Will be released in a week or so if nobody finds horrible regressions.

Changes:
Code:
added json output of video frame properties to vspipe
fixed clearMap function, previously it would forget to properly clear the error state in maps which could cause crashes in frameeval and other filters
32 bit binaries are no longer provided for windows
updated zimg to fix issues on zen4 cpus
added support for cython 3.x
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   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 18:43.


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