[FFmpeg-user] ffprobe audio duration mismatch

Moritz Barsnick barsnick at gmx.net
Tue Mar 20 19:33:14 EET 2018

On Tue, Mar 20, 2018 at 18:08:36 +0100, ned.hodding at bellair.net wrote:
> Could anyone tell me why I get slightly different audio durations reported from the following two commands:
> ffprobe -show_streams x.m4a
> ffprobe -select_streams a:0 -show_entries  format=duration  x.m4a
> In this case the difference is only 8.023991 vs 8.024000, but it doesn't give me confidence that for other audio files the durations reported could be wildly different.
> Which way is more accurate? Or is this a bug and they should both be the same?

I'm pretty sure that, in mp4/m4a containers, this is a discrepancy
between the container's (header's) duration, as shown with
"-show_format", and the individual stream's duration, as shown with
"-show_streams". It's not the identical information displayed in a
different way, AFAIK.

As Carl pointed out, they may be of different accuracy (I haven't
checked the specificaions and the code), but perhaps they just
mismatch. I have often seen such files BTW.

IIUC, both these durations are from headers. The real duration again
may be different. ;-)


More information about the ffmpeg-user mailing list