[FFmpeg-devel] base av_read_frame() function for seeking in mpegps files

zhentan feng spyfeng
Wed Jul 15 05:07:04 CEST 2009


2009/7/15 Michael Niedermayer <michaelni at gmx.at>

> On Thu, Jul 09, 2009 at 05:36:48PM +0800, zhentan feng wrote:
> > Hi
> >
> > I am implementing a seek api for mpegps demuxer.
> > Index entries are already built before seeking, the frame pos is set as
> > header pos.
> >
> > so when seek target timestamp,
> > 1) look up the index and get the frame pos in the index entries.
> > 2) use url_fseek() seek to the pos and call av_read_frame() until get the
> > target frame
> >
> > here I have an error: the target frame size is not correct for some
> > situation, ie not same with the actual frame size, but the pts/dts value
> is
> > correct.
> Well, its to be expected that the first frame that the parser outputs might
> be
> incomplete, after seeking
Is this a bug or just keep it like this?
so when I find this frame, but get the wrong size,
should I return the next correct frame with the correct size or just return
this frame with the wrong size?

I am little confused about how to handle this situation.


Best wishes~

More information about the ffmpeg-devel mailing list