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. |
30th June 2013, 05:20 | #821 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
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?' >>>
__________________
my repositories |
30th June 2013, 11:37 | #822 | 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 |
|
30th June 2013, 16:01 | #823 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
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 |
30th June 2013, 18:07 | #825 | Link |
Registered User
Join Date: Dec 2011
Posts: 192
|
Updated list of head-scratchers:
|
30th June 2013, 18:22 | #826 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
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 |
|
30th June 2013, 20:02 | #827 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
BTW, where did this feature go?
Quote:
__________________
my repositories |
|
30th June 2013, 20:03 | #828 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
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. |
30th June 2013, 21:45 | #829 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
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 |
1st July 2013, 10:13 | #830 | 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 |
|
3rd July 2013, 16:23 | #832 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
Quote:
Code:
#vsshow.py import vapoursynth as vs from ctypes import * from PIL import Image def show(core, clip, frame_number, vflip=1): format = clip.format.id width = clip.width height = clip.height if format == vs.GRAY16: clip = core.resize.Point(clip, width, height, vs.GRAY8) if format != vs.GRAY8 and format != vs.RGB24: clip = core.resize.Bicubic(clip, width, height, vs.COMPATBGR32) format = clip.format.id planes = range(clip.format.num_planes) frame = clip.get_frame(frame_number) data = [(frame.get_read_ptr(p), frame.get_stride(p)) for p in planes] buff = [b'\0' * data[p][1] * height for p in planes] for p in planes: memmove(buff[p], data[p][0], data[p][1] * height) if format == vs.COMPATBGR32: mode, src = 'RGBA', 'BGRA' else: mode, src = 'L', 'L' img = [Image.frombytes(mode, (width, height), buff[p], 'raw', src, data[p][1], vflip) for p in planes] if len(planes) != 1: img = Image.merge('RGB', (img[2], img[0], img[1])) else: img = img[0] img.show()
__________________
my repositories |
|
4th July 2013, 13:43 | #833 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
@Myrsloyk
Would you add a function like avisynth's "Import" for VSScript? It is annoy that the code for preparing a buffer, opening and reading a file and closing it must be written each time.
__________________
my repositories |
5th July 2013, 12:27 | #834 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
Anyway, Zor finally updated the build system and ported VapourSynth to powerpc and arm. Have fun testing it on your ancient mac or something.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
5th July 2013, 13:33 | #835 | Link |
Registered User
Join Date: Dec 2011
Posts: 192
|
AviSynth's Import does a pair of extra things besides opening and evaluating the file:
|
5th July 2013, 14:16 | #837 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
Quote:
Code:
if (vseval_new_function(&se, source)) { env->ThrowError("VapourSource: failed to evaluate script.\n%s", vseval_getError(se)); }
__________________
my repositories Last edited by Chikuzen; 5th July 2013 at 14:21. |
|
5th July 2013, 14:48 | #838 | Link | |
Registered User
Join Date: Dec 2011
Posts: 192
|
Quote:
On second thought adding that functionality to vseval_evaluateScript may be a bad idea and doesn't solve the general problem: import might do things besides opening and evaluating the script (not necessarily limited to what AviSynth currently does), and someone using evaluate (because there's not file) would have to check the code and implement it themselves. Then the best would be adding to the API something like ImportFile and ImportBuffer instead of a single import. |
|
5th July 2013, 15:56 | #840 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
I guess I'll add two new functions, vseval_importFile(&se, filename) and vseval_importBuffer(&se, scriptBuffer, imaginaryFilename) to do the things you mentioned.
I still want to keep the original function as well in case someone wants to have a different behavior.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|