From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id BB9224B867
	for <ffmpegdev@gitmailbox.com>; Wed, 26 Mar 2025 22:52:47 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 40556687BF0;
	Thu, 27 Mar 2025 00:52:43 +0200 (EET)
Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com
 [209.85.221.47])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E505687B9F
 for <ffmpeg-devel@ffmpeg.org>; Thu, 27 Mar 2025 00:52:36 +0200 (EET)
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-391342fc1f6so234763f8f.1
 for <ffmpeg-devel@ffmpeg.org>; Wed, 26 Mar 2025 15:52:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743029555; x=1743634355; darn=ffmpeg.org;
 h=user-agent:in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject
 :date:message-id:reply-to;
 bh=KYuDE/yo/f/klj5Hw8/VhjgNZFG5NQv0kpKpFsOvtHg=;
 b=iMc5G69XzjAqihfYlopW2WDtXrOHZ2qP1PLw6L3gcfO+PrP/7d4bjS7yrdR1SYr05a
 aUIy1jOtArz4C3q/F51+G2X5NL890/Q7THQt0nRZVpLctJli7CknCuOyT/nBpAK+mR7j
 xwGOcvWjoRZ/dc698iXZOVjY8AvYcrbxaAjgBo88qCO6DR084W65T3y+qxBA59YxqrIh
 zRy8PWwA/bCUVBo7eYZQlppKR4mLXjMe2ZdW15+LuMNKGrCacIFZB/GoqHg+VkkpSMmf
 17MhUSnqzDe5INLtgt3jsa4qurRNBkJvc0lxVA6KETg6T9T9SXoWJk/yjNOViXT2yPRn
 byYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743029555; x=1743634355;
 h=user-agent:in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=KYuDE/yo/f/klj5Hw8/VhjgNZFG5NQv0kpKpFsOvtHg=;
 b=f6fFax0Nmf1oakjgxJs/tM/fa5H9IMeEbGQBLoTXEZgsuT4bQ/JyUHLmbSquNYDtPT
 dnYlI94cBK/mTEUHG7m7MClU2ngk10h9EYMmRKD/jdJJJN8ZmC7MJ1pN7RLkqotaFAJN
 buNj78TadIthMUIek417tGkDLVQPAq9uN9LYxFYzlBxJUiqmJZczzJVEsy0Hdxf5E2pT
 U8hTEov+J3A0qBCmjv/kBuTF3hSaJWEAJUXWA8NHc+HNTmboCPXYRnvoB1agkDMjNihX
 OF3LfOECFAHzq7lZ81nGRF/eZJXeKrEKQjlpRs47COP5pF5t2r71ruChVc64jCBRe1ei
 ZBrg==
X-Gm-Message-State: AOJu0Yy5Xfzznl0P20WHb29E//I+eY6ZJpaqgcmy+nxYMTczF6reNHfZ
 S5atwK5CMYG9Iv3gEBXwX4x/M3tP70UtvhQzHIfHF54AUQoZW612KiBQSA==
X-Gm-Gg: ASbGnct06LNIKPPGKPBLfgm7+lYCHdhECwr77KQZ/2JD+0chomNby3eDr1f2ea5fHAI
 YpSDqhO9GE1igV9iwfZQYbRyyxb2xPG66n1noxubh0B1bExi9T+WUuoQMXwtVM6a2c2liFI/CgT
 MyE8bK6ociBHHqGtDDlzcW90u8dXqn8HoV8hzVcJmkbZ1eiiBRsUJPzfG5x6y006NYtKfzqSaip
 nudEiSmFjwQWcj2I3sPXLuM0LsxLbZBI1NmqVeveLiBM/FGbWqGOnJ61FHmXYBHOHoCgTMfLU5j
 fUy8Nqm7uhJsF6Y8T8CBZrvN5PEI2mr32NkaLKcRGmFup8U0f6qieFdoK3kfDPvuP+RmmPkrT4M
 UIrNiKx25
X-Google-Smtp-Source: AGHT+IECf/DTPeF1FJrGAFOwbCbH/OuLsosPzUYK/ZmKWL4HHyJd+sT5NCYWcp9VbwzkC2QkY646kQ==
X-Received: by 2002:a5d:6d0c:0:b0:391:952:c758 with SMTP id
 ffacd0b85a97d-39ad173cfe7mr939763f8f.6.1743029555268; 
 Wed, 26 Mar 2025 15:52:35 -0700 (PDT)
Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it.
 [84.220.189.10]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3997f9ef098sm17731983f8f.84.2025.03.26.15.52.33
 for <ffmpeg-devel@ffmpeg.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 26 Mar 2025 15:52:33 -0700 (PDT)
Received: by mariano (Postfix, from userid 1000)
 id 941C0BFCE8; Wed, 26 Mar 2025 23:52:30 +0100 (CET)
Date: Wed, 26 Mar 2025 23:52:30 +0100
From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <Z+SFLmfGERrM6a70@mariano>
Mail-Followup-To: FFmpeg development discussions and patches
 <ffmpeg-devel@ffmpeg.org>
References: <DM8P223MB0365AB64AECCC838CF7CB41DBADE2@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
 <Z92viSTlKU0La9Ua@mariano>
 <DM8P223MB036550001F5BE5292F899C3FBADB2@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <DM8P223MB036550001F5BE5292F899C3FBADB2@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
User-Agent: Mutt/2.1.4 (2021-12-11)
Subject: Re: [FFmpeg-devel] [RFC] FFmpeg Execution Graph Visualization
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/Z+SFLmfGERrM6a70@mariano/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

On date Friday 2025-03-21 20:11:29 +0000, Soft Works wrote:
[...]
> > What it's not clear to me is how this builds up on top of text
> > formatters, since they are meant to render a tree structure in a
> > generic way. From this you can have a description of a graph, but then
> > you need specialized ad-hoc logic to convert it to a graph format.
> > 
> > What am I missing?
> 
> 
> Hehe, that's been a bit tricky indeed, but more in terms of figuring
> out that (and how) it can fit into the writer/textformatter
> patterns, the result is rather simple and it requires only some
> moderate extensions to the writer/formatter APIs:
> 
> 
> It is using a Mermaid Flowchart graph with only 3 kinds of elements:
> 
> - Shapes
>   i.e. "boxes", can't be nested
> - Subgraphs
>   Container for shapes, can be nested
> - Links
>   connection from one shape to another
> 
> 
> A simple graph with 2 shapes in a subgraph looks like this:
> 
> ...
> flowchart TD
>  subgraph s1["Subgraph 1"]
>         A("Shape A") --> B("Shape B")
>   end
> ...
> 
> There's a link from A to B - but: it can also be written in a different way:
> 
> ...
> flowchart TD
>  subgraph s1["Subgraph 1"]
>         A("Shape A")
>         B("Shape B")
>   end
> 
>   A --> B
> ...
> 
> This does the same thing. The link definitions can be at a different
> place in the document - which is one of the key points to make it
> work.
> 
> Then there are three new section flags to denote subgraph, shapes
> and links and two fields in the section struct (source_id_key,
> dest_id_key). For link-producing sections they indicate the names of
> the keys to use for building a link. A section can also produce both
> - shapes and links when the flags are set accordingly.  I also use
> another (existing) mechanism, which is the data object that can be
> provided on section start, only that it's a (publicly) defined
> "SectionContext" struct, which is a somewhat alternative
> direction.

So basically a graph can be represented as a collection of subraphs,
each subgraphs containing shapes, and links.

> I kept it for the moment as suggestion because I didn't
> know which ideas you have for the API to evolve, so that's just
> something for discussion.

One of the possible uses is to expose the data printed by
filters. E.g. detection filters are printing the information either in
the stderr using custom formats, this should really be converted to
something easier to consume (whatever formats for which you don't
need a custom parser).

The metadata muxer also might benefit from using a text writer, to
avoid again the need for a custom parser, and probably there are more
use cases easy to spot.

So at some point we want to make this API accessbile from the
libraries, that is to move them into libavutil. Again, it's fine to
expose this at the tools level first so we can experiment and refine
the interface before moving to a stable one.
_______________________________________________
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".