Opened 16 years ago
Last modified 13 years ago
#1130 new defect
Seeking (with -ss) is very inaccurate
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | normal | Component: | core |
Version: | 1.0rc2 | Severity: | normal |
Keywords: | Cc: | mennucc1@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
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 by , 16 years ago
comment:2 by , 16 years ago
Thanks for your reply. Here's what I find:
- 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.
- Adding -forceidx doesn't make any difference.
- using -demuxer lavf does fix it.
- 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 by , 13 years ago
Cc: | added |
---|
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.