[FFmpeg-devel] [PATCH] ffprobe: add show_entries option

Stefano Sabatini stefasab at gmail.com
Wed Nov 21 20:29:14 CET 2012


On date Tuesday 2012-11-20 21:07:55 +0100, Clément Bœsch encoded:
> On Tue, Nov 20, 2012 at 12:21:02AM +0100, Stefano Sabatini wrote:
> > On date Thursday 2012-09-13 22:53:56 +0200, Stefano Sabatini encoded:
> [...]
> > Simplified with the use of unique names.
> > -- 
> > FFmpeg = Free & Friendly Moronic Power Elegant God
> 
> > From 2654af4fd2a971af9dec1e5e3824b05a2f75a852 Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini <stefasab at gmail.com>
> > Date: Mon, 17 Sep 2012 21:08:09 +0200
> > Subject: [PATCH] ffprobe: implement subsection field selection
> > 
> > ---
> >  doc/ffprobe.texi |   42 ++++++++++
> >  ffprobe.c        |  227 +++++++++++++++++++++++++++++++++++++++++++-----------
> >  2 files changed, 224 insertions(+), 45 deletions(-)
> > 
> > diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
> > index 7b47fba..39322cd 100644
> > --- a/doc/ffprobe.texi
> > +++ b/doc/ffprobe.texi
> > @@ -133,6 +133,48 @@ Like @option{-show_format}, but only prints the specified entry of the
> >  container format information, rather than all. This option may be given more
> >  than once, then all specified entries will be shown.
> >  
> > +This option is deprecated, use @code{show_entries} instead.
> > +
> > + at item -show_entries @var{section_entries}
> > +Set list of entries to show.
> > +
> > +Entries are specified according to the following
> > +syntax. @var{section_entries} contains a list of section entries
> > +separated by @code{:}. Each section entry is composed by a section
> > +name (or unique name), optionally followed by a list of entries local
> > +to that section, separated by @code{,}.
> > +
> > +If section name is specified but is followed by no @code{=}, all
> > +entries are printed to output, together with all the contained
> > +sections. Otherwise only the entries specified in the local section
> > +entries list are printed. In particular, if @code{=} is specified but
> > +the list of local entries is empty, then no entries will be shown for
> > +that section.
> > +
> > +Note that the order of specification of the local section entries is
> > +not honored in the output, and the usual display order will be
> > +reatained.
> > +
> 
> retained?
> 
> > +The formal syntax is given by:
> > + at example
> > + at var{LOCAL_SECTION_ENTRIES} ::= @var{SECTION_ENTRY_NAME}[, at var{LOCAL_SECTION_ENTRIES}]
> > + at var{SECTION_ENTRY}         ::= @var{SECTION_NAME}[=[@var{LOCAL_SECTION_ENTRIES}]]
> > + at var{SECTION_ENTRIES}       ::= @var{SECTION_ENTRY}[:@var{SECTION_ENTRIES}]
> > + at end example
> > +
> > +For example, to show only the index and type of each stream, and the PTS
> > +time, duration time, and stream index of the packets, you can specify
> > +the argument:
> > + at example
> > +"packet=pts_time,duration_time,stream_index : stream=index,codec_type"
> > + at end example
> > +
> > +To show all the entries in the section "format", but only the codec
> > +type in the section "stream", specify the argument:
> > + at example
> > +"format : stream=codec_type"
> > + at end example
> > +
> 
> Can we use that for tags/metadata?

Something like -show_entries format_tags=encoder? Yes.

[...]

> Anyway, LGTM, nice work, thanks.

Updated with various fixes. I'm not yet sure if we should allow:
format=format_name,tags

(allow to select also the subsection names), but can be changed later
I guess.

I'll push this patch tomorrow if I read no more comments.
-- 
FFmpeg = Fierce and Frenzy Merciless Power Elitarian God
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-ffprobe-implement-subsection-field-selection-through.patch
Type: text/x-diff
Size: 20924 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121121/c19abd8d/attachment.bin>


More information about the ffmpeg-devel mailing list