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 25th August 2011, 10:43   #1  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Vapoursynth

Website:
http://www.vapoursynth.com/
VapourSynth ChangeLog
Documentation
List of all known plugins and scripts
VapourSynth Editor
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 23rd August 2016 at 17:02. Reason: New version
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 05:26   #2  |  Link
CarlPig
Registered User
 
Join Date: Aug 2012
Posts: 74
I can't get it to work.

CarlPig is offline   Reply With Quote
Old 9th September 2012, 06:51   #3  |  Link
06_taro
soy sauce buyer
 
Join Date: Mar 2010
Location: United Kingdom
Posts: 164
python is case sensitive, the function is "Core()", not "core()"
06_taro is offline   Reply With Quote
Old 9th September 2012, 07:27   #4  |  Link
Yoshiyuki Blade
Novice x264 User
 
Yoshiyuki Blade's Avatar
 
Join Date: Dec 2006
Location: California
Posts: 170
That's further than what I got. I can't even get past the first line (says specified module no found) ! This is kind of frustrating because the instructions really are straightforward and easy to follow. Everything is (presumably) at default settings too.
__________________
"I'll take a potato chip... and eat it!"
Yoshiyuki Blade is offline   Reply With Quote
Old 9th September 2012, 07:32   #5  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Awesome project. Finally, something that can completely replace avisynth one day.

I played around with it and wrote a simple (buggy, ugly etc.) wrapper to provide more avisynth-like syntax (chaining support, positional arguments, case insensitivity): http://privatepaste.com/0b53562cdb
While it definitely shouldn't be used for anything real in its current state, I hope it shows that vapoursynth could benefit from better API.

Thoughts:
1. list_functions() should return a string and not output it to stdout by itself. IMHO, this is just wrong (see _rebuild_functions_cache function).
2. There should be a list_functions() analog, that would return the same data in dictionary/list/whatever form. I'm pretty sure you have one internally. Possible use case: editors, wrappers.
3. Chaining support, or you can call it 'fluent interface'. Just because it makes things so much easier.
4. Positional argument. I'm not sure why you like it verbose while most programming languages use this kind of args without any problems. Some don't even support named arguments.
5. Case-insensitivity should be added. Or at least lowercase bindings for all functions. Good editor could help, sure, but right now it takes me ages to type FFVideoSource correctly.
6. Some list_functions() analog for core functions. Because your (cython?) objects don't support __dict__, inspect.getargspec and other reflection methods. This can be solved with good documentation too.

I'm not very good with python and I'm pretty sure that some of these questions can be solved by a simple correct wrapper without your help. Having all this in core API would be nice though.

Also, optional parameters don't seem to work right now. And CropAbs accepts negative width/height but then outputs garbage. IMHO it should behave like avisynth's crop function.

Last edited by TurboPascal7; 9th September 2012 at 07:39.
TurboPascal7 is offline   Reply With Quote
Old 9th September 2012, 11:40   #6  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by TurboPascal7 View Post
Awesome project. Finally, something that can completely replace avisynth one day.

I played around with it and wrote a simple (buggy, ugly etc.) wrapper to provide more avisynth-like syntax (chaining support, positional arguments, case insensitivity): http://privatepaste.com/0b53562cdb
While it definitely shouldn't be used for anything real in its current state, I hope it shows that vapoursynth could benefit from better API.

Thoughts:
1. list_functions() should return a string and not output it to stdout by itself. IMHO, this is just wrong (see _rebuild_functions_cache function).
2. There should be a list_functions() analog, that would return the same data in dictionary/list/whatever form. I'm pretty sure you have one internally. Possible use case: editors, wrappers.
3. Chaining support, or you can call it 'fluent interface'. Just because it makes things so much easier.
4. Positional argument. I'm not sure why you like it verbose while most programming languages use this kind of args without any problems. Some don't even support named arguments.
5. Case-insensitivity should be added. Or at least lowercase bindings for all functions. Good editor could help, sure, but right now it takes me ages to type FFVideoSource correctly.
6. Some list_functions() analog for core functions. Because your (cython?) objects don't support __dict__, inspect.getargspec and other reflection methods. This can be solved with good documentation too.

I'm not very good with python and I'm pretty sure that some of these questions can be solved by a simple correct wrapper without your help. Having all this in core API would be nice though.

Also, optional parameters don't seem to work right now. And CropAbs accepts negative width/height but then outputs garbage. IMHO it should behave like avisynth's crop function.
1. will be changed for the next version
2. will probably happen some day
3. suggest a way to implement it that's not completely unpythonian and I'll consider it
4. some day
5. I will not add case insensitive stuff to a case sensitive language. Maybe some day I'll make lowercase versions acceptable too.
6. It's already included in list_functions(), why do you need one more?

I think I've fixed the crop argument checks. Can you give an example of the optional arguments maybe not working?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 12:10   #7  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Quote:
Originally Posted by Myrsloik View Post
I think I've fixed the crop argument checks. Can you give an example of the optional arguments maybe not working?
Code:
Traceback (most recent call last):
  File "D:/test.py", line 21, in <module>
    source = w.std.CropAbs(clip=source, x=16, y=16)
  File "vapoursynth.pyx", line 434, in vapoursynth.Function.__call__ (cython\vapoursynth.c:7371)
vapoursynth.Error: 'CropAbs: argument width is required'
Code:
source = w.std.CropAbs(clip=source, x=16, y=16, width=-16, height=-16)
Works but outputs garbage. Should throw error or work like avisynth's crop (subtracting provided negative width/height values from clip's parameters).

Quote:
Originally Posted by Myrsloik View Post
6. It's already included in list_functions(), why do you need one more?
I don't really need another list_functions() method. I do want to know Core class constructor parameters, VideoNode.output() method parameters (wanted to test callback, added in r4) etc. Without documentation and any public API I don't see any ways to do it since reflection doesn't work well with cython. I'm asking for this too early, I guess.
TurboPascal7 is offline   Reply With Quote
Old 9th September 2012, 12:20   #8  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by TurboPascal7 View Post
Code:
Traceback (most recent call last):
  File "D:/test.py", line 21, in <module>
    source = w.std.CropAbs(clip=source, x=16, y=16)
  File "vapoursynth.pyx", line 434, in vapoursynth.Function.__call__ (cython\vapoursynth.c:7371)
vapoursynth.Error: 'CropAbs: argument width is required'
Of course width is required, this only moves the upper left point.
Quote:
Originally Posted by TurboPascal7 View Post
Code:
source = w.std.CropAbs(clip=source, x=16, y=16, width=-16, height=-16)
Works but outputs garbage. Should throw error or work like avisynth's crop (subtracting provided negative width/height values from clip's parameters).
fixed
Quote:
Originally Posted by TurboPascal7 View Post

I don't really need another list_functions() method. I do want to know Core class constructor parameters, VideoNode.output() method parameters (wanted to test callback, added in r4) etc. Without documentation and any public API I don't see any ways to do it since reflection doesn't work well with cython. I'm asking for this too early, I guess.
Core constructor: def __cinit__(self, flatten = True, addcache = True, int threads = 0)

Not much of interest, really. Flatten is whether or not single return value functions get the returned dict flattened to a single value automatically. addcache controls automatic cache insertion.

Output declaration:
def output(self, object fileobj not None, bint y4m = False, int lookahead = 10, object progress_update = None):

Where lookahead is the number of frame requests it has going at once to keep throughput up and progress_update is a functions that could looks like this:
def print_frame(n, total):
print('Frame: %d/%d' % (n, total))
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 10:34   #9  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 769
So what are the long-term plans for this? To be able to do everything Avisynth can do, but better*?

*Working multi-threading, arbitrary bit-depths and color spaces.
ajp_anton is offline   Reply With Quote
Old 9th September 2012, 10:35   #10  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by ajp_anton View Post
So what are the long-term plans for this? To be able to do everything Avisynth can do, but better*?

*Working multi-threading, arbitrary bit-depths and color spaces.
To crush all who stand against me! *muahaha*
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 11:35   #11  |  Link
active1
Registered User
 
Join Date: Nov 2011
Location: spain
Posts: 45
hi, i can't make CPU Usage = 99% when i use one filter
the CPU Usage is 25% all the time, but when i use the filter x4, the CPU Usage become 99%
but in avisynth MT the CPU Usage is 99% all the time
what is the problem ?? (or is it a problem ??)
active1 is offline   Reply With Quote
Old 9th September 2012, 11:51   #12  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by active1 View Post
hi, i can't make CPU Usage = 99% when i use one filter
the CPU Usage is 25% all the time, but when i use the filter x4, the CPU Usage become 99%
but in avisynth MT the CPU Usage is 99% all the time
what is the problem ?? (or is it a problem ??)
It is how my threading model works. Avisynth filters are for compatibility reasons limited so one instance may run on one core at one time. Avisynth-mt gets around this by creating multiple instances (one per thread), OR by making very unsafe assumptions.
Newly written and ported filters for the vs api can if done correctly handle multiple frames at once. See the included Lut/Lut2 function.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 12:03   #13  |  Link
active1
Registered User
 
Join Date: Nov 2011
Location: spain
Posts: 45
Quote:
Originally Posted by Myrsloik View Post
It is how my threading model works. Avisynth filters are for compatibility reasons limited so one instance may run on one core at one time. Avisynth-mt gets around this by creating multiple instances (one per thread), OR by making very unsafe assumptions.
Newly written and ported filters for the vs api can if done correctly handle multiple frames at once. See the included Lut/Lut2 function.
so there is a chance to make it even better than Avisynth MT in speed wise? (with only one filter)
active1 is offline   Reply With Quote
Old 9th September 2012, 12:13   #14  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by active1 View Post
so there is a chance to make it even better than Avisynth MT in speed wise? (with only one filter)
Not without porting filters, no. I'm not going to make another avisynth-mt mess. I intend to win people over in the end by being faster and more stable for most users.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 14:02   #15  |  Link
active1
Registered User
 
Join Date: Nov 2011
Location: spain
Posts: 45
Quote:
Originally Posted by Myrsloik View Post
Not without porting filters, no. I'm not going to make another avisynth-mt mess. I intend to win people over in the end by being faster and more stable for most users.
that's good too, i hope that we will not need to load any filter from avisynth someday.

i have a problem with ColorMatrix:

every filter above work very well, except ColorMatrix
is it not supported yet?
active1 is offline   Reply With Quote
Old 9th September 2012, 21:20   #16  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
I released R5. Changes in the first post. If this one turns out well I'll start experimenting with other platforms.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 10th September 2012, 00:00   #17  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,043
Quote:
Originally Posted by active1 View Post
that's good too, i hope that we will not need to load any filter from avisynth someday.

i have a problem with ColorMatrix:
every filter above work very well, except ColorMatrix
is it not supported yet?
It's not supported yet. Vapoursynth doesn't have equivalents for all of the internal Avisynth functions yet, so filters like ColorMatrix that invoke internal Avisynth filters will break if the invoked function doesn't exist in Vapoursynth.
TheFluff is offline   Reply With Quote
Old 9th September 2012, 21:22   #18  |  Link
TheProfileth
Leader of Dual-Duality
 
TheProfileth's Avatar
 
Join Date: Aug 2010
Location: America
Posts: 134
Quote:
r5:
more python output fixes
added accept_lowercase as a setting for the core constructor
python module refinement, now all objects have a string representation with more information
other minor fixes
Does this mean you can do things with all lowercase now?
__________________
I'm Mr.Fixit and I feel good, fixin all the sources in the neighborhood
My New filter is in the works, and will be out soon
TheProfileth is offline   Reply With Quote
Old 9th September 2012, 21:23   #19  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,866
Quote:
Originally Posted by TheProfileth View Post
Does this mean you can do things with all lowercase now?
Yes, I added it as an experiment and it's off by default. It may disappear again if I don't like it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 21:24   #20  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 205
this is great, let it be :-)
also, is there a way yet to create arbitrary clips like in avisynth's ScriptClip? The only way I see now is to loop through all frames and then core.std.splice individual frames after some processing which seems to defy the idea of lazy calculation in a ScriptClip.

Last edited by wOxxOm; 9th September 2012 at 21:35.
wOxxOm 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 11:53.


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