Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Nicolas George <george@nsup.org>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/5] fftools: add -lavfi_dump option
Date: Wed,  2 Mar 2022 19:40:20 +0100
Message-ID: <20220302184023.285022-2-george@nsup.org> (raw)
In-Reply-To: <20220302184023.285022-1-george@nsup.org>

Signed-off-by: Nicolas George <george@nsup.org>
---
 doc/ffmpeg.texi         |  4 ++++
 fftools/ffmpeg.h        |  1 +
 fftools/ffmpeg_filter.c | 14 ++++++++++++++
 fftools/ffmpeg_opt.c    |  3 +++
 4 files changed, 22 insertions(+)


Unchanged since last summer.


diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 164419cad3..1f6c416390 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1864,6 +1864,10 @@ The default is the number of available CPUs.
 Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
 outputs. Equivalent to @option{-filter_complex}.
 
+@anchor{lavfi_dump option}
+@item -lavfi_dump (@emph{global})
+Dump the filter graphs and their negotiated formats to standard output.
+
 @item -filter_complex_script @var{filename} (@emph{global})
 This option is similar to @option{-filter_complex}, the only difference is that
 its argument is the name of the file from which a complex filtergraph
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index cc8f767e5d..4b81cc19fa 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -635,6 +635,7 @@ extern char *filter_nbthreads;
 extern int filter_complex_nbthreads;
 extern int vstats_version;
 extern int auto_conversion_filters;
+extern int dump_filtergraphs;
 
 extern const AVIOInterruptCB int_cb;
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index b80d7189db..33ed91bf63 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1070,6 +1070,20 @@ int configure_filtergraph(FilterGraph *fg)
         avfilter_graph_set_auto_convert(fg->graph, AVFILTER_AUTO_CONVERT_NONE);
     if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
         goto fail;
+    if (dump_filtergraphs) {
+        char *dump = avfilter_graph_dump(fg->graph, "f=tech");
+        if (!dump)
+            return AVERROR(ENOMEM);
+        if (simple) {
+            OutputStream *ost = fg->outputs[0]->ost;
+            printf("Dump of filter graph for output #%d:%d:", ost->file_index, ost->index);
+        } else {
+            printf("Dump of complex filter graph #%d:", fg->index);
+        }
+        printf("\n\n%s\n", dump);
+        av_free(dump);
+        fflush(stdout);
+    }
 
     fg->is_meta = graph_is_meta(fg->graph);
 
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index bf1bbcae4c..9b09917bb3 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -167,6 +167,7 @@ char *filter_nbthreads;
 int filter_complex_nbthreads = 0;
 int vstats_version = 2;
 int auto_conversion_filters = 1;
+int dump_filtergraphs = 0;
 int64_t stats_period = 500000;
 
 
@@ -3670,6 +3671,8 @@ const OptionDef options[] = {
         "number of threads for -filter_complex" },
     { "lavfi",          HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_filter_complex },
         "create a complex filtergraph", "graph_description" },
+    { "lavfi_dump",     OPT_BOOL | OPT_EXPERT,                       { &dump_filtergraphs },
+        "dump filter graphs to standard output" },
     { "filter_complex_script", HAS_ARG | OPT_EXPERT,                 { .func_arg = opt_filter_complex_script },
         "read complex filtergraph description from a file", "filename" },
     { "auto_conversion_filters", OPT_BOOL | OPT_EXPERT,              { &auto_conversion_filters },
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-03-02 18:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 18:40 [FFmpeg-devel] [PATCH 1/5] lavfi/graphdump: add plain listing output Nicolas George
2022-03-02 18:40 ` Nicolas George [this message]
2022-03-02 18:40 ` [FFmpeg-devel] [PATCH 3/5] lavfi/(a)format: factor finding the delimiter Nicolas George
2022-03-02 18:40 ` [FFmpeg-devel] [PATCH 4/5] lavfi/(a)format: support slash as a delimiter Nicolas George
2022-03-02 18:40 ` [FFmpeg-devel] [PATCH 5/5] tests: add coverage for libavfilter's format negotiation Nicolas George
2022-03-03 18:22   ` Paul B Mahol
2022-03-03 18:31   ` James Almer
2022-03-03 18:37     ` Nicolas George
2022-03-04  1:45 ` [FFmpeg-devel] [PATCH 1/5] lavfi/graphdump: add plain listing output Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220302184023.285022-2-george@nsup.org \
    --to=george@nsup.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git