From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2084C48689 for ; Wed, 13 Dec 2023 16:28:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4064D68D20E; Wed, 13 Dec 2023 18:28:24 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A9A2D68CF76 for ; Wed, 13 Dec 2023 18:28:17 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 5ABF02405ED; Wed, 13 Dec 2023 17:28:17 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id k85yikvAJURY; Wed, 13 Dec 2023 17:28:16 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 7FC972400AC; Wed, 13 Dec 2023 17:28:16 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 5EA831601B9; Wed, 13 Dec 2023 17:28:16 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20231211150725.46473-1-thilo.borgmann@mail.de> <20231211150725.46473-3-thilo.borgmann@mail.de> <170246885429.8914.10051704276943894799@lain.khirnov.net> <170246928230.8914.12754643765966025844@lain.khirnov.net> <170247117981.8914.16828787197695281420@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches , Thilo Borgmann Date: Wed, 13 Dec 2023 17:28:16 +0100 Message-ID: <170248489636.8914.14641721027481345642@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg: move parsing of -stats_* specifiers to lavu/parseutils X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Thilo Borgmann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Thilo Borgmann via ffmpeg-devel (2023-12-13 13:50:09) > Am 13.12.23 um 13:39 schrieb Anton Khirnov: > > Quoting Thilo Borgmann via ffmpeg-devel (2023-12-13 13:15:27) > >> Am 13.12.23 um 13:08 schrieb Anton Khirnov: > >>> Quoting Thilo Borgmann via ffmpeg-devel (2023-12-13 13:05:35) > >>>> Am 13.12.23 um 13:00 schrieb Anton Khirnov: > >>>>> Quoting Thilo Borgmann via ffmpeg-devel (2023-12-11 16:07:22) > >>>>>> --- > >>>>>> fftools/ffmpeg.h | 31 +------ > >>>>>> fftools/ffmpeg_enc.c | 3 +- > >>>>>> fftools/ffmpeg_mux_init.c | 152 +++----------------------------- > >>>>>> libavutil/parseutils.c | 176 ++++++++++++++++++++++++++++++++++++++ > >>>>>> libavutil/parseutils.h | 102 ++++++++++++++++++++++ > >>>>>> libavutil/version.h | 2 +- > >>>>>> 6 files changed, 296 insertions(+), 170 deletions(-) > >>>>> > >>>>> Absolutely not. > >>>>> > >>>>> This is application code and does not belong in the libraries. > >>>> > >>>> How else do we not have a redundant copy of all that and make sure that -stats_* options and the filter understand the same {..} directives? > >>> > >>> Why does that filter need to understand the same directives? No other > >>> filter does. > >> > >> Because it is meant to use the file(s) the -stats_* option writes out. The most convenient and most error resilient way is to use the very same format string for -stats_* option as well as for the filter. > >> > >> Otherwise it could be a 'usual' scanf-format, but then the user has to translate it from one format into the other - without making mistakes. > >> But that would also mean to update the filter (if someone realizes it) if the option ever changes. > > > > Why does it need a dynamic format at all? Just postulate a fixed format > > for its input like every other filter and none of this complexity is > > needed. > > That would unnecessarily limit the user of the -stats_* option to a > specific format if the user also wants to use this filter later. > Either sacrificing the other info the user wanted to process from the > file created or having to run the same command (with distinct format > strings for the -stats_* option) twice. Or do the conversion from his > extensive format into the fixed format manually - without errors. It is bad practice to design library features around the needs and limitations of a single specific caller. Many of the directives supported by -stats* make sense only in the context of the ffmpeg CLI, and we may want to add many more in the future. We definitely do not want to hardcode them into libavutil public API. If the problem is limiting ffmpeg CLI users to a specific stats format, then you could extend these options to allow writing multiple stats files with different formats. -- Anton Khirnov _______________________________________________ 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".