[MPlayer-users] -ss option time descrepancy

Michel Bardiaux mbardiaux at peaktime.be
Wed Sep 15 11:34:42 CEST 2004


D Richard Felker III wrote:

> On Tue, Sep 14, 2004 at 10:23:24AM -0400, The Wanderer wrote:
> 
[snip]
> 
> 
> 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 

This is certainly *not* conforming for MPEG1. ISO1172-1 p. 23 states for 
PTS: "... the intended time ... of the first access unit that commences 
in the packet". Since a unit cannot possibly commence in more than 1 
packet of a specific stream, a PTS cannot be repeated. Did MPEG-2 change 
that?

> and even allowed for ranges
> of timestamps not to appear at all. 

True, but *this* should not be a problem. One would start a sequential 
search at the latest PTS that is before the requested time.

> 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.
> 
> rich
> 

HaND,
-- 
Michel Bardiaux
Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
Tel : +32 2 790.29.41




More information about the MPlayer-users mailing list