[MPlayer-users] How to find out "timestamps" of a mpeg stream?

Arpi arpi at thot.banki.hu
Mon Feb 10 23:51:22 CET 2003


> This too does the job. In addition, it is much faster. But starting
> at 1MB before the end of file seems to be strange. What would be a

yes it's strange but for example mpegtv (quite old mpeg1 player) and
libmpeg3 (that thing used by xmovie and broadcast2000, not libmpeg2!)
do the same.

> good choice to guarantee that at least one complete frame would be
> "played"?

the only better way imho is implementing a reverse demuxer, some code
which starts at the lasy byte and search backward for PS packet start codes,
then parse out the (optional) PTS timestamp. repeat this step until you get
a valid PTS.

but also note, that some mpegs (especially vobs from dvd) has wrap-around
timestamps, so they may restart from zero at some chapter boundaries or
some edit (mainly for multiangle discs) positions.

so actually no clean, fast and stable method exists :(

A'rpi / Astral & ESP-team

Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
    "However, many people beg for its inclusion in Debian. Why?" - Gabucino
  "Because having new software in Debian is good." - Josselin Mouette
"Because having good software in Debian is new." - Gabucino

More information about the MPlayer-users mailing list