Skip to content

Drawgraph

Video Single output Transform

Draw a graph using input video metadata.

FFmpeg filter: drawgraph — the official reference.

Add it to a graph. The explicit form works for every filter — bind it to its input and read the result from outputs():

$node = $video->addFilter(new Drawgraph(…));
$result = $node->outputs()[0];

Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:

$result = $video->apply(new Drawgraph(…));

TODO — when this filter shines: what it’s the right tool for, what to reach for instead when it isn’t, and how it composes with neighbouring filters.

TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).

TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.

TODO

TODO

ParameterTypeDefaultRange / valuesDescription
m1string——set 1st metadata key
fg1string0xffff0000—set 1st foreground color expression
m2string——set 2nd metadata key
fg2string0xff00ff00—set 2nd foreground color expression
m3string——set 3rd metadata key
fg3string0xffff00ff—set 3rd foreground color expression
m4string——set 4th metadata key
fg4string0xffffff00—set 4th foreground color expression
bgstringwhite—set background color
minfloat-1—set minimal value
maxfloat1—set maximal value
modeDrawgraphModelinebar, dot, lineset graph mode
slideDrawgraphSlideframeframe, replace, scroll, rscroll, pictureset slide mode
sizestring900x256—set graph size
ratestring25—set video rate

FFmpeg also names these options (use the parameter shown above): s → size, r → rate.


Maps to FFmpeg’s drawgraph filter. Verified against ffmpeg n7.1.1.

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.