[PATCH 2/2] Implement -vfilters_file option in ffplay.

Stefano Sabatini stefano.sabatini-lala
Tue Mar 30 00:55:06 CEST 2010


---
 doc/ffplay-doc.texi |    2 ++
 ffplay.c            |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/doc/ffplay-doc.texi b/doc/ffplay-doc.texi
index 11794b2..22466a3 100644
--- a/doc/ffplay-doc.texi
+++ b/doc/ffplay-doc.texi
@@ -55,6 +55,8 @@ Force format.
 Set window title (default is the input filename).
 @item -loop @var{number}
 Loops movie playback <number> times. 0 means forever.
+ at item -vfilters_file @var{filename}
+Reads the graph description to use for filtering from @var{filename}.
 @end table
 
 @section Advanced options
diff --git a/ffplay.c b/ffplay.c
index f3a076b..c2af912 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2920,6 +2920,14 @@ static int opt_debug(const char *opt, const char *arg)
     return 0;
 }
 
+static int opt_vfilters_file(const char *opt, const char *arg)
+{
+    size_t size;
+    if (vfilters)
+        av_free(vfilters);
+    return read_file(arg, &vfilters, &size);
+}
+
 static int opt_vismv(const char *opt, const char *arg)
 {
     debug_mv = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
@@ -2973,6 +2981,7 @@ static const OptionDef options[] = {
     { "window_title", OPT_STRING | HAS_ARG, {(void*)&window_title}, "set window title", "window title" },
 #if CONFIG_AVFILTER
     { "vfilters", OPT_STRING | HAS_ARG, {(void*)&vfilters}, "video filters", "filter list" },
+    { "vfilters_file", OPT_FUNC2 | HAS_ARG, {(void*)opt_vfilters_file}, "read the video filters from a file", "filename" },
 #endif
     { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" },
     { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
-- 
1.7.0


--cvVnyQ+4j833TQvp--



More information about the ffmpeg-devel mailing list