[FFmpeg-devel] Order of demuxed packets after a seek in an ogg container.

Dale Curtis dalecurtis at chromium.org
Fri Jun 27 02:10:40 CEST 2014

On Wed, Jun 25, 2014 at 6:46 PM, Edward Richards <edward at edwardandalison.com
> wrote:

> That is a very interesting find.
> Assuming you discard negative pts for the audio, which of the two or more
> steams pts = 0 do you choose? Did a video over audio or data stream bias
> work for you or did you assume the the file AVPacket.pos come out as the
> deciding factor? Have you found any corner cases to that assumption?

We always try to use the video stream if one is available because otherwise
there's the risk of missing keyframes which yield corruption. We want to
only select a different stream if we know it has lower timestamps (and I
guess now, if its file position is lower than the preferred stream). Ogg
appears the only container which needs such a solution and I haven't found
any corner cases yet.

On Wed, Jun 25, 2014 at 7:33 PM, Michael Niedermayer <michaelni at gmx.at>

> On Wed, Jun 25, 2014 at 03:37:11PM -0700, Dale Curtis wrote:
> > Hi,
> >
> > If av_seek_frame() is used to seek within a specific stream, are future
> > av_read_frame() calls guaranteed to return all packets from all other
> > streams in the container with timestamps after the seek timestamp?
> no but, avformat_seek_file() has gurantees similar to this
> but its not implemented for ogg
> it could be implemented for ogg though, just needs a volunteer

Thanks for the info everyone. Are you referring to the read_seek2 API?

- dale

More information about the ffmpeg-devel mailing list