[MPlayer-dev-eng] mencoder start position

D Richard Felker III dalias at aerifal.cx
Sat Dec 4 20:44:11 CET 2004


On Sat, Dec 04, 2004 at 01:24:40PM -0500, The Wanderer wrote:
> D Richard Felker III wrote:
> 
> >On Sat, Dec 04, 2004 at 12:53:11PM +0100, Jérôme Petazzoni wrote:
> >
> >>>When I encode normal avi file then -ss option work correct (when
> >>>I choose 51,27 then encoding start from that position) but I've
> >>>got a few files in matroska and I want to cut them. To check
> >>>start position in frames I must extract video track (mplayer
> >>>doesn't show actual frame in matroska - only decoded frames).
> >>>When I've got video track extracted from mkv mplayer and mencoder
> >>>as start position choose next keyframe from choosen position.
> >>
> >>I seem to have the same problem with MPEG2 and MPEG4 streams. When
> >>I try to extract some specific frames (with "mplayer -ss", not
> >>"mencoder -ss" so I don't know if it's the same mechanism behind it
> >>...) I observe some serious discrepancies between the frames
> >>extracted (I have the very same video sequence in VOB format, in
> >>MPEG4 ISO (quicktime) format, and a few others ; and when trying to
> >>get some specific frames, I end up with slights offsets - because
> >>indeed "mplayer -ss" doesn't do accurate seeking).
> >>
> >>It seems that no mplayer guru wants this feature, so we will
> >>probably end up coding it ourselves :-)
> >
> >For mpeg1/2 it's a totally different problem. The format sucks really
> >bad, so it's impossible to do accurate seeking without being VERY
> >SLOW (i.e. reading the whole file). For other file types the problem
> >is mainly that you can only seek to keyframes.
> 
> Actually, unless my understanding is off, it should in principle be
> possible to seek to non-keyframes in other formats if you're willing to
> accept a trade-off in CPU time; the basic notion would be to seek to the
> immediately preceding keyframe and then decode (but not output) frames
> as needed to get to the requested point.

Yes of course. Go code it.. :)

Rich






More information about the MPlayer-dev-eng mailing list