From patchwork Fri Aug 14 17:14:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 21663 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 73BE544AC3B for ; Fri, 14 Aug 2020 20:15:02 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4BB0968AF49; Fri, 14 Aug 2020 20:15:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B92C687FF4 for ; Fri, 14 Aug 2020 20:14:56 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 07EHEt7R007586 for ; Fri, 14 Aug 2020 19:14:55 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 6D77AE00EA; Fri, 14 Aug 2020 19:14:55 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 Aug 2020 19:14:52 +0200 Message-Id: <20200814171453.778664-1-george@nsup.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 14 Aug 2020 19:14:55 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/2] ffmpeg: add disable_all_auto_conversion_filters option. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Nicolas George --- doc/ffmpeg.texi | 5 +++++ fftools/ffmpeg.h | 1 + fftools/ffmpeg_filter.c | 2 ++ fftools/ffmpeg_opt.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 267ddfe8b5..1603431d56 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1746,6 +1746,11 @@ this buffer, in packets, for the matching output stream. 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. +@item -disable_all_auto_conversion_filters (@emph{global}) +Disable automatically inserting conversion filters in all filter graphs, +including those defined by @option{-vf}, @option{-af}, +@option{-filter_complex} and @option{-lavfi}. + @end table As a special exception, you can use a bitmap subtitle stream as input: it diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 6e3f2545c7..acd297c8e8 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -613,6 +613,7 @@ extern char *videotoolbox_pixfmt; extern int filter_nbthreads; extern int filter_complex_nbthreads; extern int vstats_version; +extern int disable_all_auto_conversion_filters; extern const AVIOInterruptCB int_cb; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 4784e8a575..8721403d7a 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1104,6 +1104,8 @@ int configure_filtergraph(FilterGraph *fg) configure_output_filter(fg, fg->outputs[i], cur); avfilter_inout_free(&outputs); + if (disable_all_auto_conversion_filters) + avfilter_graph_set_auto_convert(fg->graph, AVFILTER_AUTO_CONVERT_NONE); if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0) goto fail; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 853550a142..e6131dac97 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -172,6 +172,7 @@ float max_error_rate = 2.0/3; int filter_nbthreads = 0; int filter_complex_nbthreads = 0; int vstats_version = 2; +int disable_all_auto_conversion_filters = 0; static int intra_only = 0; @@ -3545,6 +3546,8 @@ const OptionDef options[] = { "create a complex filtergraph", "graph_description" }, { "filter_complex_script", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex_script }, "read complex filtergraph description from a file", "filename" }, + { "disable_all_auto_conversion_filters", OPT_BOOL | OPT_EXPERT, { &disable_all_auto_conversion_filters }, + "create a complex filtergraph", "graph_description" }, { "stats", OPT_BOOL, { &print_stats }, "print progress report during encoding", }, { "attach", HAS_ARG | OPT_PERFILE | OPT_EXPERT |