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 27th June 2013, 15:37   #821  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
What does wine have to do with linux?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th June 2013, 15:49   #822  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 452
then howto build vspipe? no need wine sources (to build on linux to linux)?

Last edited by sl1pkn07; 27th June 2013 at 16:05.
sl1pkn07 is offline   Reply With Quote
Old 27th June 2013, 16:22   #823  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 705
Quote:
Originally Posted by sl1pkn07 View Post
then howto build vspipe? no need wine sources (to build on linux to linux)?
No, you don't need wine for that.

Code:
clang++ -Wall -Wextra -Wno-unused-parameter -o libvsscript.so -shared -fPIC vsscript.cpp -I../../include -I../../build/temp.linux-x86_64-3.3/pyrex/ `pkg-config --cflags python3` `pkg-config --libs python3 vapoursynth`
and then
Code:
clang++ -Wall -Wextra -Wno-unused-parameter -o vspipe -fPIC vspipe.cpp -I../../include `pkg-config --cflags QtCore` -L../vsscript/ -lvsscript `pkg-config --libs QtCore`
Something like that. You can guess in what folders to run those.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 27th June 2013, 16:32   #824  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 452
thanks jackoneill

EDIT: none, don't see the last commit

greetings

Last edited by sl1pkn07; 27th June 2013 at 22:18.
sl1pkn07 is offline   Reply With Quote
Old 29th June 2013, 14:07   #825  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 193
Some issues of varying importance:
  • VfW: Reloading a script (e.g. F2 on VirtualDub) that loads any plugin will throw an exception 'XXX already loaded' (new in r19).

  • AddBorders: if the 'color' parameter is not given, a random color different each time is applied instead of [0, 0, 0] (AddBordersData's color is not initialized).

  • Calling VapourSynth from Python may crash

    Not sure if this can be called a VapourSynth bug, but anyway: trying to use vsscript.dll (with ctypes) or evaluate the Avisynth script 'AviSource("script.vpy")' from Python may cause the process to crash at Py_Initialize depending on the environment. It seems that sys.path is populated at the Py_Initialize call from the caller's directories, not from Python 3.3.

    Example of crash (Python 2):
    Code:
    import ctypes
    ctypes.windll.vsscript.vseval_init()
    I haven't managed to fully make clear this, but here are some notes:

    • If the Python application is wrapped with py2exe or similar all works as expected.
    • If not, the crash happens even if the environment variables PYTHONHOME and PYTHONPATH are not set.
    • If then PYTHONHOME is set pointing to the Python 3.3's directory, it works OK. I guess the same thing would happen if Py_SetProgramName is called before Py_Initialize.

    If there's not a clean way of solving this then don't bother. I found the issue playing around without a defined purpose with the new vsscript API. If I or someone else adds VS support to AvsPmod it'll probably be by porting it to Python 3 (which is not possible yet) and using the included bindings instead.

Last edited by vdcrim; 29th June 2013 at 15:18. Reason: typo
vdcrim is offline   Reply With Quote
Old 29th June 2013, 15:23   #826  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Interesting lump of bugs. I guess I'll rework the singleton thing a bit to avoid the issues.

The loading vsscript in python one will be an interesting one to try to figure out. Is this only when the python versions of vs and the loading script are different?

I suspect it's python that doesn't handle two different versions being loaded in the same process well. Exactly what did you wrap with py2exe?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th June 2013, 15:33   #827  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
from VSScript.h
Code:
// Initialize the available scripting runtimes, returns non-zero on failure
VS_API(int) vseval_init(void);
I wasted my time about 30 minutes by this typo
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 29th June 2013, 15:35   #828  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Huh? I though i wrote the code to work like the comment says. Guess I'll check it when i get home.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th June 2013, 16:12   #829  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 193
Quote:
Originally Posted by Myrsloik View Post
The loading vsscript in python one will be an interesting one to try to figure out. Is this only when the python versions of vs and the loading script are different?
Now that I try it with Python 3.3, it throws an 'OSError: exception: access violation reading 0x00000008', so sys.path is not the only problem.

If the script is called with Python 2.7 vsscript tries to load the Python resources from it:
Code:
Fatal Python error: Py_Initialize: unable to load the file system codec      
  File "C:\Program Files (x86)\Python27\lib\encodings\__init__.py", line 123 
    raise CodecRegistryError,\                                               
                            ^                                                
SyntaxError: invalid syntax
Here's the incomplete bindings I wrote for playing around, in case it may be useful: https://gist.github.com/vdcrim/5891445

Quote:
I suspect it's python that doesn't handle two different versions being loaded in the same process well. Exactly what did you wrap with py2exe?
AvsPmod, either by adding the ctypes code to the application or as a macro script.

Also note that it also fails with 'AviSource("script.vpy")': if not using a py2exe build, it will crash.

Quote:
Originally Posted by Myrsloik View Post
Huh? I though i wrote the code to work like the comment says. Guess I'll check it when i get home.
I can confirm that Chikuzen is right.
vdcrim is offline   Reply With Quote
Old 29th June 2013, 23:09   #830  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Have another test version.

It fixes everything reported apart from the odd python in python issue. I could really use some help with that one...

Changes: vseval_getCore(handle) <- now needs a script handle as argument
I also changed it so every script environment gets its own core which fixes a lot.
I simply changed the comment for vseval_init() to match current behavior
The color in addborders is now zero initialized.

Report anything else you find, I want this to be a working release once it's done.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th June 2013, 23:15   #831  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 452
stop build vspipe

http://sl1pkn07.no-ip.com/paste/view/0d18ac60

greetings
sl1pkn07 is offline   Reply With Quote
Old 30th June 2013, 05:20   #832  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Code:
>>> import vapoursynth as vs
>>> core = vs.get_core()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "vapoursynth.pyx", line 777, in vapoursynth.get_core (src\cython\vapoursy
nth.c:12897)
vapoursynth.Error: 'Internal environment id not set. Was get_core() called from
a filter callback?'
>>>
what's 'Internal environment id' ?
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 30th June 2013, 11:37   #833  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Quote:
Originally Posted by Chikuzen View Post
Code:
>>> import vapoursynth as vs
>>> core = vs.get_core()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "vapoursynth.pyx", line 777, in vapoursynth.get_core (src\cython\vapoursy
nth.c:12897)
vapoursynth.Error: 'Internal environment id not set. Was get_core() called from
a filter callback?'
>>>
what's 'Internal environment id' ?
I forgot that scripts could also be called from outside of vsscript. I'll post a third test version a bit later today.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th June 2013, 16:01   #834  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Here's a third test.

Changes:
Possibly fixed the "python in python" crash, now it at least gets past vseval_init() on my computer (seemed to be caused by differences in GIL state)
Fixed the error that happend when not running scripts through vsscript
VSScript tells python to no install its signal handlers when loaded
Fixed the fps printed in vspipe's info
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th June 2013, 18:03   #835  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 287
Myrsloik: What are the advantages of running a native compiled vapoursynth plugin versus loading a plugin with core.avisynth.LoadPlugin() ?
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 30th June 2013, 18:07   #836  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 193
Updated list of head-scratchers:
  • The sys.path thing (for both vsscript and VfW). Other result of this (because is fixed by setting PYTHONHOME): if vsscript is called from Python 3.2 it crashes at vseval_evaluateScript.
  • Issues if vsscript is called from (and only from) Python 3.3: the OSError exception at vseval_init is fixed in test3, vseval_evaluateScript also passes (the gist linked a bit above is now Python 3 compatible) but the process gets stuck at vseval_finalize.
vdcrim is offline   Reply With Quote
Old 30th June 2013, 18:22   #837  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Quote:
Originally Posted by mastrboy View Post
Myrsloik: What are the advantages of running a native compiled vapoursynth plugin versus loading a plugin with core.avisynth.LoadPlugin() ?
If you don't need any features beyond what avisynth 2.5 offers and the plugin can't be easily changed to a better threading model (rare), nothing.

The key here is that x64 builds for windows are coming in a bit and then old avisynth stuff just won't work. (and don't think avisynth x64 plugins is the answer, since they're usually "delete key" ports and run slower than the 32-bit equivalents)

A properly written vs plugin also has the advantage of being compiled/used on any OS. I think of this as a new start where I and some other people slowly port/rewrite the most popular parts of avisynth's filters so they finally work in a modern environment everywhere...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th June 2013, 20:02   #838  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
BTW, where did this feature go?
Quote:
list_functions() renamed to get_plugins() for the core and get_functions() for namespaces,
it also returns a dict instead of a string now
new list_functions() is hard to use.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 30th June 2013, 20:03   #839  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Quote:
Originally Posted by Chikuzen View Post
BTW, where did this feature go?

new list_functions() is hard to use.
Hard to use in what way? What do you want changed? Should I restore the old list_functions() too for an easier to read format?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 30th June 2013 at 20:05.
Myrsloik is offline   Reply With Quote
Old 30th June 2013, 21:45   #840  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
Have a fourth test version.

This version restores list_functions(). get_functions()/get_plugins() is available to get dicts which are easier to deal with if programs want to enumerate everything.
It also fixes the "python in python" issue for python 3.3 and kinda other versions (insert huge asterisk here about vseval_finalize() hanging).

Keep testing. At this rate this will actually be a fairly stable release.
__________________
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 00:10.


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