[FFmpeg-devel] [PATCH] ffprobe integration

Stefano Sabatini stefano.sabatini-lala
Tue Feb 9 02:14:46 CET 2010


On date Monday 2010-02-08 22:21:02 +0100, Artur Bodera encoded:
> On Sun, Feb 7, 2010 at 12:34 PM, Stefano Sabatini <
> stefano.sabatini-lala at poste.it> wrote:
> 
> > Also remember that ffprobe is meant to be simple, that is it should be
> > a thin C wrapper for exposing the information provided by libav*, for
> > other manipulations I believe we should use some higher level
> > scripting language, which would allow everything you are proposing.
> >
> >
> So there are 2 cases here - one is readability by a human, the second one (I
> voted for) is related to machine readability. If ffprobe is meant to be very
> simple, there is no place for templates I proposed. Even if there is no
> place for templates, there is still a need for parsability of the output.
> 
> I recommend implementing a "-raw" or "-dump" flag that would produce a very
> verbose and easy to parse message. This could go on as you proposed:
> foo=x
> bar=y

Please elaborate, in what a -raw/-dump mode would be different from
the currently issued output?

> ... given that the format is always [ alphanum + "=" char + actual value +
> NL ]. Making scripts around that would be a child's play. Regading time
> formats, this verbose mode should result in outputing time in all known and
> reasonable formats, ie:
> LENGTH=14.01192
> LENGTH_SECFRAMES=14.2
> LENGTH_FRAMES=336
> 
> This way, all future scripts will be happy and users will be happy. Any
> additional logic would end up in scripts and ffprobe would end up being just
> what you proposed - hair-thin wrap around libav* vel data dumper.
> 
> Regards.

Another concerns I have is regarding metadata tags.

Metadata may be placed both in the format and in the streams, that's
why I dumped the -show_tags option of the SF ffprobe version.

On the other side, it is now difficult to show or grep only the tags,
as the current output looks something like:

[FORMAT]
filename=in.avi
nb_streams=2
format_name=avi
format_long_name=AVI format
start_time=0:00:00.000000
duration=0:00:53.400000
size=1.873 Mibyte
bit_rate=294.232 Kbit/s
ISFT=Lavf52.41.0
TITLE=blahbla
COMMENT=cool
AUTHOR=mumon
[/FORMAT]

An idea may be to prefix the metadata tags with something like "TAG:",
so the above stanza would be:

[FORMAT]
filename=in.avi
nb_streams=2
format_name=avi
format_long_name=AVI format
start_time=0:00:00.000000
duration=0:00:53.400000
size=1.873 Mibyte
bit_rate=294.232 Kbit/s
TAG:ISFT=Lavf52.41.0
TAG:TITLE=blahbla
TAG:COMMENT=cool
TAG:AUTHOR=mumon
[/FORMAT]

which is more grep friendly.

TAG:COMMENTS?
-- 
FFmpeg = Fascinating and Formidable Merciless Pitiful Empowered Genius



More information about the ffmpeg-devel mailing list