[MPlayer-users] mpeg file seek bug!

Tomasz Bury ait at op.pl
Fri Apr 9 11:05:32 CEST 2004


ajing wrote:

> When I play mpeg file with ¨Css option, the player always seeks to a
> wrong time position!
>
> For example, if I execute: mplayer ¨Css 30:00 test.mpg
>
> The time position should seek to 30 minute, but in fact seek to wrong
> position! 


AFAIK the -ss is a quick-and-dirty solution.
Mplayer actually uses -sb and finds the byte offset like this:

seek_byte = seek_time * bitrate

so it will always be inacurate for variable bitrate streams.

Most MPEG-2 and MPEG-4 streams are variable bitrate.
Some encoders store average bitare in the header,
so seeking is more or less accurate,
but some encoders store maximum bitrate. In this case
mplayer will always overshoot the taget position.

BTW: are there any plans to implement precise seeking,
(demultiplexing and counting frames)?

Regards,
Tomasz Bury






More information about the MPlayer-users mailing list