[FFmpeg-devel] [PATCH v5 2/3] avdevice/lavfi: support the dumpgraph with options

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sun May 24 03:42:49 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 doc/indevs.texi     | 15 +++++++++++++--
 libavdevice/lavfi.c |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 6f5afaf..7ec7062 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -973,8 +973,13 @@ Set the filename of the filtergraph to be read and sent to the other
 filters. Syntax of the filtergraph is the same as the one specified by
 the option @var{graph}.
 
- at item dumpgraph
-Dump graph to stderr.
+ at item dumpgraph @var{options}
+Dump graph to stderr with more options
+
+options is a ':'-separated list of @var{key=value} pairs.
+
+Set the graph with graphviz DOT format by @var{fmt=dot|DOT},
+set the filename of filtergraph to output by @var{filename=path}.
 
 @end table
 
@@ -988,6 +993,12 @@ ffplay -f lavfi -graph "color=c=pink [out0]" dummy
 @end example
 
 @item
+dump the filter graph with graphviz DOT output format to ./test.tmp
+ at example
+ffplay -dumpgraph fmt=dot:filename=./test.tmp -f lavfi color=c=pink
+ at end example
+
+ at item
 As the previous example, but use filename for specifying the graph
 description, and omit the "out0" label:
 @example
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index c949ff7..fa75fde 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -493,7 +493,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
 static const AVOption options[] = {
     { "graph",     "set libavfilter graph", OFFSET(graph_str),  AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
     { "graph_file","set libavfilter graph filename", OFFSET(graph_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC},
-    { "dumpgraph", "dump graph to stderr",  OFFSET(dump_graph), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+    { "dumpgraph", "dump graph to stderr with more options",  OFFSET(dump_graph), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
     { NULL },
 };
 
-- 
2.6.4



More information about the ffmpeg-devel mailing list