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. |
4th October 2019, 14:15 | #3562 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
vsrepo can't update in realtime.
error 127 indicates that there is an appropriate DLL found but a required procedure export is missing. So maybe the "opencl requirements" for TCanny changed in the latest version? Or you need to install a different opencl version.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
4th October 2019, 14:20 | #3563 | Link | |
The cult of personality
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
|
Quote:
As for opencl, I installed latest driver which should include latest opencl. what should i do now? |
|
6th October 2019, 18:00 | #3564 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
Doing numpy operations I discovered that returning frame from within ModifyFrame() could be numpy image and vapoursynth does not object at all. Or rather to say it is vapoursynth type of object, but they are the same. So there is no need to copy image to a new frame using f.get_write_array(), which takes time. So for example with this simple numpy operation , drawing two cross lines into vapoursynth frame takes about 10 times faster.
this it with copying a new frame: Code:
import vapoursynth as vs from vapoursynth import core import numpy as np import timeit def numpy_process(n,f): start = timeit.default_timer() fout = f.copy() for p in range(3): plane = np.asarray(f.get_read_array (p)) plane_out = np.asarray(fout.get_write_array(p)) #numpy operation with numpy image (two dimensional, because using one plane only) plane[360,0:1280] = 255 plane[0:720,640] = 255 np.copyto(plane_out, plane) print(timeit.default_timer()-start) return fout clip = core.std.BlankClip(width=1280, height=720, format = vs.RGB24) clip = core.std.ModifyFrame(clip, clip, numpy_process) clip.set_output() Code:
0.0011401229999998819 0.0011680329999999017 0.0011924130000000588 0.001274217999999827 0.0011475010000001618 0.001175732000000096 Code:
def numpy_process(n,f): start = timeit.default_timer() for p in range(3): plane = np.asarray(f.get_read_array (p)) plane[360,0:1280] = 255 plane[0:720,640] = 255 print(timeit.default_timer()-start) return f clip = core.std.BlankClip(width=1280, height=720, format = vs.RGB24) clip = core.std.ModifyFrame(clip, clip, numpy_process) clip.set_output() Code:
0.00011035500000033949 0.00011580899999863448 0.00011709199999998532 0.00011292100000126482 0.00011163799999991397 0.00016841999999961388 0.0001109970000001681 Last edited by _Al_; 6th October 2019 at 18:04. |
6th October 2019, 18:15 | #3565 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Memory corruption. Don't do it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
7th October 2019, 02:15 | #3567 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Spoke too soon. Getting an overlay bug, probably related to mask in R48test1 . Works ok in R46, R47.2 . But in R48test1 it's discolored
Code:
orig = core.ffms2.Source(r'testchart.png') ovr = core.ffms2.Source(r'rgba_overlay.png') orig_10bit444 = core.resize.Bicubic(orig, format=vs.YUV444P10, matrix_s="709") ovrf_10bit444 = core.resize.Bicubic(ovr[0], format=vs.YUV444P10, matrix_s="709", range_s="full") ovrm_10bit444 = core.resize.Bicubic(ovr[1], format=vs.YUV444P10, matrix_s="709", range_s="full") overl = haf.Overlay(orig_10bit444, ovrf_10bit444, mask=ovrm_10bit444) https://www.mediafire.com/file/hf27n...erlay.rar/file |
7th October 2019, 09:38 | #3568 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
7th October 2019, 16:22 | #3570 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
No, auto-detection is still works, but now we can set lower instruction set (or fallback to C routines) on purpose. For example, if there are some bugs with avx2 optimizations, you can fallback to slower but well working functions.
|
9th October 2019, 11:06 | #3571 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Several bugs were found already. Will post a new build soon when they're fixed. Apparently Expr is broken too in some cases.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
9th October 2019, 18:36 | #3573 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
No and no. Also it could be a bug in the expression itself now that we've investigated it a bit...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
10th October 2019, 04:48 | #3574 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
about wrapping/decorating vapoursynth core functions:
Code:
import vapoursynth as vs from vapoursynth import core import functools clip = core.std.BlankClip(width=640, height=360, format=vs.YUV420P8) def CropAbs_extra(f): @functools.wraps(f) def wrapper(*args, **kwargs): print('some extra work') return f(*args, **kwargs) return wrapper #this does not work: #core.std.CropAbs = CropAbs_extra(core.std.CropAbs) #clip = core.std.CropAbs(clip, 360,240, 0,0) #to crop + some extra work #AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs' #this works but script lines would need to be rewritten: temp = CropAbs_extra(core.std.CropAbs) clip = temp(clip, 360,240, 0,0) #to crop + some extra work Is there any way to keep : clip = core.std.CropAbs(clip, 360,240, 0,0) and use a wrapper to it? Thanks. this does not work also: Code:
setattr(core.std, 'CropAbs', CropAbs_extra(core.std.CropAbs)) #AttributeError: 'vapoursynth.Plugin' object has no attribute 'CropAbs' Last edited by _Al_; 10th October 2019 at 05:38. |
10th October 2019, 22:34 | #3575 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
Code:
import vapoursynth as vs vs.get_core = function that returns fake core import other, stuff core = vs.get_core() ...
__________________
Buy me a "coffee" and/or hire me to write code! |
|
11th October 2019, 07:57 | #3576 | Link |
Registered User
Join Date: Jan 2016
Posts: 162
|
Agree with jackoneill, the cython part of VS prevents you from modifying attributes of "core" and its attribute "plugin". You should define your own "core" instead.
Last edited by WolframRhodium; 12th October 2019 at 15:35. |
11th October 2019, 16:44 | #3578 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
At the end of vapoursynth2.py I put:
Code:
print(core.version()) if hasattr(core, 'ffms2'): print('ffms2 is loaded') else: print('ffms2 is not loaded') clip = core.ffms2.Source(video.mp4) #clip = core.std.BlankClip(width=640, height=360)#BlankClip does not create VideoNode as well if isinstance(clip, vs.VideoNode): print('clip was created') else: print('clip is not vs.VideoNode') def CropAbs_extra(f): @functools.wraps(f) def wrapper(*args, **kwargs): print('working in wrapper') return f(*args, **kwargs) return wrapper print(clip) core.std.CropAbs = CropAbs_extra(core.std.CropAbs) clip = core.std.CropAbs(clip, 360,240,0,0) print(clip) Code:
VapourSynth Video Processing Library Copyright (c) 2012-2018 Fredrik Mellbin Core R45 API R3.5 Options: - ffms2 is loaded clip is not vs.videoNode <__main__._VideoNode object at 0x00000000037B2A58> But it does not throw any error trying to wrap that core.std.CropAbs function though, but also it is not in that wrapper. Anyway , it might take a while to grasp it all. Last edited by _Al_; 11th October 2019 at 16:47. |
12th October 2019, 01:44 | #3580 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
Thank you so much.
So far I got quickly this together: tinyvs.py: Code:
import vapoursynth as vs from vapoursynth import core as _vscore import functools class _Plugin: def __init__(self, namespace): self.__dict__.update((name, getattr(namespace, name)) for name in dir(namespace)) # func_name : func class _Core: def __init__(self): self.__dict__.update((name, get_plugin(name)) for name in dir(_vscore)) # (namespace : (func_name : func)) or (attr_name : attr) def get_plugin(name): attr = getattr(_vscore, name) if isinstance(attr, vs.Plugin): return _Plugin(attr) else: return attr core = _Core() def CropAbs_extra(f): @functools.wraps(f) def wrapper(*args, **kwargs): print('extra work with calling vs function') c= f(*args, **kwargs) return c return wrapper core.std.CropAbs = CropAbs_extra(core.std.CropAbs) Code:
import importlib import tinyvs importlib.reload(tinyvs) #mandatory reload so wrapper always works core = tinyvs.core clip = core.std.BlankClip(width=640, height=360) clip = core.std.CropAbs(clip, 360,240, 0,0) Code:
extra work with calling vs function Last edited by _Al_; 12th October 2019 at 01:46. |
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|