[FFmpeg-devel] [RFC] Moving ffprobe's writers to lavu

Nicolas George george at nsup.org
Fri Apr 10 17:27:08 EEST 2020


Hi.

In the comments on a recent patch to implement statistics outputs for a
specific filter, I noted that this is something that many filters need
to do, and therefore in need of unification. I also observed some JSON
code in a filter, which does not belong there.

https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260178.html

It reminded me of a project I have had for some time: moving the writers
written for ffprobe (XML, JSON, INI, etc.) into libavutil.

I am pretty sure it is doable, but I am also sure there will be
pitfalls, cases where the writer are very specific to ffprobe's need and
some careful design is needed to make them generic while keeping
compatibility.

And in any case, it will be quite some work, I do not want to do it if
it will be bikeshedded to death, so I first put the principle on
discussion here.

Do you think it is a good idea to add functions to produce formatted
output for structured data in libavutil?


There is another, smaller pitfall: where do these functions output to?
ffprobe outputs to stdout; the patch quoted above outputs through AVIO
to any supported format; some filters put data as string metadata. The
obvious answer to that is to "write" to a callback, and have the
callback decide to write the data to stdout, AVIO or a memory buffer.

A few months ago, I proposed the draft of an elegant (IMNSHO) API for
"write to a callback", but it immediately gave signs to be bikeshedded
to death. If I start working on this project, I intend to finish and use
it, because it's exactly the kind of use I had in mind for it.

https://ffmpeg.org/pipermail/ffmpeg-devel/2019-December/254042.html

Please share your thoughts, including if only to say you think it is a
good idea.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200410/3f719ce8/attachment.sig>


More information about the ffmpeg-devel mailing list