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 4th March 2017, 17:34   #2441  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,066
Quote:
The core resizer is pipelined, so combining multiple operations into one call avoids extra VS caches and memory copies.
Sounds like in an average script with multiple filters it probably doesn't really matter.

Quote:
In fact, restoration filters like deblock/dering should probably operate on the original image.
Don't think that color matrix changes should have an impact on deblocking/deringing filters, since it shouldn't change the macroblocks positioning like cropping would.
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 7th March 2017, 05:04   #2442  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,066
Small question when I have to clips (left, right) I want to StackHorizontal, how can I do something like this in Vapoursynth?
Code:
if(left.color_space != right.color_space){
 left = convertToColorspace(left, right.color_space);
}
Thanks!
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 7th March 2017, 05:24   #2443  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 716
Quote:
Originally Posted by Selur View Post
Small question when I have to clips (left, right) I want to StackHorizontal, how can I do something like this in Vapoursynth?
Code:
if(left.color_space != right.color_space){
 left = convertToColorspace(left, right.color_space);
}
Thanks!
Code:
left = core.resize.Spline36(left, format=right.format.id)
diff = core.std.StackHorizontal([left, right])
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 7th March 2017, 05:26   #2444  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,066
Thanks
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 8th March 2017, 19:51   #2445  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,188
R37 RC1

I just want to fix one final bug in avfs that causes random crashes for avisynth peasants before the final release. It's very safe to use since this time it's all bug fixes.

Changes:
Code:
fixed blankclip and addborders sometimes rejecting valid floating point color values (jackoneill)
vdecimate no longer stores the metrics for all frames, thus saving a lot of memory for long clips (jackoneill)
changed get_read* functions in python so their memory no longer incorrectly is writable (Kamekameha)
added rational number fps property to clips in python (Kamekameha)
mostly worked around an issue where python would replace the sigint handler
fixed bug that could sometimes cause false memory leak warnings when freeing core
fixed possible corruption on frames without subtitles in subtext (jackoneill)
added a proxy object to avoid referencing the wrong core in scripts (stuxcrystal)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th March 2017, 12:09   #2446  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 546
Just a thought.

Has anyone noted the nvidia-GPU accelerated filters for deinterlace / knlmeans / lsf over at DG's site ?

Reported phenomenal speeds as compared to equivalent cpu based filters.

http://rationalqm.us/board/viewtopic.php?f=8&t=506
http://rationalqm.us/board/viewtopic.php?f=8&t=558
hydra3333 is offline   Reply With Quote
Old 10th March 2017, 13:45   #2447  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 546
Per this post http://rationalqm.us/board/viewtopic...6&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:
Quote:
Avisynth Compat: requested frame xxx not prefetched, using slow method
and then this
Quote:
Core freed but 645120 bytes still allocated in framebuffers
A quick peek at this code https://github.com/vapoursynth/vapou...nth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.

I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds

Thanks.
hydra3333 is offline   Reply With Quote
Old 10th March 2017, 14:05   #2448  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,188
Quote:
Originally Posted by hydra3333 View Post
Per this post http://rationalqm.us/board/viewtopic...6&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:

and then this


A quick peek at this code https://github.com/vapoursynth/vapou...nth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.

I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds

Thanks.
I need the filter names and which frames they need as input to produce one frame of output. It's that simple.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 10th March 2017, 14:38   #2449  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 546
Quote:
Originally Posted by Myrsloik View Post
I need the filter names and which frames they need as input to produce one frame of output. It's that simple.
All good. Their names are DGDenoise and DGSharpen and they both use only the current frame. I suppose DGSource doesn't need mentioning.

Thanks !
hydra3333 is offline   Reply With Quote
Old 10th March 2017, 16:49   #2450  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 257
Quote:
Originally Posted by hydra3333 View Post
All good. Their names are DGDenoise and DGSharpen and they both use only the current frame.
I personally would not bother with a GPU denoiser only using the current frame.
Cary Knoop is offline   Reply With Quote
Old 12th March 2017, 00:29   #2451  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,095
Quote:
Originally Posted by hydra3333 View Post
Per this post http://rationalqm.us/board/viewtopic...6&p=6250#p6248 about the 2 new filters DGDenoise DGSharpen which use the GPU for seriously sped up filtering, I get now these messages all the time:

and then this


A quick peek at this code https://github.com/vapoursynth/vapou...nth_compat.cpp seems to suggest to an uninitiated person that it could be updated to take into account DGDenoise and DGSharpen ? If so could that please be done ? Or, advice on what else should be done.

I and presumably some others would like to benefit from gpu accelerated filters yielding eye-wateringly fast speeds

Thanks.
For the record, the "slow" method that you're getting warned about simply replicates what (single threaded) Avisynth does. Execution is completely serial and synchronous. Say that you request frame 3 from a temporal filter that requires one frame before the requested frame and one frame after the requested frame to produce output. With the slow (Avisynth) method, you call GetFrame(3), then the filter requests frame 2 from the upstream filter, waits for it to return, requests frame 3, waits for that to return, requests frame 4, waits for that to return, does its processing, and then returns a frame. The filter can tell Avisynth which frames would be useful to cache, but that's the extent of it. It's awful, but that's software from 2001 for you.

When VS loads Avisynth filters via the fake Avisynth environment, the filters that have been whitelisted (together with what frames they are expected to require to produce an output frame) are actually parallelized to a certain degree. Only one thread will call the filter's (Avisynth) GetFrame function at a time, so the actual processing is still single-threaded, but since VS knows in advance what frames the filter is going to request from the upstream filter if you request frame n, those frames are pre-fetched (in parallel, if the upstream filter supports it) before the filter's GetFrame(n) is ever called and any GetFrame requests from within the filter can return immediately. Even spatial only filters benefit (they still require one frame from the upstream filter, and that frame can be prefetched). Whitelisted filters also play nicer with parallelized downstream filters, since they can request many frames in parallel from the Avisynth filter wrapper, which then requests many frames in parallel from the upstream filters.

In other words: in single threaded, original Avisynth, only one filter can do work at a time. Every other filter spends all its time waiting for processing getting done somewhere else. When a single threaded Avisynth filter is used in VS, in an ideal world it can sit in its own thread and do processing as fast it can, never waiting on input (because the input is being processed in many other threads in parallel), while filters that do further processing on its output aren't bottlenecked on waiting for the Avisynth filter's input, and potentially not even on the Avisynth filter itself.

Last edited by TheFluff; 12th March 2017 at 03:33.
TheFluff is offline   Reply With Quote
Old 12th March 2017, 07:41   #2452  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,066
Small question: Is there something like Restore24 for Vapoursynth?
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 12th March 2017, 12:06   #2453  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,262
yes, there is srestore: https://forum.doom9.org/showthread.php?t=166582
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository
ChaosKing is offline   Reply With Quote
Old 15th March 2017, 10:21   #2454  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,336
@Myrsloik
is the global core allowed again from r37 and on?
is it ok to code the module like
Code:
import vapoursynth as vs
xxx = vs.core.yyy.xxx
def f(src):
    return xxx(src)
?
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 15th March 2017, 12:08   #2455  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,188
Quote:
Originally Posted by feisty2 View Post
@Myrsloik
is the global core allowed again from r37 and on?
is it ok to code the module like
Code:
import vapoursynth as vs
xxx = vs.core.yyy.xxx
def f(src):
    return xxx(src)
?
Sure is, that's completely equivalent from python's perspective. Why you want to prefix everything with 'vs.' is a mystery though...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th March 2017, 12:26   #2456  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,336
Quote:
Originally Posted by Myrsloik View Post
Sure is, that's completely equivalent from python's perspective. Why you want to prefix everything with 'vs.' is a mystery though...
I don't want to prefix everything with "vs", but I simply can't go with the
Code:
from vapoursynth import core
way cuz I need other stuff like "vs.VideoNode" or "vs.GRAY" and things like that..
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 15th March 2017, 12:38   #2457  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 309
Yeah, I also found the same problem, I could not pass stuff like "vs.YUV444P16" or whatever to these functions, I think it's not convenient at all. Also its bad practice in python to do imports inside functions.
Are_ is offline   Reply With Quote
Old 15th March 2017, 12:47   #2458  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,336
Quote:
Originally Posted by Are_ View Post
Also its bad practice in python to do imports inside functions.
you should import the core with a global import statement, not within functions
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 15th March 2017, 13:03   #2459  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 309
Mmmh... OK, I saw it somewhere used like that and I was thinking this was the new way of doing it.
Are_ is offline   Reply With Quote
Old 15th March 2017, 13:18   #2460  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Providence, RI
Posts: 2,336
@Myrsloik
I think the global core is not working as expected in modules
so a test script like
Code:
from vapoursynth import core

BlankClip = core.std.BlankClip

def GenBlank(src):
    return BlankClip(src)
    
ref = BlankClip()
clp = GenBlank(ref)
clp.set_output()
works without any problem, but if I separate it into a test module and a script like
Code:
#blah.py
from vapoursynth import core

BlankClip = core.std.BlankClip

def GenBlank(src):
    return BlankClip(src)
Code:
#test script
from vapoursynth import core
import blah

BlankClip = core.std.BlankClip

ref = BlankClip()
clp = blah.GenBlank(ref)
clp.set_output()
I get the following error:
Quote:
Failed to evaluate the script:
Python exception: BlankClip: nodes foreign to this core passed as input, improper api usage detected

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1821, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36464)
File "", line 7, in <module>
File "C:\Program Files\Python36\lib\site-packages\blah.py", line 6, in GenBlank
return BlankClip(src)
File "src\cython\vapoursynth.pyx", line 1713, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:34604)
vapoursynth.Error: BlankClip: nodes foreign to this core passed as input, improper api usage detected
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   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 10:23.


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