[MPlayer-users] Re: Extracting image from a movie
The Wanderer
inverseparadox at comcast.net
Thu Aug 5 20:07:18 CEST 2004
Stefan Sassenberg wrote:
> King wrote:
>
>> Reimar Döffinger <Reimar.Doeffinger <at> stud.uni-karlsruhe.de>
>> writes:
>>> Yes, I remeber that problem. It has to do with how -ss is
>>> implemented. It starts playback and then seeks, afaik, thus
>>> giving you always one frame from the beginning.
>>
>> If it first starts playing and then seeking can this then be
>> considered a bug ? With some scripting I now can delete the first
>> image I get (since this is always the opening frame) and use the
>> second (in my web application), but it would still be nice to know
>> how to grab a single frame with mplayer/mencoder and turn it into
>> an image.
>
> I'd consider it a bug as long its behaviour differs from the
> description in the doc. The -ss option's behaviour is not clear to me
> anyway because it jumps to a frame _near_ the position requested but
> not necessarily exactly to it. I do not know enough about iframes to
> see the reason for this.
The reason, as I understand it, is that in order to seek to a given
frame exactly it would be necessary to first seek to the preceding
keyframe ( = 'frame which contains the entire picture, not just its
differences from the one before it'), and then decode and "display" in a
buffer every single frame between that and the target location. This is,
at best, clunky, and I could easily understand how it might not be
possible with an architecture not designed to allow for it.
-ss, in most cases, simply rounds up or down (not sure which, and it
might depend on whichever is closer) from the timestamp you specify in
order to get to the nearest available keyframe. In some cases - MPEG
containers, in particular - the matter is further complicated because of
issues with timestamps; when using -ss in an MPEG container, you will
almost never end up exactly where you specify, and will usually end up
past it. (I do, sort of, know why, but I just woke up and it isn't clear
in my head right now.)
--
The Wanderer
Warning: Simply because I argue an issue does not mean I agree with any
side of it.
A government exists to serve its citizens, not to control them.
More information about the MPlayer-users
mailing list