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. |
10th November 2020, 20:10 | #4101 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
No, trivial to query so I didn't see any real need. Also they can't be properly serialized into a single int.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
10th November 2020, 20:39 | #4102 | 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 |
|
16th November 2020, 20:06 | #4103 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
how do I obtain the return value of the function that is passed to createFunc() in python?
Code:
// C++ code, inside getFrame() auto f = [](auto in, auto out, auto, auto, auto) { vsapi->propSetFloat(out, "val", 2.71, VSPropAppendMode::paReplace); vsapi->logMessage(VSMessageType::mtWarning, "aaaaaaa"); }; auto fp = Function{ vsapi->createFunc(f, nullptr, [](auto) {}, core, vsapi) }; ProcessedFrame["test"] = fp; #Python script clip = core.test.Test(clip) x = clip.get_frame(0).props['test']() # prints "aaaaaaa" as expected, however x is of type None rather than float |
16th November 2020, 22:32 | #4104 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
it seems the problem is caused by Func.__call__() discarding its return value: https://github.com/vapoursynth/vapou...synth.pyx#L636
this "ret" thing, after receiving whatever stored in the out map, was never returned by __call__ and was simply discarded. is this a bug? |
19th November 2020, 11:53 | #4106 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Correct
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
19th November 2020, 12:02 | #4107 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
what's the use of removeMessageHandler()? it seems I can remove the current handler by simply passing a NULL handler to addMessageHandler()?
who owns the char pointer that the handler receives? is it the same pointer passed to logMessage() or a pointer to some internal deep copy of what's passed to logMessage()? |
19th November 2020, 12:34 | #4108 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
you then remove the handler by passing the handle from addMessageHandler() to removeMessageHandler() Ownership is also optional since all handlers obviously will be removed automatically when a core is destroyed. Calling removeMessageHandler() with an invalid/already freed handle is safe and does nothing.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
19th November 2020, 12:49 | #4110 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
Filler here
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
21st November 2020, 20:10 | #4111 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I can't decide which is the correct design for message handlers.
should I bind the lifetime of a message handler to its descriptor, like a file descriptor? Code:
auto md = Core.AddMessageHandler([](auto...) {}); // md is a stateful object // automatically calls removeMessageHandler() in md's destructor when it goes out of scope Code:
auto md = Core.AddMessageHandler([](auto...) {}); // md is a stateless integer ID / pointer Core.Eject(md); // explicitly ejects the handler when no longer needed. |
22nd November 2020, 11:48 | #4112 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
does getFrameAsync() have any special behavior (creating new threads, etc.)?
it seems the same asynchronous behavior could be achieved by simply calling getFrame() with std::async? Code:
auto f = std::async(std::launch::async, [&] { return vsapi->getFrame(n, node, nullptr, 0); }); ... // do something else while waiting for f auto frame = f.get(); // block the current thread and retrieve the frame when needed |
22nd November 2020, 20:49 | #4113 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
I use a jpeg as source:
Code:
General Complete name : c:\Users\Selur\Desktop\test.jpg Format : JPEG File size : 465 KiB Image Format : JPEG Width : 1 280 pixels Height : 534 pixels Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Compression mode : Lossy Stream size : 465 KiB (100%) Code:
clip = core.imwri.Read(["C:/Users/Selur/Desktop/test.jpg"]) clip = core.std.Loop(clip=clip, times=100) Does ImageMagick Writer-Reader (http://www.vapoursynth.com/doc/plugins/imwri.html) always return RGB or am I missing something? In case it always returns RGB, it would be nice if this could be added to the documentation. Cu Selur |
23rd November 2020, 10:36 | #4114 | 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 |
|
23rd November 2020, 11:46 | #4115 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
some elaboration on the issue mention at #4187 would be nice...
it's hard to determine the design of the async interface without knowing the technical details of the C API. also it's a lot harder to convert a callback kind of stuff to std::future which involves locks, condition variable and other unnecessary complexity. |
23rd November 2020, 12:44 | #4116 | 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 |
|
28th November 2020, 18:53 | #4120 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Is there an "autowhite" filter which is more clever than the example over at http://www.vapoursynth.com/doc/functions/frameeval.html ?
|
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|