[FFmpeg-devel] [PATCH] ffprobe: print start_pts and duration_pts stream information

Clément Bœsch ubitux at gmail.com
Wed Sep 12 00:44:06 CEST 2012


On Tue, Sep 11, 2012 at 10:37:39PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2012-09-11 19:04:29 +0200, Clément Bœsch encoded:
> > On Tue, Sep 11, 2012 at 11:01:03AM +0200, Stefano Sabatini wrote:
> > > On date Saturday 2012-09-08 17:34:52 +0200, Michael Niedermayer encoded:
> > > > On Sat, Sep 08, 2012 at 01:02:25PM +0200, Stefano Sabatini wrote:
> > > > > Add start_pts and duration_pts fields. A duration_time field is added for
> > > > > overall consistency ("duration" alone does not tell if the duration is a
> > > > > time or a timestamp), "duration" is kept for backward compatibility but
> > > > > should be considered deprecated.
> > > > > ---
> > > > >  doc/ffprobe.xsd |    3 +++
> > > > >  ffprobe.c       |    6 +++++-
> > > > >  2 files changed, 8 insertions(+), 1 deletions(-)
> > > > 
> > > > good idea ...
> > > 
> > > Updated, "duration_pts" renamed to "duration_ts" as it makes slightly
> > > more sense.
> > > 
> > > Will apply soon if I read no comments.
> > > -- 
> > > FFmpeg = Fantastic Faithless Maxi Philosophical Enlightened Guide
> > 
> > > From 68302f62a774909b25d31c6476442211f2469605 Mon Sep 17 00:00:00 2001
> > > From: Stefano Sabatini <stefasab at gmail.com>
> > > Date: Sat, 8 Sep 2012 13:00:13 +0200
> > > Subject: [PATCH] ffprobe: print start_pts and duration_ts stream information
> > > 
> > > Add start_pts and duration_ts fields. The old "duration" field is kept
> > > for backward compatibility, but is deprecated in favor of
> > > "duration_time".
> > 
> 
> > Why duration wouldn't be expressed in time by default? I mean what's the
> > purpose? I don't see much point in deprecating something we will likely
> > never remove (for various reasons you are aware of) and is now duplicated.
> 
> "duration" is used in packet and frame and is expressed in timebase
> units (so we have "duration_time" which expresses duration in
> seconds), so this one will be an exception.
> 
> I'm not really happy about this, but yes backward compatibility should
> be favored, but I'd like to be able to remove the inconsistency.
> 

"start time" and "duration" don't sound inconsistent to me; "start" would
be very evasive without "time", and it sounds pretty obvious to me that
duration is in "time" unit.

> Patch updated.

Thanks, the patch looks fine to me.

[...]
> From 184773e3cca9512eaaea4f3e125615909dedcad3 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Sat, 8 Sep 2012 13:00:13 +0200
> Subject: [PATCH] ffprobe: print start_pts and duration_ts stream information
> 
> ---
>  doc/ffprobe.xsd |    2 ++
>  ffprobe.c       |    6 ++++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
> index 4340d46..c9213de 100644
> --- a/doc/ffprobe.xsd
> +++ b/doc/ffprobe.xsd
> @@ -121,7 +121,9 @@
>        <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="start_pts"        type="xsd:long"/>
>        <xsd:attribute name="start_time"       type="xsd:float"/>
> +      <xsd:attribute name="duration_ts"      type="xsd:long"/>
>        <xsd:attribute name="duration"         type="xsd:float"/>
>        <xsd:attribute name="bit_rate"         type="xsd:int"/>
>        <xsd:attribute name="nb_frames"        type="xsd:int"/>
> diff --git a/ffprobe.c b/ffprobe.c
> index 66fba70..06af4c3 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1715,8 +1715,10 @@ 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_time("start_time",    stream->start_time, &stream->time_base);
> -    print_time("duration",      stream->duration,   &stream->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);
> +    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);
> -- 
> 1.7.5.4
> 

-- 
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/20120912/4da34ca4/attachment.asc>


More information about the ffmpeg-devel mailing list