ffmpeg: add auto_conversion_filters option.

pull/350/head
Nicolas George 4 years ago
parent 0d942357f6
commit 697fb09e3d
  1. 10
      doc/ffmpeg.texi
  2. 1
      fftools/ffmpeg.h
  3. 2
      fftools/ffmpeg_filter.c
  4. 3
      fftools/ffmpeg_opt.c

@ -1746,6 +1746,16 @@ this buffer, in packets, for the matching output stream.
The default value of this option should be high enough for most uses, so only The default value of this option should be high enough for most uses, so only
touch this option if you are sure that you need it. touch this option if you are sure that you need it.
@item -auto_conversion_filters (@emph{global})
Enable automatically inserting format conversion filters in all filter
graphs, including those defined by @option{-vf}, @option{-af},
@option{-filter_complex} and @option{-lavfi}. If filter format negotiation
requires a conversion, the initialization of the filters will fail.
Conversions can still be performed by inserting the relevant conversion
filter (scale, aresample) in the graph.
On by default, to explicitly disable it you need to specify
@code{-noauto_conversion_filters}.
@end table @end table
As a special exception, you can use a bitmap subtitle stream as input: it As a special exception, you can use a bitmap subtitle stream as input: it

@ -613,6 +613,7 @@ extern char *videotoolbox_pixfmt;
extern int filter_nbthreads; extern int filter_nbthreads;
extern int filter_complex_nbthreads; extern int filter_complex_nbthreads;
extern int vstats_version; extern int vstats_version;
extern int auto_conversion_filters;
extern const AVIOInterruptCB int_cb; extern const AVIOInterruptCB int_cb;

@ -1104,6 +1104,8 @@ int configure_filtergraph(FilterGraph *fg)
configure_output_filter(fg, fg->outputs[i], cur); configure_output_filter(fg, fg->outputs[i], cur);
avfilter_inout_free(&outputs); avfilter_inout_free(&outputs);
if (!auto_conversion_filters)
avfilter_graph_set_auto_convert(fg->graph, AVFILTER_AUTO_CONVERT_NONE);
if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0) if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
goto fail; goto fail;

@ -172,6 +172,7 @@ float max_error_rate = 2.0/3;
int filter_nbthreads = 0; int filter_nbthreads = 0;
int filter_complex_nbthreads = 0; int filter_complex_nbthreads = 0;
int vstats_version = 2; int vstats_version = 2;
int auto_conversion_filters = 1;
static int intra_only = 0; static int intra_only = 0;
@ -3545,6 +3546,8 @@ const OptionDef options[] = {
"create a complex filtergraph", "graph_description" }, "create a complex filtergraph", "graph_description" },
{ "filter_complex_script", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex_script }, { "filter_complex_script", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex_script },
"read complex filtergraph description from a file", "filename" }, "read complex filtergraph description from a file", "filename" },
{ "auto_conversion_filters", OPT_BOOL | OPT_EXPERT, { &auto_conversion_filters },
"enable automatic conversion filters globally" },
{ "stats", OPT_BOOL, { &print_stats }, { "stats", OPT_BOOL, { &print_stats },
"print progress report during encoding", }, "print progress report during encoding", },
{ "attach", HAS_ARG | OPT_PERFILE | OPT_EXPERT | { "attach", HAS_ARG | OPT_PERFILE | OPT_EXPERT |

Loading…
Cancel
Save