[Libav-user] Duration of packet media content
stefano.sabatini-lala at poste.it
Fri Jul 22 11:35:22 CEST 2011
On date Tuesday 2011-07-19 17:02:45 -0700, Argo Vela encoded:
> 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
Check estimate_timings* code in libavformat/utils.c, this means that
the duration is not set in the *container*.
> 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?
Impossible to esteem the "inaccuracy" here.
> 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?
No, can you post a sample showing the problem?
> 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!
More information about the Libav-user