[FFmpeg-devel] [PATCH] ffprobe: show codec_time_base in streams section

Stefano Sabatini stefasab at gmail.com
Thu Sep 13 11:36:59 CEST 2012


The field is useful to compute times from values expressed in codec time
base units, for example the duration field in the "frame" section.
---
 doc/ffprobe.xsd |    1 +
 ffprobe.c       |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 9549bdb..6ea27a5 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -123,6 +123,7 @@
       <xsd:attribute name="r_frame_rate"     type="xsd:string" use="required"/>
       <xsd:attribute name="avg_frame_rate"   type="xsd:string" use="required"/>
       <xsd:attribute name="time_base"        type="xsd:string" use="required"/>
+      <xsd:attribute name="codec_time_base"  type="xsd:string" use="required"/>
       <xsd:attribute name="start_pts"        type="xsd:long"/>
       <xsd:attribute name="start_time"       type="xsd:float"/>
       <xsd:attribute name="duration_ts"      type="xsd:long"/>
diff --git a/ffprobe.c b/ffprobe.c
index a770a25..6b7e3ff 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1717,6 +1717,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
     print_q("r_frame_rate",   stream->r_frame_rate,   '/');
     print_q("avg_frame_rate", stream->avg_frame_rate, '/');
     print_q("time_base",      stream->time_base,      '/');
+    print_q("codec_time_base", stream->codec->time_base, '/');
     print_ts  ("start_pts",   stream->start_time);
     print_time("start_time",  stream->start_time, &stream->time_base);
     print_ts  ("duration_ts", stream->duration);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list