[Libav-user] Duration of packet media content

Argo Vela argovela at yahoo.com
Wed Jul 20 02:02:45 CEST 2011


Thank you, Stefano!

If I may follow-up...

--- On Tue, 7/19/11, Stefano Sabatini <stefano.sabatini-lala at poste.it> wrote:
>
> On date Tuesday 2011-07-19 16:02:35 -0700, Argo Vela encoded:
>> 
>> As one component of analyzing a media stream, I'm
>> curious to know if it is possible to come up with
>> the duration of the media content in a packet such
>> as might be found in MPEG2-TS.  As a concrete
>> example, given a muxed stream of AAC audio & H.264
>> video, would it be possible to calculate a 2-tuple
>> <PTS,duration> for each packet in the stream?
>> 
>> If so, then I would have two questions:
>> 
>> (1) Are the libav libraries a good tool to use for
>> such a task?
> 
> ffprobe -show_packets

As a test, when I run ffprobe against a sample file, in
this case an FLV1, I receive the following caution:

     [flv @ 0x974c100]Estimating duration from bitrate, this may be inaccurate

Is there any means of estimating the potential error in
this estimate?  Ie, how inaccurate is "inaccurate"?  :-)
Does this message apply to the audio, video, or both?

Also, I noticed that while the audio packets all had what
appears to be a reasonable value for the packet duration,
the video packets all had durations of zero.  It appears
that in this particular sample file the video packets each
contain a single video frame, however at 24fps, this should
still yield a duration of approximately 42ms per packet. Do
you have any idea why this might be happening?

For reference, ffprobe reports the following build info:
  libavutil version: 50.15.1
  libavcodec version: 52.72.2
  libavformat version: 52.64.2
  built on Jul 19 2011 06:30:13, gcc: 4.5.2

Thank you for your time!

AV.


More information about the Libav-user mailing list