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. |
24th October 2020, 01:07 | #4081 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
It does not work. I guess frame number in must be total out, its how it works.
Or maybe is there a way how to manipulate that n using lambda somehow? Code:
clip2 = clip.std.FrameEval(lambda n: deint(n, clip=clip)) |
26th October 2020, 04:13 | #4082 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
Just tried it again, yes it works with that placeholder with doubled fps and doubled lenght,
not sure what went wrong yesterday, it seams to return clip correctly from FrameEval(). It works with both, partial and lambda function as well. |
26th October 2020, 13:35 | #4084 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Nope, still supported. It's when the format is pfNone (0).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
27th October 2020, 19:23 | #4086 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
also, the documentation on calling python functions is a bit unclear, like it was not documented that the return value binds to the "val" key, if the function has multiple return values, will they all bind to "val"?
Last edited by feisty2; 27th October 2020 at 19:26. |
27th October 2020, 22:49 | #4087 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Filters can't but functions can. A single VSMap key can only hold anodes or vnodes.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th October 2020, 19:33 | #4089 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I played with some pretty ugly hacks
Code:
// C++ plugin auto ret = VSFuncRef_stuff(); auto msg = ""s; auto m = ret.map_pointer; for (auto x : Range{ vsapi->propNumKeys(m) }) { msg += vsapi->propGetKey(m, x); msg += "\n"; } throw msg; # Python tests def f(): return 'aaa', 'bbb' def g(): return 'aaa', 123 core.???.Test(f) # okay, error message says "val" core.???.Test(g) # error message says "not all values are of the same type in val" 1) it is allowed to call a python function with multiple return values of the same type 2) all return values bind to the same key called "val" 3) it is not allowed to call a python function with multiple return values of different types because of 2) @Myrsloik technical details like this should really be documented rather than leave us wild guessing and poking around. |
31st October 2020, 12:31 | #4091 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Yes, there's the mapSetEmpty() instead.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
5th November 2020, 23:17 | #4093 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
I think it's only used in python code (see vapoursynth.pyx for c-ish code) and then lut/lut2 for a callFunc() example.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
8th November 2020, 12:39 | #4094 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Is there some known issue with fmtc and R52?
using: Code:
# Imports import vapoursynth as vs core = vs.get_core() # Loading Plugins core.std.LoadPlugin(path="I:/workspace/Hybrid/debug/64bit/vsfilters/Support/fmtconv.dll") core.std.LoadPlugin(path="I:/workspace/Hybrid/debug/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll") # source: 'F:\TestClips&Co\files\test.avi' # current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive # Loading source using FFMS2 clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False) # making sure input color matrix is set as 470bg clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited") # making sure frame rate is set to 25 clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # Setting color range to TV (limited) range. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1) original = clip clip = core.fmtc.resample(clip=clip, kernel="gaussian", w=1280, h=704, interlaced=False, interlacedd=False) original = core.fmtc.resample(clip=original, kernel="bicubic", w=1280, h=704, interlaced=False, interlacedd=False) # adjusting output color from: YUV420P16 to YUV420P8 for FFvHuffModel (i420@8) clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited") # adjusting for FilterView if (original.format.id != clip.format.id): if (original.format.color_family == vs.RGB and clip.format.color_family != vs.RGB): original = core.resize.Bicubic(clip=original, format=clip.format.id, matrix_s="470bg", range_s="limited") elif (original.format.color_family == clip.format.color_family): original = core.resize.Bicubic(clip=original, format=clip.format.id, range_s="limited") else: original = core.resize.Bicubic(clip=original, format=clip.format.id, matrix_in_s="470bg", range_s="limited") stacked = core.std.StackHorizontal([original,clip]) # set output frame rate to 25.000fps stacked = core.std.AssumeFPS(clip=stacked, fpsnum=25, fpsden=1) # Output stacked.set_output() Cu Selur |
8th November 2020, 16:41 | #4096 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Hard to tell what causes it without some kind of crash dump for debugging. I haven't seen any reported issues and nothing has changed in VS in frame/filter handling.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
8th November 2020, 16:42 | #4097 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
I think I did. It was replaced with a map copy functions so you have to go the long way around and use that instead.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
10th November 2020, 19:30 | #4099 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
is it possible to change the API for releaseFrameEarly to void(const VSFrameRef*, VSFrameContext*) (release directly from a frame object rather than from a node object)?
the current API kind of breaks RAII for C++, a frame object always keeps the ownership of its underlying frame reference, if a frame reference is released from a node, there's no way to inform the frame object who's keeping the ownership of the reference that the reference has expired, and there will be a "double free" error after getFrame() returns. |
10th November 2020, 19:47 | #4100 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
or maybe releaseFrameEarly() could set a frame to a "zombie" mode, the most memory consuming part (the image content of the frame) is instantly released after calling this function, but the frame header, particularly the part that's keeping the reference count is still alive in the memory, so there won't be a "double free" error when any frame object goes out of scope.
|
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|