Log in

View Full Version : Vapoursynth


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 [27] 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

LoRd_MuldeR
27th July 2014, 13:04
Thanks for the update.

However I noticed that with the new VSPIPE version querying the VapourSynth version doesn't work, which breaks the VapourSynth detection code in my GUI program:
C:\Program Files (x86)\VapourSynth\core32>vspipe.exe -v
No script file specified

C:\Program Files (x86)\VapourSynth\core32>vspipe.exe -version
No output file specified

C:\Program Files (x86)\VapourSynth\core32>vspipe.exe --version
No script file specifiedVapourSynth detection is running, please stand by...
VSPIPE.EXE failed with code 0x00000001 -> disable Vapousynth support!
VapourSynth thread finished.
VapourSynth thread failed to detect installation!


Also, maybe more a cosmetic problem, but anyway: Is it supposed to show those $s's there?
VSPipe usage:
$s [options] <script> <outfile>

Examples:
Show script info:
$s --info script.vpy -


BTW: Changing the CLI syntax in a non-backward-compatible way is generally bad for GUI front-end's, since we either need to support old and new variants (which is pain) or we support only a specific VapourSynth version (then user is doomed if program A wants VapourSynth r23 and program B wants VapourSynth r24).

Myrsloik
27th July 2014, 14:15
VapourSynth R24 test 3 (https://www.dropbox.com/s/ltool5u7cok51c4/vapoursynth_r24_test3.exe)

Fixes the vspipe issues.

...

BTW: Changing the CLI syntax in a non-backward-compatible way is generally bad for GUI front-end's, since we either need to support old and new variants (which is pain) or we support only a specific VapourSynth version (then user is doomed if program A wants VapourSynth r23 and program B wants VapourSynth r24).

I know changing things is bad, that's why I keep a list of major things I'm going to break all at once at an unspecified later time for the core API. The rest of the project is kinda in an evolutionary state though.

However having saner argument parsing is just too attractive to not do it and adding additional options would've been difficult without re-writing it all anyway. Now it follows standard command line conventions and makes more sense. The user base is also still small and fast enough to adapt to the changes. You're the only one making a GUI front end that I know of. Feel free to drop support for older versions of VS if it's too much work. I really try to make each release better than the last, or at least release a fix quickly if a major issue is found.

Anyway, no more major vspipe changes. Now it's done.

LoRd_MuldeR
27th July 2014, 14:40
VapourSynth R24 test 3 (https://www.dropbox.com/s/ltool5u7cok51c4/vapoursynth_r24_test3.exe)

Fixes the vspipe issues.

Confirmed :)

c:\Program Files (x86)\VapourSynth\core32>vspipe.exe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2014 Fredrik Mellbin
Core r24
API r3


Anyway, no more major vspipe changes. Now it's done.

From your lips to God's ears ;)

zerowalker
27th July 2014, 20:58
How is Vapoursynth looking?

It's been awhile since it came, so i wonder, is the improvements as expected and all that?

I know it's still far from done, so not expecting it to be comparable, but i just mean in the sense that it's using a more modern approach and how that compares.

Mystery Keeper
28th July 2014, 00:34
VapourSynth is rather great. Especially compared to the current state of AviSynth. But it lacks some essential plugins. NNEDI3 is only supporting 8bit colordepth so far. No motion compensation. No DFTTest.

zerowalker
28th July 2014, 02:09
How's the speed compared to Avisynth, in stuff that's working as expected?

Myrsloik
6th August 2014, 22:12
I'm back AGAIN!

Here's R24 RC1 (https://www.dropbox.com/s/juqrl9fqobxfzcu/vapoursynth_r24_rc1.exe) with a pile of important additional fixes.

Test everything a bit so it doesn't crashe too often. I had to change a lot of python code to fix some of the bugs.

All changes in R24 so far:
r24:
fixed reference leak in FrameEval
more functions in the vsscript api now return success or failure
improved handling of the vsfunc type in python, it should now have all the functionality originally intended
removed r21 argument compatibility since all scripts should have been changed by now
include file paths in the windows sdk have been changed to better match linux and osx
the core will no longer be completely freed until all filter instances belonging to it have been released, this prevents crashes in some circumstances
vsvfw now properly returns an error message when no output has been set instead of silently failing
fixed a reference leak in vsscript
vspipe has a new argument for passing on values to the script environment from the command line
vspipe now has improved command line parsing and short forms, however old command lines will have to be modified to work
re-added clip.output()
fixed a filter error propagation issue
mixed improvements to vivtc (nodame)
fixed mac compilation of genericfilters
added FreezeFrames, DuplicateFrames and DeleteFrames, they can all delete/duplicate/freeze multiple frames with one command (nodame)
mixed documentation improvements (nodame)
fixed tracking of memory usage that was broken in r22 (nodame)
vivtc now uses framedifference internally and runs completely in parallel, also minor metric reporting fixes (nodame)

Myrsloik
6th August 2014, 22:13
How's the speed compared to Avisynth, in stuff that's working as expected?

About the same speed for single threaded. Good scaling with the number of cores on medium-complex scripts when multithreaded. Not much more to say about it.

anonymlol
9th August 2014, 10:01
I'm back AGAIN!
Here's R24 RC1 (https://www.dropbox.com/s/juqrl9fqobxfzcu/vapoursynth_r24_rc1.exe) with a pile of important additional fixes.


Chrome is blocking it: http://puu.sh/aL12Q/c8c109f5b2.png

Myrsloik
9th August 2014, 12:09
Chrome is blocking it: http://puu.sh/aL12Q/c8c109f5b2.png

It's chrome acting like shit antivirus software. Use IE or something else to download where you can ignore the warnings.

Installers are regularly blacklisted/blocked by incompetence.

alexxdls
10th August 2014, 04:49
Can I maintain aspect ratio while resizing?
v = core.resize.Lanczos(clip=v, width=1920, height=new_height)new_height = original_height / original_width x 1920How can I get original_height and original_width with VapourSynth? Please give a detailed example.

jackoneill
10th August 2014, 06:53
Can I maintain aspect ratio while resizing?
v = core.resize.Lanczos(clip=v, width=1920, height=new_height)new_height = original_height / original_width x 1920How can I get original_height and original_width with VapourSynth? Please give a detailed example.

http://www.vapoursynth.com/doc/pythonreference.html

new_height = int(v.height / v.width * 1920 + 0.5)


This rounds up to the next integer, which may not be what you need (if you have subsampling).

alexxdls
10th August 2014, 10:20
Is it correct calculation (rounding to the neares even value)?new_height = v.height / v.width * new_width - 0.5
new_height = lambda new_height : round( new_height / 2.) * 2
v = core.resize.Lanczos(clip=v, width=new_width , height=new_height)

alexxdls
12th August 2014, 16:59
import vapoursynth as vs
core = vs.get_core()
import os
core.std.LoadPlugin(path=r"d:\TOOLS\MyDCPConverter\Tools\imwri-64.dll")
core.std.LoadPlugin(path=r"d:\TOOLS\MyDCPConverter\Tools\fmtconv.dll")
ext = 'L.png'
dir = r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL1/"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vl1 = core.imwri.Read(srcs)
vl1 = core.fmtc.matrix(vl1, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=1)
vl = vl1
dir = r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL2/"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vl2 = core.imwri.Read(srcs)
vl2 = core.fmtc.matrix(vl2, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=1)
vl = vl + vl2
vl = core.std.CropRel(vl, left=15, right=15, top=0, bottom=0)
new_height = round(vl.height / vl.width * 1920 / 2) * 2
vl = core.resize.Lanczos(vl, width=1920, height=new_height)
border_height = round((1080 - vl.height) / 2)
vl = core.std.AddBorders(vl, top=border_height, bottom=border_height)
ext = 'R.png'
dir = r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL1/"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vr1 = core.imwri.Read(srcs)
vr1 = core.fmtc.matrix(vr1, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=1)
vr = vr1
dir = r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL2/"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vr2 = core.imwri.Read(srcs)
vr2 = core.fmtc.matrix(vr2, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=1)
vr = vr + vr2
vr = core.std.CropRel(vr, left=15, right=15, top=0, bottom=0)
vr = core.resize.Lanczos(vr, width=1920, height=new_height)
border_height = round((1080 - vr.height) / 2)
vr = core.std.AddBorders(vr, top=border_height, bottom=border_height)
v = core.std.StackHorizontal([vl,vr])
v = core.std.AssumeFPS(v, fpsnum=24)
v = core.fmtc.resample(v, css="420")
v = core.fmtc.bitdepth(v, bits=8, dmode=3)
v.set_output()
I get an errorunable to destroy mutex: Resource devicetrying to encode this script. The same thing in FRIMEncode and x264 (with vspipe). Checking the script with VapourSynthEditor-64bit goees wellScript was successfully evaluated. Output video info:
Frames: 72 | Time: 0:00:03.000 | Size: 3840x1080 | FPS: 24/1 = 24 | Format: YUV420P8But previewing fails and VapourSynthEditor-64bit crushes.

Mystery Keeper
12th August 2014, 17:09
Evaluates, but crashes on processing? The error is in GetFrame().

alexxdls
13th August 2014, 03:10
Replacing
v = core.std.StackHorizontal([vl,vr])with
v = vl + vrorv = core.std.StackHorizontal([vr,vr])orv = core.std.StackHorizontal([vl,vl])gives positive result and VapourSynthEditor-64bit doesn't crash anymore.
Even the simplest script with one frame in vl and vr crushes the same wayimport vapoursynth as vs
core = vs.get_core()
import os
core.std.LoadPlugin(path=r"d:\TOOLS\MyDCPConverter\Tools\imwri-64.dll")
core.std.LoadPlugin(path=r"d:\TOOLS\MyDCPConverter\Tools\fmtconv.dll")
vl = core.imwri.Read(r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL2\000034L.png")
vr = core.imwri.Read(r"F:\TEMP\TRAIN-DRAGON-2_TLR-G-3D_RU-XX_RU-00_51_2K_TCF_20140417_DWA_IOP-3D\REEL2\000034R.png")
v = core.std.StackHorizontal([vl,vr])
v.set_output()Script was successfully evaluated. Output video info:
Frames: 1 | Time: 0:00:00.033 | Size: 4096x858 | FPS: 30/1 = 30 | Format: RGB48
What is wrong with std.StackHorizontal???

Myrsloik
13th August 2014, 09:02
What is wrong with std.StackHorizontal???

I will take a look at it. I just happen to have plenty of other things as well to test. And a job. Posting in more threads about it won't make me happier or make me work faster.

nu774
13th August 2014, 10:07
Build of vapoursynth.pyd fails here (on windows) due to failure of "cimport windows". I needed to create the following file named "windows.pxd" placed under Cython directory.

cdef extern from "windows.h" nogil:
bint WriteFile(void *hFile, void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesWritten, void *lpOverlapped) nogil

Myrsloik
13th August 2014, 10:09
Build of vapoursynth.pyd fails here (on windows) due to failure of "cimport windows". I needed to create the following file named "windows.pxd" placed under Cython directory.

cdef extern from "windows.h" nogil:
bint WriteFile(void *hFile, void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesWritten, void *lpOverlapped) nogil


I forgot to add it. It's committed now.

alexxdls
13th August 2014, 14:57
Posting in more threads about it won't make me happier or make me work faster.I sumply thought it is VS and Python issue and posted here. But then did some optimizations with my script to have just basic funtions to use Stack. And tests pointed me out that it could be the plugin issue.

Myrsloik
13th August 2014, 21:02
Here's R24 RC2 (http://www.vapoursynth.com/downloads/vapoursynth-r24-rc2.exe).

This really should be final now. I guess. I'll give it 24 hours of testing and then I'll release it. Unfortunately for me people keep finding real crash bugs...

Going to focus on the imagemagick stuff after this is done.

Top 3 items are new in RC2.
r24:
fixed rare crashes in 64 bit windows asm in a few filters
core.max_cache_size should now be used instead of core.set_max_cache_size()
num_threads, add_cache and accept_lowercase can now be set at any time in python and not only during the first call to get_core()
fixed reference leak in FrameEval
more functions in the vsscript api now return success or failure
improved handling of the vsfunc type in python, it should now have all the functionality originally intended
removed r21 argument compatibility since all scripts should have been changed by now
include file paths in the windows sdk have been changed to better match linux and osx
the core will no longer be completely freed until all filter instances belonging to it have been released, this prevents crashes in some circumstances
vsvfw now properly returns an error message when no output has been set instead of silently failing
fixed a reference leak in vsscript
vspipe has a new argument for passing on values to the script environment from the command line
vspipe now has improved command line parsing and short forms, however old command lines will have to be modified to work
re-added clip.output()
fixed a filter error propagation issue
mixed improvements to vivtc (nodame)
fixed mac compilation of genericfilters
added FreezeFrames, DuplicateFrames and DeleteFrames, they can all delete/duplicate/freeze multiple frames with one command (nodame)
mixed documentation improvements (nodame)
fixed tracking of memory usage that was broken in r22 (nodame)
vivtc now uses framedifference internally and runs completely in parallel, also minor metric reporting fixes (nodame)

Myrsloik
14th August 2014, 21:51
Final version of R24 posted. It's identical to RC2.

The theme for this release is making things more sane in general and fixing bugs. The usual release post (http://www.vapoursynth.com/2014/08/r24-making-vsscript-sane/) also exists with a small summary.

Mystery Keeper
21st August 2014, 23:46
Time to give VapourSynth its own forum section?

foxyshadis
22nd August 2014, 03:19
I brought it up a while back, and Doom9 said maybe when it gets bigger. Changing the forum names to Avisynth & Vapoursynth is a possibility, though.

vcmohan
13th September 2014, 14:46
I am a newbie and trying to port my avisynth plugins. I require a particular frame from a clip in the INIT function. I tried several ways but nothing seems to be correctly coded. Can you please guide me as to how the statement should read? I am using
const VSFrameRef *matchf = VSGetFrame getFrame(d->mf, d->node[1], NULL, NULL);

jackoneill
13th September 2014, 15:57
I am a newbie and trying to port my avisynth plugins. I require a particular frame from a clip in the INIT function. I tried several ways but nothing seems to be correctly coded. Can you please guide me as to how the statement should read? I am using
const VSFrameRef *matchf = VSGetFrame getFrame(d->mf, d->node[1], NULL, NULL);

Based on a real working plugin that does this:

#include <stdint.h>

#include <string>

#include <VapourSynth.h>
#include <VSHelper.h>


typedef struct {
VSNodeRef *node;
const VSVideoInfo *vi;

} TestData;


static void VS_CC testInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
TestData *d = (TestData *) * instanceData;
vsapi->setVideoInfo(d->vi, 1, node);
}


static const VSFrameRef *VS_CC testGetFrame(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) {
TestData *d = (TestData *) * instanceData;

if (activationReason == arInitial) {
vsapi->requestFrameFilter(n, d->node, frameCtx);
} else if (activationReason == arAllFramesReady) {
const VSFrameRef *src = vsapi->getFrameFilter(n, d->node, frameCtx);
VSFrameRef *dst = vsapi->copyFrame(src, core);


vsapi->freeFrame(src);

return dst;
}

return 0;
}


static void VS_CC testFree(void *instanceData, VSCore *core, const VSAPI *vsapi) {
TestData *d = (TestData *)instanceData;

vsapi->freeNode(d->node);
free(d);
}


static void VS_CC testCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi) {
TestData d;
TestData *data;

d.node = vsapi->propGetNode(in, "clip", 0, 0);
d.vi = vsapi->getVideoInfo(d.node);


char errorMsg[1024];
const VSFrameRef *evil = vsapi->getFrame(0, d.node, errorMsg, 1024);
if (!evil) {
vsapi->setError(out, std::string("Test: failed to retrieve first frame from input clip. Error message: ").append(errorMsg).c_str());
vsapi->freeNode(d.node);
return;
}

// Do things with the frame.

vsapi->freeFrame(evil);


data = (TestData *)malloc(sizeof(d));
*data = d;

vsapi->createFilter(in, out, "Test", testInit, testGetFrame, testFree, fmParallel, 0, data, core);
}


VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin) {
configFunc("com.nodame.test", "test", "Test plugin for VapourSynth", VAPOURSYNTH_API_VERSION, 1, plugin);
registerFunc("Test",
"clip:clip;"
, testCreate, 0, plugin);
}

vcmohan
14th September 2014, 04:16
Documentation regarding vapoursynth API states that the getFrame can be used in the Init section of a plugin to get a particular frame. It returns immediately that frame. The code for Init part given
static void VS_CC testInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
TestData *d = (TestData *) * instanceData;
vsapi->setVideoInfo(d->vi, 1, node);
}
has no call for the frame.
I am refering to the following write up.
VSGetFrame getFrame
typedef const VSFrameRef *(VS_CC *VSGetFrame)(int n, VSNodeRef *node, char *errorMsg, int bufSize)

Generates a frame directly. The frame is available when the function returns.

This function is meant for external applications using the core as a library, or if frame requests are necessary during a filter’s initialization.

n
The frame number. Negative values will cause an error.
node
The node from which the frame is requested.
bufSize
Maximum length for the error message, in bytes (including the trailing ‘0’). Can be 0 if no error message is wanted.
errorMsg
Pointer to a buffer of bufSize bytes to store a possible error message. Can be NULL if no error message is wanted.
Returns a reference to the generated frame, or NULL in case of failure. The ownership of the frame is transferred to the caller.

Warning

Never use inside a filter’s “getframe” function.

jackoneill
14th September 2014, 04:38
Documentation regarding vapoursynth API states that the getFrame can be used in the Init section of a plugin to get a particular frame. It returns immediately that frame. The code for Init part given
static void VS_CC testInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
TestData *d = (TestData *) * instanceData;
vsapi->setVideoInfo(d->vi, 1, node);
}
has no call for the frame.

Yeah, the initialisation of VapourSynth filters is split into two functions (testCreate and testInit in this case). I forget why exactly. I think you can do this in either one, but in testCreate it definitely works.

The documentation will get another review soon™.

vcmohan
16th September 2014, 03:33
I could make it compile properly now. I need to test it. My OS is windows 8.1 64 bit. The VC++ 2010 does not say whether it is 64 or 32 bit. r24 dll when I downloaded it says 32 bit. Hope they will all work together.

foxyshadis
18th September 2014, 01:46
VS will let you switch between Win32 and x64 (and IA64 or ARM) at the top, next to the Debug/Release. Normally it defaults to Win32, and in the Configuration Manager you can enable others by adding a <New...> config. 32-bit plugins only work on 32-bit VS, and vice versa for 64-bit. Everything will work on 64-bit Windows.

vcmohan
18th September 2014, 06:05
Does this mean that every plugin be made available in both 32 and 64 bit versions?pre compiled binary for windows r24 dll did not give an option of 64 bit

foxyshadis
18th September 2014, 23:16
The installer now gives you both 32 and 64 bit versions, with separate plugin folders for each. Which one gets used depends on either what the opening application is (for AvsP and VapourSynth Editor), or what version of Python is called if it's piped.

Mystery Keeper
19th September 2014, 01:46
Also note that to use both 32 and 64 bit versions of VapourSynth you need to also have installed both versions of Python.

vcmohan
20th September 2014, 12:36
So looks safe to compile in 32 bit format.
I have 2 doubts.
1. arFrameReady and arAllFramesReady. I thought that if only a single frame is requested in the initial, then arFrameReady need be used. But the invert example eventhough requested a single frame it uses arAllFramesReady. So when arFrameReady to be used?
2. In the create section I have an optional 2nd clip parameter. If not specified I use d.node[1] = d.node[0]. When freeing due either error or end of frame processing should both node[0] and node[1] are to be freed or only one? I assumed both need to be freed.

Myrsloik
20th September 2014, 12:56
So looks safe to compile in 32 bit format.
I have 2 doubts.
1. arFrameReady and arAllFramesReady. I thought that if only a single frame is requested in the initial, then arFrameReady need be used. But the invert example eventhough requested a single frame it uses arAllFramesReady. So when arFrameReady to be used?
2. In the create section I have an optional 2nd clip parameter. If not specified I use d.node[1] = d.node[0]. When freeing due either error or end of frame processing should both node[0] and node[1] are to be freed or only one? I assumed both need to be freed.

1. arAllFramesReady is when all frames that have been requested are ready. It's what all almost filters should wait for.

arFrameReady happens whenever a frame is ready (no particular order) and is mostly meant to be used by filters with a huge number of input frames.

An example:
Your filter calls requestFrameFilter() 3 times and then returns.
Then your filter will get called with arFrameReady, arFrameReady, arAllFramesReady. Waiting for arAllFramesReady means that all frames you wanted can be used.

2. There is no automatic reference counting since the API is pure C. You need to clone the reference when assigning it. If you don't do this you will free the same memory twice and crash. I assume your cleanup code looks something like:

vsapi->freeNode(d.node[0])
vsapi->freeNode(d.node[1])


This is probably what you want:
d.node[1] = vsapi->cloneNodeRef(d.node[0])

vcmohan
20th September 2014, 13:19
Thanks. I have created a folder vsfiles and placed my script file with extension.py. I tried to open it with virtualdub, but vdub says unknown format. What file extension I need to use?
Is there a video player that takes in floating point formats? Do I need to convert by resize to input to a player?

Myrsloik
20th September 2014, 15:20
Thanks. I have created a folder vsfiles and placed my script file with extension.py. I tried to open it with virtualdub, but vdub says unknown format. What file extension I need to use?
Is there a video player that takes in floating point formats? Do I need to convert by resize to input to a player?

The extension has to be .vpy for it to be opened. And no, no players support floating point formats. If you use madvr as the renderer most players support 16 bit formats but if you want to preview in vdub you have to convert it to 8bit.

vcmohan
21st September 2014, 07:21
Thanks. I am having some problems with script
ret = core.std.BlankClip(width=720,height=480,format=vs.RGB24,color=255,255,255)
using the 32 bit editor gives a syntax error stating that 'non keyword arg after keyword arg with an arrow pointing under format.
when I use BlankClip() with all default arguments it proceeds to next step.
There I have a call to my plugin Grid
core.std.LoadPlugin(path=r'c:\transplugins\bin_vapoursynth\Grid\release\Grid.dll')
this was accepted. but the call
ret = core.std.Grid(ret, color = 0x7fff)
produced an error stating no function named Grid.
In the plugin code I have the following statements at the appropriate places
vsapi->createFilter(in, out, "Grid", gridInit, gridGetFrame, gridFree, fmParallel, 0, data, core);
}
VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin)
{
configFunc("in.vcmohan.grid", "grid", "VapourSynth grid plugin", VAPOURSYNTH_API_VERSION, 1, plugin);
registerFunc("Grid", "clip:clip;lineint:int:opt;bold:int:opt;vbold:int:opt;color:int:opt;bcolor:int:opt;vbcolor:int:opt;grid:int:opt;axis:int:opt;", invertCreate, 0, plugin);
}

Incidentally the example Invert in SDK gives name as "Filter" and not "invert" which I think is not correct.
Request guidance in scripting

vcmohan
21st September 2014, 11:55
Thanks. I tried color = 255,255,255 without the side brackets and it has accepted. One more question. In case of an array. I have integer array with flags opt:empty. In case there is no entry of this parameter then I presume I get err in the propGetInt call. What is then an empty signify? If one enters color=[], is this called an empty array and I get not an err but numElements = 0. Is my understanding correct?

Myrsloik
21st September 2014, 20:44
Empty controls the argument checks that happen before the arguments are passed to your filter. Without empty specified all array arguments must have at least one element (or in combination with opt it can also be undefined).

I think your understanding is correct. [] is an empty array.

vcmohan
22nd September 2014, 05:36
thanks.
in the invert example d.vi is at two places
in the Create it is
d.node = vsapi->propGetNode(in, "clip", 0, 0);
d.vi = vsapi->getVideoInfo(d.node);
and in the Init part it is
vsapi->setVideoInfo(d->vi, 1, node);
Is the SetVideoInfo required if one is not changing any part of vi
as in the invert example case?

jackoneill
22nd September 2014, 08:32
thanks.
in the invert example d.vi is at two places
in the Create it is
d.node = vsapi->propGetNode(in, "clip", 0, 0);
d.vi = vsapi->getVideoInfo(d.node);
and in the Init part it is
vsapi->setVideoInfo(d->vi, 1, node);
Is the SetVideoInfo required if one is not changing any part of vi
as in the invert example case?

It is required even if you don't change the video info. You get a fatal error if you don't do it.

vcmohan
24th September 2014, 03:56
in plugin coding, the configure has a id, namespace etc; I find that the namespace need to be unique. I tried with different urls as id, but same namespace. It refused to load stating that particular namespace is already populated. Then how can one be sure that the namespace is not already used by some other plugin? What exactly the reverse url id does then?

Myrsloik
24th September 2014, 22:40
in plugin coding, the configure has a id, namespace etc; I find that the namespace need to be unique. I tried with different urls as id, but same namespace. It refused to load stating that particular namespace is already populated. Then how can one be sure that the namespace is not already used by some other plugin? What exactly the reverse url id does then?

Every loaded plugin has to be in its own namespace. This is to make sure there are no overlapping names of functions. It is possible to specify a plugin to have another namespace when loading it with LoadPlugin.

This is the reason a plugin has both a namespace and an id, the id is the only thing that can never change.

There's no easy way to make sure your plugin will never have the same namespace as someone else's. Just look at the already existing plugins to see what they used. I probably should make a list of the already taken ones for easy reference.

lansing
25th September 2014, 22:24
I'm trying to load a 64bit avs plugin with core.avs.LoadPlugin(r"xyz.dll"), but it's giving me error "No attribute with the name avs exists". Loading a 32bit avs plugin works fine.

TheFluff
25th September 2014, 22:38
I'm trying to load a 64bit avs plugin with core.avs.LoadPlugin(r"xyz.dll"), but it's giving me error "No attribute with the name avs exists". Loading a 32bit avs plugin works fine.

IIRC the avs compatibility layer doesn't work for 64-bit Avisynth. I think it had something to do with the plane offsets still being 32-bit in Avisynth or something, making frame memory layout incompatible between VS and AVS.

edit: yep, see http://www.vapoursynth.com/2013/12/r22-the-number-of-bits-shall-be-64/

lansing
26th September 2014, 15:31
I see, I'll stay away from it then

vcmohan
30th September 2014, 03:56
I find that resize does not accept floating point samples. How can one test software for these formats?

feisty2
30th September 2014, 06:33
fmtconv

Mystery Keeper
30th September 2014, 09:57
I find that resize does not accept floating point samples. How can one test software for these formats?In one of my letters to you I have written exactly how to do that.