[MPlayer-users] -ss option time descrepancy

D Richard Felker III dalias at aerifal.cx
Tue Sep 14 20:36:09 CEST 2004

On Tue, Sep 14, 2004 at 10:23:24AM -0400, The Wanderer wrote:
> D Richard Felker III wrote:
> >On Mon, Sep 13, 2004 at 01:39:58PM +0200, Michel Bardiaux wrote:
> >>If one assumes an MPEG-PS format with correct timestamps, correct
> >>seeking to a particulat frame using repeated bisection then a
> >>little bit of MxV parsing should work, no? Of course the problem is
> >>then to *decode* non-key frames, especially when faced with
> >>variable GOP size or open GOPs...
> >>
> >>So ITYM 'seeking in a pathological MPEG'?
> >
> >if you call 75% of all dvd's "pathological", then yes...
> ...plus apparently every single .mpg file I've ever found on the
> Internet, and certainly every one for which I've noticed one way or the
> other; I don't remember ever doing -ss in an MPEG file and having it go
> to the requested time offset. (Admittedly part of this could be just bad
> memory and/or lack of observation... but there have been enough specific
> cases that I'd be quite willing to believe the problem is present with
> all of them.)

no, you misunderstand. mplayer's -ss works wrong for mpeg files
because _in general_ the correct method of seeking will not work for
mpeg files. normally you would do a seek via binary search, and
ultimately land exactly on the timestamp you want. but in mpeg files,
it's common for timestamps to be repeated and even allowed for ranges
of timestamps not to appear at all. so if you try to do a binary
search, in the general case, you may run into totally bogus behavior.
in fact this is the case for the majority of dvds out there.

thus, mplayer does a really idiotic search instead, just seeking by
seconds*bytes/sec bytes. this is always wrong unless you have perfect
cbr, and since the nominal bitrate in the headers is usually wrong
even for cbr data, it's almost always wrong.


More information about the MPlayer-users mailing list