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 ESMTPS id 4DD904D9AE for ; Thu, 27 Feb 2025 13:11:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0C0D068CA9F; Thu, 27 Feb 2025 15:11:51 +0200 (EET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2041.outbound.protection.outlook.com [40.92.22.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E93268C77A for ; Thu, 27 Feb 2025 15:11:44 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DJ7WGp+1jgTijDC9uUzs66rj/4OUg14cRaYf0fkmUF7VxiklgKI9sibPFXvTrnLiB/Nspf3AzrDEo+BpDpFM3Kwod7F8RsZsuPAgwtQ8XsmggUt2H6ww3eZTNs/nMeZILSxP+4aTofHH+wv9QNWBnx/PHf3HLHuFNGTzhvCKjyKtTH1Fzf2bmJFGScAQNU7qhLKJzlSAyAetNX1NxHm+EoLys+72mKI3QLlFc7aHbvaPLPiT4MBiVqs5Vrin99wbCbjzoEpTNO/Sxk8VgClMfqF8DhFOmjPBWOH7DXkTn2C8wdOhw8cchrIeH7aln/sQcv+EtXWC36EM1kflguKjSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vglRrGaWYxdxGGf59sdMZcuuYebZdsXhBPXr/WaGe6E=; b=MmzhUqMMGbs6NBIwQmlw865NPzQvjRD6oxJfqKEN07wcLFELrWtQXiR/wEErXmAMLbF9cB/LHGITiJ4soBRDmfYi3U1LqSNzdaS+Wy+Iltr2cpmjkbuoDGxO3zUFj8B3tmahisLj/TmbdRh7deMqSkwaxx0lWF7fnZ9HNsYWcUvP+VC+Q3VJ4BBalEATxNhPAAW7bA/uET4FpWZk1g7EJm2I9ueZk5JPTN3QVkGkDrBWwicK03cKVARufCjMt0u1pwZhNv3fBm5gb7kCVrQwgno4dLZc099Q9P2qEPlZ5eGGnnFC7Wcp0eQVfywDk28djnn11zNCmV4NXdGJnBL/Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vglRrGaWYxdxGGf59sdMZcuuYebZdsXhBPXr/WaGe6E=; b=YnUvfydG82Q1nP5DwGPiVpn2RJaU1h5vAmyRSEb4/TXSHzh6A/NUEHX3u7OF5ArYC3XkVJwGc1BtB2z7WIj3QJJDgGFZ2rhnsVJEW7HADIGU04Zv2ftBm2tydeeiIJS+wbcHVuMGIzzqDrhW8cvTeXLq/dRlcUCvE6GRQYFiy9TCzrk8cYg3E0XBcJM68fFTpRTZW/QaJDG/YnMipHEovrjYUx1F5BhjsWM0xL5rJF+TRHlzAWR0RDRMJh25nYhaTsZrPhJVhJ1HNhzpvRhc02YCwttadC5mydL/q+FdvDxz+lvkKmBMMihxus8kSyB/CdcHZJQv+8JG84bzlfUqmw== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DM8P223MB0143.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.21; Thu, 27 Feb 2025 13:11:41 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::bf09:8e9:b07f:98a7]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::bf09:8e9:b07f:98a7%7]) with mapi id 15.20.8489.021; Thu, 27 Feb 2025 13:11:41 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_graphprint: Add options for filtergraph printing Thread-Index: AQHbgrT8d1+trcFiaU+SbAzXkjfWmbNRvlaAgAACe9CABIr6gIAAKSRggAM/CACAAA42EA== Date: Thu, 27 Feb 2025 13:11:41 +0000 Message-ID: References: <0750b971f9ae0fc38917e0a3b3ccb7ad2e8cd221.1739959172.git.ffmpegagent@gmail.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8P223MB0365:EE_|DM8P223MB0143:EE_ x-ms-office365-filtering-correlation-id: a34a6bc4-4f69-4d95-2f6f-08dd57304694 x-microsoft-antispam: BCL:0; ARA:14566002|8060799006|7092599003|8062599003|19110799003|15080799006|461199028|8022599003|3412199025|440099028|12091999003|102099032; x-microsoft-antispam-message-info: =?us-ascii?Q?8MHa2Z3IIaYbRY3CrDzZV4nlzJ5Ib0OQDTbhwjswKwIhvu63ohwTnU9hOmvk?= =?us-ascii?Q?fytGs8b39C8iV/hs8eTZHwn+/iTUsKw4JJNDrsUlJIMdlCUnknSaAFgSqV7t?= =?us-ascii?Q?cWFRGMZOGmoh6CtgbkAO8AlUCtLz0ZiOqiPHbLjx/5v7+dohckpbMzE/CK52?= =?us-ascii?Q?+HpCeTYH2+exOGNYfJ9zEePbl14LMpK2lZuYuOeYdetwghGixYzFVcW1rtw2?= =?us-ascii?Q?05/OOmMrXSnAToCWbtdA4L56shasgF0bWs+HQ+9C8MIWu7tuAfDlvWEN5/51?= =?us-ascii?Q?JXx7nmMHefvkAnOoBiUFjcavLank3SBymhVCeaspGiyxzq1uH/FUAAt1LmSG?= =?us-ascii?Q?VyJqGJEb3hOzkFnPRDFaypbRR8DBfCMpK+jmsfuNXf8/mBeyvxI2/BKwyVjy?= =?us-ascii?Q?xkBFepnPl9ODJqe1G/qwQWmys51E0GyZKvP9Zr4n7pSDGhom7uDfxn9rMLlT?= =?us-ascii?Q?08YzmuhbwYL56miUlAKC8s39CoIoTYdMGvwwbyryAl8Lf7EbP3RtcDNhmYkV?= =?us-ascii?Q?zH8vYGCofgnF8g89eEgRGVKl+fv5a/QYXl0YdSDfgRqUQv8N5zgmyLYjkmnn?= =?us-ascii?Q?3PrTcvhzoNtdWbu7CbNMZjchf0v966OosCNQqfu4TwByYNv4Y6QXorIEYJDI?= =?us-ascii?Q?BnnA8MwE2zTtkFw7+egIp0VU7tIovSE7v7R9PuFoXi/sBC/jcxTnPUFhlDhH?= =?us-ascii?Q?3M4sILjKW7bBJOQX6kpunGMOc9EFbxrxqSKl4tHBqmaNt+nkojOIaqLPdmuJ?= =?us-ascii?Q?/NA3P2jVxeFpiMj4OnyJ+zkwTbaTdb6nKXcx34fs7ipwEUSTogQoDYouvsfN?= =?us-ascii?Q?V02MYl2pCjIA16UZVjnWWirWn4IPFOkYmlp5ETdg6R6nbJWK0mVbRW9FNmPG?= =?us-ascii?Q?PaPFIPRZtfU6yxHpevr87pdfqrbtB3FRu56ws6TnJOoB+FlppT/m+oZTiPwV?= =?us-ascii?Q?nYq/kdCwkfSyVyrOnRmDA/7GxE3//WVT4RvjVrUWap8Yclc3YEiWlVv2mfVn?= =?us-ascii?Q?zVC2EWJupADbhYQekOkJ7paMD4CFp/hOO1I4i+2lbDb7JpxEZPQ0E+DVmgGu?= =?us-ascii?Q?bO4HB8lCKfV/N/4kIlF4+j5/AME07CegnPOr8CMy+xSn7Uruh077J/wxVZI2?= =?us-ascii?Q?vTPjqh+c8lydh3OkY1Ju7VG7T3NMkVV0ZA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?r7Mqw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0J?= =?us-ascii?Q?mFhH1TK+a8ArkhDHUL+2ncDvKBWjNQ7VzVSxQ779o7dO+wPZl7iiSAxT+3Mp?= =?us-ascii?Q?UDvIHfO/nO7HAbSBQFdC+WNs24fu+jqTcv2WKAWsCzCZ52dmqBZ1uQ47SIV3?= =?us-ascii?Q?HFaEXMIIo/8rsZPYah+/C1RjixP35XxqpypmcMzkTjds13ioAO7XjyDJtLlz?= =?us-ascii?Q?alHAtKEd1H6G+tcbKM+AsHBrh6a14DnEjFPBfMy4DwM+vgHsBuGCOQ3X59XL?= =?us-ascii?Q?vAshextFYg3SNz8cp3/0G9ecJDy4OIwdJJbHdHnwFazbWJxYSWox09p55Pvh?= =?us-ascii?Q?nd+x2IR392uxJTBQ0HzprhUrnIegQdCIuNTB9Z9G8KvlRzLfZQ5Jf39KeZw?= =?us-ascii?Q?=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-92255.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a34a6bc4-4f69-4d95-2f6f-08dd57304694 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2025 13:11:41.0458 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8P223MB0143 Subject: Re: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_graphprint: Add options for filtergraph printing 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 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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of > Nicolas George > Sent: Mittwoch, 26. Februar 2025 15:43 > To: FFmpeg development discussions and patches devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH 2/3] fftools/ffmpeg_graphprint: Add > options for filtergraph printing > > Soft Works (HE12025-02-24): > > Accepted. I'll outfactor the writers first. It's a valid point of course; > > I just wasn't sure whether you would dislike me doing it. > > I dislike the fact that it will be done on top of a pedestrian or clumsy > strings API, but I know precisely where to lay the blame for that > absurdity and it is not you. > > > Should each writer go into a separate code file, or all in one? > > The writers in ffprobe are an ad-hoc construction to turn the shallow > data structures produced by ffprobe into a common denominator of JSON, > XML, CSV and a few custom formats. It is not a good candidate to be > turned into an API. > > The writes make arbitrary decisions about how the data will be > represented. Not much in JSON, but for XML the choices of what is an > attribute and what is an element are very arbitrary. The XML writer in > ffprobe cannot output any (basic) XML file. > > That part of the code is not duplicated in your patch anyway. What is > duplicated is the low-level code. So this is where you would be better > off starting. > > That would mean something like this: > > Move the low-level JSON writing code into lavu, with a low-level API > specific to JSON. Bonus points if the API can be used without dynamic > allocations when the data structure is not too deep. > > Use the newly introduced av_json_write API in ffprobe; the JSON writer > becomes a trivial wrapper around it. > > Also use it in your patch. > > Later, possibly somebody else: do the same with XML. The low-level API > will need to be a little more complex, because XML has more room for > tweaks. > > At some point in the future: unify the JSON, XML and other writers in > libavutil under a common API, but one that can be tweaked for any kind > of input data structure, not just a list of streams/packets/frames with > flat attributes. HI Nicolas, thanks a lot for your advice. I've looked into extracting only the JSON part, but it has a number of things which are specific to the usage in ffprobe and I felt that it doesn't allow for a clean solution when trying to keep the behavior and create a clean API in avutil at the same time. Also, the JSON code is just a small part. The big elephant is the core code, like you said and I so I chose to grab this thing at the root and fully generalize that code. I have done it in a way that it's a public API in avutil, foremost in order to be sure that it's fully clean and independent. I'm not insisting that it has to be public. It's surely not there where you like to have it, but I think it might serve as better basis for that. Maybe the code can just live in fftools for the time being and serve both, ffprobe and ffmpeg (graph printing)? Please let me know what you think. Thanks sw _______________________________________________ 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".