[FFmpeg-devel] [PATCH 1/3] ffmpeg: make -lavfi an alias for -filter_complex.

Nicolas George nicolas.george at normalesup.org
Sun Mar 17 13:42:26 CET 2013

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
 doc/ffmpeg.texi |    7 +++++++
 ffmpeg_opt.c    |    2 ++
 2 files changed, 9 insertions(+)

Le septidi 27 ventôse, an CCXXI, Stefano Sabatini a écrit :
> Doc updates missing.


> Also I note that "lavfi" is not very descriptive, a possible better
> alternative -filter_graph (which is not so much better than
> -filter_complex) or -fg if you want to keep it short (but which is
> even less descriptive).
> OTOH the name of the "lavfi" device was choosen to be coupled with the
> library, so it would make sense to keep it also for a corresponding
> filtering graph option (which basically relies on the same library) so
> I don't object the change, even if I find a bit weird to give the name
> of a library to an option.

I had mostly the same thoughts when considering this patch; I hesitated for
a long time, but this seems like the best choice with regard to habit (-f
lavfi -i ...), merge problems avoidance, etc.

New patch series, with a FATE test.


  Nicolas George

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 9848e0d..00c9b25 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -167,6 +167,8 @@ Complex filtergraphs are configured with the @option{-filter_complex} option.
 Note that this option is global, since a complex filtergraph by its nature
 cannot be unambiguously associated with a single stream or file.
+The @option{-lavfi} option is equivalent to @option{-filter_complex}.
 A trivial example of a complex filtergraph is the @code{overlay} filter, which
 has two video inputs and one video output, containing one video overlaid on top
 of the other. Its audio counterpart is the @code{amix} filter.
@@ -1032,6 +1034,11 @@ To generate 5 seconds of pure red video using lavfi @code{color} source:
 ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
 @end example
+ at item -lavfi @var{filtergraph} (@emph{global})
+Define a complex filter graph, i.e. one with arbitrary number of inputs and/or
+outputs. Equivalent to @option{-filter_complex}.
 @end table
 As a special exception, you can use a bitmap subtitle stream as input: it
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 728d474..4b2cfeb 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2603,6 +2603,8 @@ const OptionDef options[] = {
         "reinit filtergraph on input parameter changes", "" },
     { "filter_complex", HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_filter_complex },
         "create a complex filtergraph", "graph_description" },
+    { "lavfi",          HAS_ARG | OPT_EXPERT,                        { .func_arg = opt_filter_complex },
+        "create a complex filtergraph", "graph_description" },
     { "stats",          OPT_BOOL,                                    { &print_stats },
         "print progress report during encoding", },
     { "attach",         HAS_ARG | OPT_PERFILE | OPT_EXPERT |

More information about the ffmpeg-devel mailing list