[theora] Searching for keyframes

Ralph Giles giles at xiph.org
Wed Aug 5 12:43:28 PDT 2009

On Wed, Aug 5, 2009 at 12:10 PM, Shayne Wissler<wissler at gmail.com> wrote:

> I have a routine that searches an Ogg stream for Theora keyframes.  I am using
> theora_decode_packetin on each packet which is pretty slow.  Is there a way
> to just extract the granulepos from the stream without decoding all the video
> data?

You can check if a particular packet is a keyframe with the
th_packet_iskeyframe() convenience function. That will be much faster
than actually decoding the packet data. From that and a packet count
you should be able to reconstruct the per-packet granulepos if you
need it.


More information about the theora mailing list