[FFmpeg-user] Get exact duration of an mpeg1 file

Robert Krüger krueger at lesspain.software
Thu Dec 13 19:07:54 EET 2018

Hi again,

On Thu, Dec 13, 2018 at 6:01 PM Robert Krüger <krueger at lesspain.software>

> Hi Carl,
> On Thu, Dec 13, 2018 at 5:31 PM Carl Zwanzig <cpz at tuunq.com> wrote:
>> On 12/13/2018 8:10 AM, Robert Krüger wrote:
>> > Are there command line parameters to make it compute the exact size or
>> is
>> > this a design or implementation limitation?
>> IIRC (and I could be wrong), the generic "info" uses metadata whereas
>> mediainfo actually counts frames and applies the frame rate to that.
>> Without
>> a container, there's no appropriate metadata.
> yes, absolutely, that's what I assumed, I just didn't know the option to
> force it to do something else.
>> It's easy enough to tell, if ffmpeg -i returns almost immediately, it's
>> probably not counting frames. You also might get a more accurate answer
>> by
>> using -probesize with a parameter larger than the actual file.
> that did the trick, thanks! There still a minor inaccuracy of a few frames
> but that is probably still https://trac.ffmpeg.org/ticket/3683. My main
> concern was estimating vs. actually parsing.
Sorry, I have to take that back as I used the wrong file and got something
mixed up when looking at it. -probesize doesn't change the behaviour at
all. I set it to a value larger than the file and still got the warning and
the incorrect number. So for mpeg1 this does not seem to work and seems to
be consistent with my last test a long time ago.

Sorry about the confusion.


More information about the ffmpeg-user mailing list