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

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th June 2018, 15:03   #3121  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 19
I tried to used IVTC but I got an error

script:

Quote:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM().vivtc.VDecimate()
src.set_output()
error:

Quote:
Failed to evaluate the script:
Python exception: VFM: argument order is required

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "C:/Users/Administrator/Desktop/encoder/Untitled.vpy", line 6, in
src.set_output()
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: VFM: argument order is required
-VapourSynthEditor-r18-64bit
-VapourSynth-R39
unix is offline   Reply With Quote
Old 8th June 2018, 15:05   #3122  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 145
Quote:
Originally Posted by unix View Post
-VapourSynthEditor-r18-64bit
-VapourSynth-R39
The first thing you may want to try updating VapourSynth, it's up to R43 now. Second, you'll want to specify order:

Code:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
src.set_output()
Check your source to make sure you use the correct order.

Last edited by l33tmeatwad; 8th June 2018 at 15:07.
l33tmeatwad is offline   Reply With Quote
Old 8th June 2018, 15:05   #3123  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,796
Quote:
Originally Posted by l33tmeatwad View Post
The first thing you may want to try updating VapourSynth, it's up to R43 now.
More like try reading the error message. You didn't set field ORDER.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th June 2018, 15:08   #3124  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 145
Quote:
Originally Posted by Myrsloik View Post
More like try reading the error message. You didn't set field ORDER.
Sorry, I accidentally hit submit as I was typing out my reply...
l33tmeatwad is offline   Reply With Quote
Old 8th June 2018, 17:18   #3125  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 19
Quote:
Originally Posted by l33tmeatwad View Post
The first thing you may want to try updating VapourSynth, it's up to R43 now. Second, you'll want to specify order:

Code:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
src.set_output()
Check your source to make sure you use the correct order.
I installed the last ver and I opened the file without
Code:
src = src.vivtc.VFM(order=1).vivtc.VDecimate()
but when i used it i got this error:
Code:
Failed to evaluate the script:
Python exception: VFM: argument order is required

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "C:/Users/Administrator/Desktop/encoder/Untitled.vpy", line 6, in 
src.set_output()
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: VFM: argument order is required

Last edited by unix; 8th June 2018 at 21:22.
unix is offline   Reply With Quote
Old 8th June 2018, 22:34   #3126  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 19
Thanks l33tmeatwad for solving my issue =)
unix is offline   Reply With Quote
Old 10th June 2018, 13:04   #3127  |  Link
edcrfv94
Registered User
 
Join Date: Apr 2015
Posts: 64
I have a problem with VapourSynth Internal Resize use, but work fine with core.fmtc.resample.
Internal Resize result look like damaged.

VapourSynth Internal Resize


haf.Resize(core.fmtc.resample)


example1:
Code:
test = core.resize.Bilinear(src8, 960, 540)
test = core.resize.Bilinear(test, 1920, 1080)

#Fixed
test = haf.Resize(src8, 960, 540, kernel="bilinear", noring=False)
test = haf.Resize(test, 1920, 1080, kernel="bilinear", noring=False)
example2:
Code:
def Padding(clip, left=0, right=0, top=0, bottom=0):
    if not isinstance(clip, vs.VideoNode):
        raise TypeError('Padding: This is not a clip')
    if left < 0 or right < 0 or top < 0 or bottom < 0:
        raise ValueError('Padding: border size to pad must not be negative')

    return core.resize.Point(clip, clip.width + left + right, clip.height + top + bottom,
                             src_left=-left, src_top=-top, src_width=clip.width + left + right, src_height=clip.height + top + bottom)

#Fixed
def Padding(clip, left=0, right=0, top=0, bottom=0):
	if not isinstance(clip, vs.VideoNode):
		raise TypeError('Padding: This is not a clip')
	if left < 0 or right < 0 or top < 0 or bottom < 0:
		raise ValueError('Padding: border size to pad must not be negative')
	
	src_w = clip.width
	src_h = clip.height
	
	return haf.Resize(clip, src_w + left + right, src_h + top + bottom, sx=-left, sy=-top, sw=src_w + left + right, sh=src_h + top + bottom, kernel="point", noring=False)

Padding(clip, left=8, right=8, top=8, bottom=8)

Last edited by edcrfv94; 10th June 2018 at 13:14.
edcrfv94 is offline   Reply With Quote
Old 11th June 2018, 06:49   #3128  |  Link
edcrfv94
Registered User
 
Join Date: Apr 2015
Posts: 64
Quote:
Originally Posted by Stephen R. Savage View Post
Example1 is because your input is interlaced. Example2 is because the internal resizer uses a different border extension method from fmtc. You can use std.SetFieldBased to force the input to be treated as progressive.
Thanks
Also VapourSynth Internal Resize src_left and src_top not working.

Code:
test = core.resize.Spline36(src8, 1920, 1080, src_left=0, src_top=-0.5)

Fixed
test = haf.Resize(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36", noring=False)
or
test = core.fmtc.resample(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36")
edcrfv94 is offline   Reply With Quote
Old 13th June 2018, 21:01   #3129  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 920
Quote:
Originally Posted by foxyshadis View Post
Color is only ever read as a Python list of each value per plane. There's nothing keeping you from implementing a convenience function, however, like:

Code:
def Hex2List(colorhex):
  digits = math.ceil(colorhex ** (1/16.))
  colorlist = []
  for plane in range(0,digits):
    colorlist.insert(0, colorhex % 256)
    colorhex = colorhex // 256
  return colorlist
And calling it as Hex2List(0x778899).

You can always use an actual list like [0x77, 0x88, 0x99], so the value of this convenience is questionable.
I have a follow-up issue with this. It works until I have a color hex like "000002"

Code:
color = "000002" # this doesn't work
#color = "53aadf" # this one works
hex_int = int(color, 16)

clip = core.std.BlankClip(width=patch_width, height=patch_width, length=1, color=Hex2List(hex_int))
It gives me an error "BlankClip: invalid number of color values specified".
lansing is online now   Reply With Quote
Old 13th June 2018, 22:11   #3130  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,796
Quote:
Originally Posted by lansing View Post
I have a follow-up issue with this. It works until I have a color hex like "000002"

Code:
color = "000002" # this doesn't work
#color = "53aadf" # this one works
hex_int = int(color, 16)

clip = core.std.BlankClip(width=patch_width, height=patch_width, length=1, color=Hex2List(hex_int))
It gives me an error "BlankClip: invalid number of color values specified".
Numbers starting with 0 are interpreted as octal numbers (base 8). If you always put a 0x in front you'll be fine or drop the leading zeroes.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th June 2018, 02:24   #3131  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 920
After some searches I've found a 2 liner function for this in stackflow

Code:
def hex_to_rgb(value):
    """Return (red, green, blue) for the color given as #rrggbb."""
    value = value.lstrip('#')
    lv = len(value)
    return list(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
lansing is online now   Reply With Quote
Old 14th June 2018, 21:26   #3132  |  Link
hBIkOa7m
Registered User
 
Join Date: Feb 2016
Posts: 6
Quote:
Originally Posted by lansing View Post
After some searches I've found a 2 liner function for this in stackflow
You do realise hexadecimal colours are already 0xRRGGBB? It's just stacked in base16 instead of split into a list of base10. You can just shift the input value to access the colour without any fancy stuff. Dumb example Python code.

Code:
input_hex = 0x53aadf
r = (input_hex >> 16) & 0xFF # 83
g = (input_hex >> 8) & 0xFF # 170
b = (input_hex >> 0) & 0xFF # 223

Last edited by hBIkOa7m; 15th June 2018 at 20:11. Reason: Fixed comments at EOL to use # rather than //. Wrote sample code in the forum and didn't run it.
hBIkOa7m is offline   Reply With Quote
Old 14th June 2018, 21:45   #3133  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,333
Quote:
Originally Posted by lansing View Post
After some searches I've found a 2 liner function for this in stackflow

Code:
def hex_to_rgb(value):
    """Return (red, green, blue) for the color given as #rrggbb."""
    value = value.lstrip('#')
    lv = len(value)
    return list(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
Would you rather pass a string instead of a hex integer? OK, use that. You HAVE to pass a string though. It wouldn't be difficult to combine a way to pass string or integer, but it's not a 2-liner.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 15th June 2018, 04:45   #3134  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 920
Quote:
Originally Posted by foxyshadis View Post
Would you rather pass a string instead of a hex integer? OK, use that. You HAVE to pass a string though. It wouldn't be difficult to combine a way to pass string or integer, but it's not a 2-liner.
It's good, I'm going to read the color from a text file, so they will be all strings.
lansing is online now   Reply With Quote
Old 15th June 2018, 14:35   #3135  |  Link
Stephen R. Savage
Registered User
 
Stephen R. Savage's Avatar
 
Join Date: Nov 2009
Posts: 333
Quote:
Originally Posted by edcrfv94 View Post
Thanks
Also VapourSynth Internal Resize src_left and src_top not working.

Code:
test = core.resize.Spline36(src8, 1920, 1080, src_left=0, src_top=-0.5)

Fixed
test = haf.Resize(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36", noring=False)
or
test = core.fmtc.resample(src8, 1920, 1080, sx=0, sy=-0.5, kernel="spline36")
That is already fixed in the next build.
Stephen R. Savage is offline   Reply With Quote
Old 24th June 2018, 18:43   #3136  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 327
Is there a Despot script or plugin available for VS?

I tried this avs script by Didée http://forum.doom9.net/showthread.ph...90#post1402690
which works good, but has problems with heavy motion / flashy scenes and produces sometimes ghosting. The two first problems can be compensated to some degree if used as a prefilter in smdegrain, but the ghosting problem remains.

Maybe someone knows an alternative or can improve this script?


Code:
def despot(o):
	osup = o.mv.Super(pel=2, sharp=2)
	bv1  = osup.mv.Analyse(isb=True, delta=1, blksize=8, overlap=4, search=4)
	fv1  = osup.mv.Analyse(isb=False,delta=1, blksize=8, overlap=4, search=4)
	bc1  = o.mv.Compensate(osup, bv1)
	fc1  = o.mv.Compensate(osup, fv1)
	
	clip = core.std.Interleave([fc1, o, bc1])
	clip = core.rgvs.Clense(clip)
	clip = core.std.SelectEvery(clip, cycle=3, offsets=1)
	
	return clip
__________________
Search and denoise
ChaosKing is offline   Reply With Quote
Old 29th June 2018, 13:13   #3137  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 19
is there a "histogram" filter for VapourSynth?
unix is offline   Reply With Quote
Old 29th June 2018, 13:44   #3138  |  Link
Wolfberry
Helenium(Easter)
 
Wolfberry's Avatar
 
Join Date: Aug 2017
Location: Taiwan
Posts: 15
Plugin List
Histogram
Next time check the list before asking.
Wolfberry is offline   Reply With Quote
Old 30th June 2018, 18:17   #3139  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 920
Reporting a bug cropping a rgb32 clip.

Code:
rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)
rgb_clip = core.std.Crop(rgb_clip , bottom=50)
This will crop 50 from the top instead of the bottom. It works fine in YUV clips.
lansing is online now   Reply With Quote
Old 30th June 2018, 18:51   #3140  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,425
I remember there are top-down DIBs and bottom-up DIBs; maybe the COMPAT format is a factor here?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 20:18.


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