[FFmpeg-user] ffprobe duration analysis and -analyzeduration and -probesize

Moritz Barsnick barsnick at gmx.net
Tue Jul 15 18:54:19 CEST 2014


Hi Robert,

On Tue, Jul 15, 2014 at 17:09:32 +0200, Robert Krüger wrote:

> Now the command line options -analyzeduration and
> -probesize exist and so I naively thought, if I just specified them
> large enough so the entire file is parsed, durations must be exact
> but that does not seem to be the case (I compared the values to the
> ones obtained by adding up all packet durations of a given stream and
> those make more sense).
> 
> Where is my mistake?

I'm guessing here, as I don't know how the duration is determined for
this specific type of container and codec. But I assume that those two
options don't change the way it's determined, they only change two
parameters. So if ffmpeg happens to do something like checking file
headers or estimating from the initial frame and bit rates, this may
not change.

If you're going to have ffmpeg analyze the whole file anyway, there are
several other ways to do this:
* Have ffprobe output data for each and every frame, and then count
those frames.

* Have ffmpeg operate on the complete file, and grab its results:
$ ffmpeg -i VTS_03_1.VOB -an -sn -f null -
[...]
Input #0, mpeg, from 'VTS_03_1.VOB':
  Duration: 00:00:31.55, start: 0.280000, bitrate: 8357 kb/s
[...]
frame=  791 fps=352 q=0.0 Lsize=N/A time=00:00:31.64 bitrate=N/A

(I think I have seen a solution on this list to parse the latter.)

Note the final "frame=" output. I don't know whether adding "-c
copy", which is noticably faster, always definitely produces the same
results.

Moritz


More information about the ffmpeg-user mailing list