[FFmpeg-cvslog] ffprobe: report bit rate in stream description

Matthieu Bouron git at videolan.org
Mon Feb 20 17:55:44 CET 2012


ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at smartjog.com> | Mon Feb  6 11:58:14 2012 +0100| [278d6ab90041cb52fb76a84dcff062db8c2398e2] | committer: Stefano Sabatini

ffprobe: report bit rate in stream description

Signed-off-by: Stefano Sabatini <stefasab at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=278d6ab90041cb52fb76a84dcff062db8c2398e2
---

 doc/ffprobe.xsd |    1 +
 ffprobe.c       |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index e7104ef..3984b7d 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -110,6 +110,7 @@
       <xsd:attribute name="time_base"        type="xsd:string" use="required"/>
       <xsd:attribute name="start_time"       type="xsd:float"/>
       <xsd:attribute name="duration"         type="xsd:float"/>
+      <xsd:attribute name="bit_rate"         type="xsd:int"/>
       <xsd:attribute name="nb_frames"        type="xsd:int"/>
       <xsd:attribute name="nb_read_frames"   type="xsd:int"/>
       <xsd:attribute name="nb_read_packets"  type="xsd:int"/>
diff --git a/ffprobe.c b/ffprobe.c
index f4174fa..21e81c8 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1509,6 +1509,8 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
     print_fmt("time_base",      "%d/%d", stream->time_base.num,      stream->time_base.den);
     print_time("start_time",    stream->start_time, &stream->time_base);
     print_time("duration",      stream->duration,   &stream->time_base);
+    if (dec_ctx->bit_rate > 0) print_val    ("bit_rate", dec_ctx->bit_rate, unit_bit_per_second_str);
+    else                       print_str_opt("bit_rate", "N/A");
     if (stream->nb_frames) print_fmt    ("nb_frames", "%"PRId64, stream->nb_frames);
     else                   print_str_opt("nb_frames", "N/A");
     if (nb_streams_frames[stream_idx])  print_fmt    ("nb_read_frames", "%"PRIu64, nb_streams_frames[stream_idx]);



More information about the ffmpeg-cvslog mailing list