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 September 2012, 06:32   #61  |  Link
active1
Registered User
 
Join Date: Nov 2011
Location: spain
Posts: 45
will be there any script editor like AvsP(mod) to view source, editing, etc ?
active1 is offline   Reply With Quote
Old 8th September 2012, 08:59   #62  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
There are examples of implementing a case-insensitive dictionary which might work for method names as well if I am not mistaken (here and there):
Code:
class CaseInsensitiveDict(dict):
    def __setitem__(self, key, value):
        super(CaseInsensitiveDict, self).__setitem__(key.lower(), value)

    def __getitem__(self, key):
        return super(CaseInsensitiveDict, self).__getitem__(key.lower())
Other methods should also be redefined in this fashion if being used, like 'contains', 'has_key', etc.

It looks quite easy to incorporate into vapoursynth's avs class, probably even as an optional parameter 'casesens' in vapoursynth.Core() method which would instantiate avs class or avsCaseInsensitive, yet I don't know if and how I can override the avs class from inside my code...

Last edited by wOxxOm; 8th September 2012 at 09:05.
wOxxOm is offline   Reply With Quote
Old 8th September 2012, 10:11   #63  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
Quote:
Originally Posted by wOxxOm View Post
There are examples of implementing a case-insensitive dictionary which might work for method names as well if I am not mistaken (here and there):
Code:
class CaseInsensitiveDict(dict):
    def __setitem__(self, key, value):
        super(CaseInsensitiveDict, self).__setitem__(key.lower(), value)

    def __getitem__(self, key):
        return super(CaseInsensitiveDict, self).__getitem__(key.lower())
Other methods should also be redefined in this fashion if being used, like 'contains', 'has_key', etc.

It looks quite easy to incorporate into vapoursynth's avs class, probably even as an optional parameter 'casesens' in vapoursynth.Core() method which would instantiate avs class or avsCaseInsensitive, yet I don't know if and how I can override the avs class from inside my code...
I suppose I could allow lower case versions too since it's at least in the spirit of python. The uppercasing has bothered me too since python prefers_this_style. Maybe I'll just change the bindings to do everything as lower case.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th September 2012, 11:14   #64  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
Quote:
Originally Posted by wOxxOm View Post
  1. What are 'format' and 'yuvrange' and is it possible to mimick spline16/36/64resize with Spline(clip:clip;width:intpt;height:intpt;format:intpt;yuvrange:intpt ?
  2. Is it possible to specify float numbers for the area to be resized like in avisynth's resize filters which have cropXXXX parameters?
  3. What is the syntax of 'Lut' and 'Lut2' functions?
  4. Is it possible to implement positional parameters so that instead of Spline(c1=myvideonode,width=1280,height=720) it'd be spline(myvideonode,1280,720) ?
  5. It would be nice to have a callback in 'output' function with current frame number and coded frame size so that it could be used in a custom gui for progress reporting
1. yuvrange isn't implemented yet in the filter, I'll add it so it works as good/bad as swscale in libav does. I'll go and ask how much is implemented now, last time I looked it was only half done. I have no idea about replicating the avisynth spline functions. Tell me if it looks similar to any of them.
2. Not sure if swscale implements it, will go ask the developers because I'm curious too.
3. For Lut the lut argument is a list of 2^(video bits per sample) ints. So for normal video it simply is the 256 values in the lut you've calculated by yourself. Lut2 is similar except that it's Lut2(clips=[clip1, clip2], lut=[2^(usually 16) ints])
You can also add planes=[1, 2] (or similar) if you only want it to work on uv in yuv.
4. I like it verbose, maybe some day I'll relax the requirement but I see it as a good way of keeping scripts readable.
5. It shall be added
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th September 2012, 14:39   #65  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
There are two threads going on Vapoursynth in Avisynth Develoment now. Is there any reason not to merge them?
Guest is offline   Reply With Quote
Old 8th September 2012, 15:02   #66  |  Link
JEEB
もこたんインしたお!
 
JEEB's Avatar
 
Join Date: Jan 2008
Location: Finland / Japan
Posts: 512
Quote:
Originally Posted by neuron2 View Post
There are two threads going on Vapoursynth in Avisynth Develoment now. Is there any reason not to merge them?
I'm not Myrs, but the "Vapoursynth" thread might as well be merged here, that way there'd be only one thread + Myrs can update the top post.
__________________
[I'm human, no debug]
JEEB is offline   Reply With Quote
Old 8th September 2012, 19:58   #67  |  Link
TheProfileth
Leader of Dual-Duality
 
TheProfileth's Avatar
 
Join Date: Aug 2010
Location: America
Posts: 134
Yes, I agree they should be merged also.
__________________
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 8th September 2012, 20:19   #68  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
The users have spoken. Make it so.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 8th September 2012, 23:18   #69  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I have waved my magic wand and made it so.

Now you try to figure out how I gave you a first thread post like I did, which you can fill in as needed.
Guest is offline   Reply With Quote
Old 9th September 2012, 01:03   #70  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
R4 posted at the website. It should fix the corrupt frame output and some other stuff too.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th September 2012, 02:53   #71  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
ffms2-r712.7z

As seen in the ffmpegsource thread, contains vapoursynth support.
TheRyuu is offline   Reply With Quote
Old 9th September 2012, 05:26   #72  |  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   #73  |  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   #74  |  Link
Yoshiyuki Blade
Novice x264 User
 
Yoshiyuki Blade's Avatar
 
Join Date: Dec 2006
Location: California
Posts: 169
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   #75  |  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, 10:34   #76  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 807
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   #77  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
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   #78  |  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:40   #79  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
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, 11:51   #80  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
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
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 21:37.


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