Opened 12 years ago

Last modified 10 years ago

#1130 new defect

Seeking (with -ss) is very inaccurate

Reported by: mplayer@… Owned by: reimar
Priority: normal Component: core
Version: 1.0rc2 Severity: normal
Keywords: Cc: mennucc1@…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


Mplayer's -ss option doesn't do what it's supposed to.

For example,

mplayer -ss 20 file.avi

should start at exactly 20 seconds into the file.
It doesn't do this, but instead starts playback at about 12 seconds in.

This is a particular nuisance when using mencoder to edit files with -ss and -endpos.

For comparison, ffmpeg does get it right.

ffmpeg -i file.avi -ss 20 -t 10 -vcodec copy -acodec copy -y temp.avi
mplayer temp.avi

[I know that times are only accurate to the nearest frame, but that should be an error of about 20-40ms, not 8 seconds!]

Is it possible that mencoder is seeking to an estimated byte-offset within the file, rather than skipping over exactly the right number of frames?

Change History (3)

comment:1 Changed 12 years ago by compn

mplayer/mencoder seeks to keyframes, which arent always accurate to time.

try using -forceidx and/or -demuxer lavf, sometimes seeking improves with a better index.

comment:2 Changed 12 years ago by mplayer@…

Thanks for your reply. Here's what I find:

  1. Using the following: mlayer -osdlevel 3 -ss 20 myfile.avi

it starts at 6 seconds in. Although I requested 20 seconds, the actual start point is about 6, and the OSD also says 6.

  1. Adding -forceidx doesn't make any difference.
  1. using -demuxer lavf does fix it.
  1. Testing the other demuxers, most don't work at all (which is as expected). Of the two that do work (lavpref, mpegts), both suffer from the same bug.

comment:3 Changed 10 years ago by mennucc1@…

  • Cc mennucc1@… added
Note: See TracTickets for help on using tickets.