[FFmpeg-devel] [PATCH] ffprobe: add show_entries option
Stefano Sabatini
stefasab at gmail.com
Thu Sep 13 22:53:56 CEST 2012
On date Tuesday 2012-09-11 19:12:18 +0200, Clément Bœsch encoded:
> On Mon, Sep 10, 2012 at 02:53:22PM +0200, Stefano Sabatini wrote:
> [...]
> > Just noticed that this can't work with the usual -show_* options,
> > since they will need to set show_all_entries to 1, so I'll need to set
> > them in the opt_show_* callbacks (which also need to be defined).
> >
> > Also we may want to deprecate them in favor or -show_entries.
> >
>
> Or just make equivalents. -show_streams -show_formats would be the same as
> calling -show_entries streams,format (or whatever syntax you want).
>
> If both -show_{format,streams,packets,...} and -show_entries are
> specified, print an incompatible message.
>
> > As for what regards streams, I wonder if we should somehow support
> > stream specifiers, at least for what concerns options which affect a
> > particular stream (-show_packet, -show_streams).
> >
> > A possible idea:
> > -select_streams v:0,a:1
> > or
> > -select_stream v:0 -select_stream a:0
> >
>
> Not sure that's really necessary. I don't think a thin filtering of data
> belongs at ffprobe level. The user is responsible from browsing the
> range of results for the data he's interested in. If he is interested in
> one or two specific values, -show_entries looks appropriate.
As an assiduous ffprobe user I'd find handy to limit output to given
streams (e.g. when debugging pure audio/video pts issues), and would
somehow simplify scripts.
> > or alternatively we could extend -show_entries:
> > -show_entries frame:v:1=pts
> >
> > which should be feasible assuming that sections cannot contain the ":"
> > character (but this really belongs to a different change/patch).
> >
> > Another possible problem: if "/" is acceptable in a section name, then
> > I can't use it like a section/entries separator.
> >
>
> For the syntax I don't know...
>
> [...]
Currently we have this structure:
format
tags
packets
packet
frames
frame
tags
streams
stream
tags
library_versions
library_version
program_version
error
(possibly missing something, just trying to get an approximate model).
Every section can be specified in an ambiguous way specifying the path
(since we basically have a tree structure), and I'm marking
stream-specific sections with an (S):
format
format/tags
packets
packets/packet(S)
frames
frames/frame(S)
frames/frame/tags
streams
streams/stream(S)
streams/stream/tags
library_versions
library_versions/library_version
program_version
error
When a section is choosen, all the child sections should be selected
as well.
For examples, selecting:
streams
it should also enable all subsections, that is:
streams/stream(S)
streams/stream/tags(S)
If only streams/stream:v is selected, then only video streams should
be shown.
If a section name is ambiguos it could be more tricky. For example if
the user specify:
tags
then it should match all the tags section in the tree, wherever their
parent dir is.
Assuming this syntax, it should be possible to specify for example:
-show_entries "packet:v=pts,pts_time ; frame:v0/tags ; streams:a"
to show pts and pts_time for video packets, the tags (and only the
tags) for frames belonging to the first video stream, and all the
audio streams.
To disable a subsection, something like this should work:
-show_entries "streams; stream/tags="
Note that I changed ":" to ";" to make it possible to use ":" for
specifying a stream specifier.
A section name may contain any alphanumeric char and "_", which
doesn't seem a big limitation.
I'll try to implement this once we'll settle on the exact
syntax/semantics (and I'll find the time).
--
FFmpeg = Fanciful and Frenzy Majestic Programmable Ermetic Gadget
More information about the ffmpeg-devel
mailing list