Hello, 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? Thanks, Shayne Wissler
> 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 theWhen you get a page, you can get its granulepos field, and from there you should be able to deduce if a keyframe has happened between (last you checked) and (at or before the last packet which finished in that page).
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. -r