From: "softworkz ." <softworkz-at-hotmail.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
Date: Wed, 30 Apr 2025 02:56:50 +0000
Message-ID: <DM8P223MB03659894B8CCA23652D7524FBA832@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <DM8P223MB0365CEB594A34DCD8FBDCD52BA802@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of softworkz .
> Sent: Dienstag, 29. April 2025 20:07
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
>
>
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Nicolas
> > George
> > Sent: Dienstag, 29. April 2025 10:31
> > To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
> >
> > Stefano Sabatini (HE12025-04-27):
> > > Elaborating on this. ffprobe/textformat is based on a notion of
> > > hierarchical tree-like data
> >
> > No, this is not true. FFprobe and all its supporting code is based on
> > one level of hierarchy. Just one level, not a real hierarchical
> > structure.
> >
> > > Considering this, there is probably no need to extend the API to cover
> > > each possible format full semantics - this at least it is my view.
> >
> > If we add XML-writing code in libavutil, it must be usable for all the
> > places we are already producing XML. Otherwise it does not make sense.
> >
> > > As I wrote, this was not the purpose of the ffprobe formats in the
> > > first place. MOV/DASH requires a specific use of an XML encoder. In
> > > theory it might be done using the textformat API in the current form,
> > > but it would be probably pretty awkward. We might want to factorize a
> > > few generic utilities (e.g. escaping) to avoid code duplication
> > > though.
> >
> > You are going at it backwards.
> >
> > The goal is not to cram this text writers API forcefully into libavutil
> > and then see if it might serve other purposes, which is what softworkz
> > is doing.
>
> No, this is not my intention. I thought I had laid it out a number of
> times already, but in case it didn't come through clearly, let me
> reiterate the agenda that I'm following and proposing:
>
>
> 1. Extract the text formatting from ffprobe.c and transform it into
> a generic API
>
> 2. Give that API a temporary home inside fftools as a staging area
>
> 3. Refine and polish the API inside fftools while adding additional
> use cases (like graph printing)
>
> 4. Brainstorm and discuss which further changes and refinements are
> needed to serve all the use cases that we are envisioning for the
> future and apply those changes
>
> 5. Move it to avutil once we believe that it's ready for this
>
>
> => 1 and 2 are done, 3 is in progress
>
> I'm not proposing to do 5 before 4.
>
>
> > The API must be able to handle all our use cases from the start. Until
> > then, it goes back to the design board.
>
> I never had any different intentions, albeit it can happen that there's
> some very specific case that it would not be able to serve.
>
> But it should be able to serve the vast majority of cases, that goes
> without saying.
>
>
> A fundamental point from my point of view though, is that the API
> must remain to be built around the sections concept at its core. It's
> a strong concept that enables the exchangeability of the text formatters
> independent from the individual use case. It has a number of
> shortcomings (as has been mentioned already) in terms of how certain
> data maps to the schema of individual formats, but there's sufficient
> room to extend the sections concept in a way that makes it possible
> to get better control of the way how it is represented in certain
> output formats (like XML).
>
> Being able to add new formats in a way that these become immediately
> available for all use cases is a high value that must not be
> sacrificed. Not every format makes sense for all use cases, but
> the ability to use all formats without any (or just little) extra
> work is (and must remain to be) a key capability of the API.
Additional thoughts:
[Stefano]
> > Considering this, there is probably no need to extend the API to cover
> > each possible format full semantics - this at least it is my view.
[Nicolas]
> If we add XML-writing code in libavutil, it must be usable for all the
> places we are already producing XML. Otherwise it does not make sense.
This illustrates the kind of misunderstanding that appears to
exist, and in this regard, I think, it's important to clear up about
which kind of API we are talking about and which purposes it is meant
to serve and which not:
The AVTextFormat feature allows to create output data in a wide range
of formats from a generic API that is agnostic to the format.
It is not a format-specific API providing full-featured formatting for
any format.
That's the nature of this API and it won't change as it cannot change.
> it must be usable for all the
> places we are already producing XML. Otherwise it does not make sense
How do you come to that idea? It's a generic, format-agnostic
text formatting API. It is not an XML API.
I didn't even get it in the first place that that's what you mean,
it's somewhat far off... Hence I also need to clarify this:
Where I said above that it should be able to cover all use cases, I
meant "all use cases that need multi-format text output".
But not: all cases that need full-featured XML output PLUS all cases
that need full-featured JSON output PLUS all cases that need full-
featured CSV output PLUS all cases that need full-featured YAML
output, etc.
If you want to create a full-featured XML writer that's fine, it's
just something different from the AVTextFormat API.
Best regards,
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".
next prev parent reply other threads:[~2025-04-30 2:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 4:20 softworkz .
2025-04-24 14:47 ` [FFmpeg-devel] On errors, asserts and crashing (was: Shaping the AVTextFormat API Surface) Nicolas George
2025-04-25 13:05 ` softworkz .
2025-04-25 14:04 ` Nicolas George
2025-04-25 14:37 ` softworkz .
2025-04-25 14:41 ` Nicolas George
2025-04-25 14:53 ` softworkz .
2025-04-25 14:43 ` [FFmpeg-devel] On errors, asserts and crashing James Almer
2025-04-25 14:49 ` softworkz .
2025-04-25 16:04 ` Michael Niedermayer
2025-04-24 17:12 ` [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface Nicolas George
2025-04-25 13:24 ` softworkz .
2025-04-25 13:32 ` softworkz .
2025-04-25 14:05 ` Nicolas George
2025-04-25 14:26 ` softworkz .
2025-04-27 10:07 ` Stefano Sabatini
2025-04-29 8:30 ` Nicolas George
2025-04-29 18:07 ` softworkz .
2025-04-30 2:56 ` softworkz . [this message]
2025-05-04 15:32 ` Stefano Sabatini
2025-05-04 20:38 ` softworkz .
2025-05-05 14:32 ` Nicolas George
2025-05-06 10:45 ` softworkz .
2025-05-07 23:18 ` Stefano Sabatini
2025-04-24 18:34 ` Rémi Denis-Courmont
2025-04-25 13:16 ` softworkz .
2025-04-27 10:42 ` Stefano Sabatini
2025-04-27 17:54 ` softworkz .
2025-04-28 22:26 ` Stefano Sabatini
2025-04-28 23:24 ` softworkz .
2025-05-03 8:55 ` softworkz .
2025-05-07 23:30 ` Stefano Sabatini
2025-05-07 23:42 ` softworkz .
2025-05-08 21:26 ` Stefano Sabatini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM8P223MB03659894B8CCA23652D7524FBA832@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
--to=softworkz-at-hotmail.com@ffmpeg.org \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git