[FFmpeg-devel] [PATCH] ffprobe: add compact and compactnk writers

Clément Bœsch ubitux at gmail.com
Sun Sep 25 15:34:20 CEST 2011


On Sun, Sep 25, 2011 at 01:41:53PM +0200, Stefano Sabatini wrote:
[...]
> > I wonder if keeping this nesting really is important. We might be limited
> > in width, so better keep it really compact. What about something like:
> > 
> > SECTION: k=v ...
> > SECTION: k=v ...
> > ...
> 
> Good idea.
> 

Also note this might be confusing with tags printing, select what you
prefer.

> > 
> > > +static void compactnk_print_int(const char *key, int value)
> > > +{
> > > +    printf("%d", value);
> > > +}
> > > +
> > > +static void compactnk_print_str(const char *key, const char *value)
> > > +{
> > > +    printf("%s", value);
> > > +}
> > >  
> > 
> 
> > Maybe some quoting would be worth here? It's sometimes hard to tell what
> > are the limit of a key. Another solution might be to use some '|'.
> > 
> > Those are just suggestions, I won't push for this.
> 
> I added escaping (which may be used e.g. for CSV output), and change
> the item separator from " " to "|".
> 
> Output looks like this:
> [...]
> PACKET: audio|1|238080|238.080000|238080|238.080000|26|0.026000|26.000000|9866826|K
> PACKET: audio|1|238106|238.106000|238106|238.106000|26|0.026000|26.000000|9866868|K
> PACKET: audio|1|238132|238.132000|238132|238.132000|26|0.026000|26.000000|9866910|K
> PACKET: audio|1|238158|238.158000|238158|238.158000|26|0.026000|26.000000|9866952|K
> STREAM: 0|flv|Flash Video (FLV) / Sorenson Spark / Sorenson H.263|video|1/1000|[0][0][0][0]|0x0000|320|240|0|yuv420p|-99|30000/1001|0/0|1/1000|0.000000|N/A
> STREAM: 1|mp3|MP3 (MPEG audio layer 3)|audio|0/1|[0][0][0][0]|0x0000|22050.000000|1|0|0/0|500/13|1/1000|0.000000|N/A
> FORMAT: samples/slow.flv|2|flv|FLV format|0.000000|238.158000|9866982.000000|331443.000000
> 

Looks good :)

[...]
> From b1f3608ceb988bce74b3cafa4a61f5400b5bbeb7 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Tue, 6 Sep 2011 16:48:48 +0200
> Subject: [PATCH] ffprobe: add compact and compactnk writers
> 
> ---
>  doc/ffprobe.texi |   23 +++++++++++++++++
>  ffprobe.c        |   71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 93 insertions(+), 1 deletions(-)
> 

Fine with me.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110925/e897d403/attachment.asc>


More information about the ffmpeg-devel mailing list