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

Matthieu Bouron matthieu.bouron at gmail.com
Mon Feb 6 18:53:31 CET 2012


2012/2/6 Stefano Sabatini <stefasab at gmail.com>:
> 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.

New patches attached, bit rate entry is now reported for all kind of
streams and use avcodec_get_bit_rate.

>
>> Maybe this entry should be called avg_bit_rate ?
> --
> FFmpeg = Foolish & Forgiving Magic Practical Epic Ghost
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavcodec-add-avcodec_get_bit_rate-function.patch
Type: text/x-diff
Size: 2267 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120206/d282284a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ffprobe-report-bit-rate-in-stream-description.patch
Type: text/x-diff
Size: 1735 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120206/d282284a/attachment-0001.bin>


More information about the ffmpeg-devel mailing list