[FFmpeg-devel] [PATCH] ffprobe: report audio bit rate in stream description

Stefano Sabatini stefasab at gmail.com
Mon Feb 6 12:49:17 CET 2012


On date Monday 2012-02-06 12:13:02 +0100, Matthieu Bouron encoded:
> 2012/2/6 Stefano Sabatini <stefasab at gmail.com>:
> > On date Sunday 2012-02-05 22:26:14 +0100, Matthieu Bouron encoded:
> >> $title
> >
> >> From 4bca8fd1dddfcf4851a0ba1cc6bd52d597e9ab8b Mon Sep 17 00:00:00 2001
> >> From: Matthieu Bouron <matthieu.bouron at gmail.com>
> >> Date: Sun, 5 Feb 2012 21:59:23 +0100
> >> Subject: [PATCH] ffprobe: report audio bit rate in stream description
> >>
> >> ---
> >>  doc/ffprobe.xsd |    1 +
> >>  ffprobe.c       |    8 +++++++-
> >>  2 files changed, 8 insertions(+), 1 deletions(-)
[...]
> Patch updated.
> >
> > Some output formats (compact/csv) demand a fixed number of fields, so
> > in you need to display a field even in the case the information is not
> > available. In this case this should work:
> >
> >              if (bit_rate > 0) print_int    ("bit_rate", bit_rate);
> >              else              print_str_opt("bit_rate", "N/A");
> >
> > Also I'm not sure this is a good idea, since this only shows the
> > *uncompressed data* bitrate, which is in general different from the
> > effective bitrate.
> This code has the same behaviour as ffmpeg (libavcodec/util.c). If
> bits_per_sample is set, the bit_rate is computed but if not
> AVCodecContext.bit_rate is used.

Yes, I wonder if it would make sense to export the get_bit_rate()
function, or even better to set the value right into the codec
context which should be even more robust.

> Maybe this entry should be called avg_bit_rate ?
-- 
FFmpeg = Foolish & Forgiving Magic Practical Epic Ghost


More information about the ffmpeg-devel mailing list