DumpFilterGraph

From Avisynth wiki
Revision as of 19:51, 31 January 2021 by Pinterf (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Filter graph dump functions in general

AVS+ With these functions we can output the flow of filtering as a graph. Put the beginning of the avs script and call on the SetGraphAnalysis(true) and insert DumpFilterGraph() at the end to dump the filter graph. These helper functions were first provided in the Neo fork of Avisynth+ by Nekopanda.

Example

 SetGraphAnalysis(true)
 srcfile="..."
 LWLibavVideoSource(srcfile)
 QTGMC()
 DumpFilterGraph("graph.txt", mode=2)

Since it is output in dot format, it can be converted to an image with Graphviz as shown below.

 dot -Tsvg graph.txt -o graph.svg

SetGraphAnalysis

SetGraphAnalysis(bool OnOff)

bool  OnOff =
Enables (True) or disables (False) the insertion of graph nodes into the instantiated filter.

To output a filter graph, the filter must have a graph node inserted. Inserting a graph node increases the number of internal function calls, which can result in a slight performance penalty. (In most cases, I (Nekopanda) don't think there is any observable performance degradation.)

DumpFilterGraph

DumpFilterGraph (clip clip, string outfile, int mode, int nframes, bool repeat)

clip  clip =
Clip to output the filter graph.
string  outfile = ""
Output file path.
int  mode = 0
0: basic 1: extended (parameters enabled) 2: extended (no parameters)
int  nframes = -1
Outputs a filter graph when processing a specified frame. The cache size and memory usage of each filter at that time are output together. This is useful when you want to know the memory usage of each filter. If it is -1, it will be output when DumpFilterGraph is called (before the frame is processed).
bool  repeat = false
Only valid if nframes> 0. Outputs a repeating filter graph at nframes intervals.

Related Links

Original documentation (in Japanese) of Neo fork by Nekopanda
Personal tools