-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapireference.html
234 lines (219 loc) · 10.9 KB
/
apireference.html
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>VapourSynth C API Reference — VapourSynth-Classic R57 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/agogo.css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="VapourSynth.h" href="api/vapoursynth.h.html" />
<link rel="prev" title="VIVTC" href="plugins/vivtc.html" />
</head><body>
<div class="header-wrapper" role="banner">
<div class="header">
<div class="headertitle"><a
href="index.html">VapourSynth-Classic R57 documentation</a></div>
<div class="rel" role="navigation" aria-label="related navigation">
<a href="plugins/vivtc.html" title="VIVTC"
accesskey="P">previous</a> |
<a href="api/vapoursynth.h.html" title="VapourSynth.h"
accesskey="N">next</a> |
<a href="genindex.html" title="General Index"
accesskey="I">index</a>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="vapoursynth-c-api-reference">
<h1>VapourSynth C API Reference<a class="headerlink" href="#vapoursynth-c-api-reference" title="Permalink to this heading">¶</a></h1>
<p>See the example filters in the sdk dir. Reading simplefilters.c, which contains
several built-in functions, can also be very helpful.</p>
<section id="public-headers">
<h2>Public Headers<a class="headerlink" href="#public-headers" title="Permalink to this heading">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="api/vapoursynth.h.html">VapourSynth.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/vshelper.h.html">VSHelper.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/vsscript.h.html">VSScript.h</a></li>
</ul>
</div>
</section>
<section id="common-pitfalls">
<h2>Common Pitfalls<a class="headerlink" href="#common-pitfalls" title="Permalink to this heading">¶</a></h2>
<p>There are several minor pitfalls related to the threading and design that have to be taken into consideration. Most of them usually aren’t a problem but here’s a small checklist of things you have to watch out for sometimes.</p>
<section id="general-api">
<h3>General API<a class="headerlink" href="#general-api" title="Permalink to this heading">¶</a></h3>
<p>You may not pass objects (clips, functions and so on) owned by one core as arguments to filters in another core. A manual full deep copy of the data you want to pass on is required. This is generally not a problem since you should never need more than one core per filter graph.</p>
</section>
<section id="plugins">
<h3>Plugins<a class="headerlink" href="#plugins" title="Permalink to this heading">¶</a></h3>
<p>Plugin code may run more multithreaded than it initially appears. <em>VapourSynthPluginInit</em> is the only function always guaranteed to not run in parallel. This means that the constructor and destructor of a filter may be run in parallel for several instances. Use proper synchronization if you need to initialize shared data.</p>
<p>The <em>GetFrame</em> function is a bit more complicated so see the reference of the constants. Do however note that the parallelism is per instance. Even if a filter is <em>fmUnordered</em> or <em>fmSerial</em> other instances may enter <em>GetFrame</em> simultaneously.</p>
<p>There are two common misconseptions about which mode should be used. A simple rule is that <em>fmSerial</em> should never be used. And source filters (those returning a frame on <em>arInitial</em>) that need locking should use <em>fmUnordered</em>.</p>
</section>
</section>
<section id="reserved-frame-properties">
<h2>Reserved Frame Properties<a class="headerlink" href="#reserved-frame-properties" title="Permalink to this heading">¶</a></h2>
<p>All frames contain a map of key–value pairs. It is recommended that these
properties are named using only a-z, A-Z, 0-9 using CamelCase. There is a
special category of keys starting with _ which have strictly defined meanings
specified below. It is acceptable to not set any of these keys if they are
unknown. It is also a fatal error to set them to a value not specified below.</p>
<p>int _ChromaLocation</p>
<blockquote>
<div><p>Chroma sample position in YUV formats.</p>
<p>0=left, 1=center, 2=topleft, 3=top, 4=bottomleft, 5=bottom.</p>
</div></blockquote>
<p>int _ColorRange</p>
<blockquote>
<div><p>Full or limited range (PC/TV range). Primarily used with YUV formats.</p>
<p>0=full range, 1=limited range.</p>
</div></blockquote>
<p>int _Primaries</p>
<blockquote>
<div><p>Color primaries as specified in ITU-T H.265 Table E.3.</p>
</div></blockquote>
<p>int _Matrix</p>
<blockquote>
<div><p>Matrix coefficients as specified in ITU-T H.265 Table E.5.</p>
</div></blockquote>
<p>int _Transfer</p>
<blockquote>
<div><p>Transfer characteristics as specified in ITU-T H.265 Table E.4.</p>
</div></blockquote>
<p>int _FieldBased</p>
<blockquote>
<div><p>If the frame is composed of two independent fields (interlaced).</p>
<p>0=frame based (progressive), 1=bottom field first, 2=top field first.</p>
</div></blockquote>
<p>float _AbsoluteTime</p>
<blockquote>
<div><p>The frame’s absolute timestamp in seconds if reported by the source filter.
Should only be set by the source filter and not be modified. Use durations
for all operations that depend on frame length.</p>
</div></blockquote>
<p>int _DurationNum, int _DurationDen</p>
<blockquote>
<div><p>The frame’s duration in seconds as a rational number. Filters that
modify the framerate should also change these values.</p>
<p>This fraction should always be normalized.</p>
</div></blockquote>
<p>bint _Combed</p>
<blockquote>
<div><p>Whether or not the frame needs postprocessing, usually hinted from field
matching filters.</p>
</div></blockquote>
<p>int _Field</p>
<blockquote>
<div><p>If the frame was produced by something like core.std.SeparateFields,
this property signals which field was used to generate this frame.</p>
<p>0=from bottom field, 1=from top field.</p>
</div></blockquote>
<p>string _PictType</p>
<blockquote>
<div><p>A single character describing the frame type. It uses the common
IPB letters but other letters may also be used for formats with
additional frame types.</p>
</div></blockquote>
<p>int _SARNum, int _SARDen</p>
<blockquote>
<div><p>Pixel (sample) aspect ratio as a rational number.</p>
</div></blockquote>
<p>bint _SceneChangeNext</p>
<blockquote>
<div><p>If 1, this frame is the last frame of the current scene. The next frame starts a new scene.</p>
</div></blockquote>
<p>bint _SceneChangePrev</p>
<blockquote>
<div><p>If 1, this frame starts a new scene.</p>
</div></blockquote>
<p>frame _Alpha</p>
<blockquote>
<div><p>A clip’s alpha channel can be attached to the clip one frame at a
time using this property.</p>
</div></blockquote>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
</div>
<div class="sidebar">
<h3>Table of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="gettingstarted.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="pythonreference.html">Python Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="functions.html">Function Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="output.html">Output</a></li>
<li class="toctree-l1"><a class="reference internal" href="applications.html">Applications and Libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="avisynthcomp.html">Avisynth functions and their VapourSynth equivalents</a></li>
<li class="toctree-l1"><a class="reference internal" href="includedplugins.html">Included Plugins</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">VapourSynth C API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#public-headers">Public Headers</a><ul>
<li class="toctree-l3"><a class="reference internal" href="api/vapoursynth.h.html">VapourSynth.h</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/vshelper.h.html">VSHelper.h</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/vsscript.h.html">VSScript.h</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#common-pitfalls">Common Pitfalls</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#general-api">General API</a></li>
<li class="toctree-l3"><a class="reference internal" href="#plugins">Plugins</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#reserved-frame-properties">Reserved Frame Properties</a></li>
</ul>
</li>
</ul>
<div role="search">
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer">
<div class="left">
<div role="navigation" aria-label="related navigaton">
<a href="plugins/vivtc.html" title="VIVTC"
>previous</a> |
<a href="api/vapoursynth.h.html" title="VapourSynth.h"
>next</a> |
<a href="genindex.html" title="General Index"
>index</a>
</div>
<div role="note" aria-label="source link">
<br/>
<a href="_sources/apireference.rst.txt"
rel="nofollow">Show Source</a>
</div>
</div>
<div class="right">
<div class="footer" role="contentinfo">
© Copyright 2012-2021, Fredrik Mellbin.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 6.1.3.
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</body>
</html>