[theora-dev] Delayed pages ?
Ralph Giles
giles at xiph.org
Fri Jan 30 15:10:55 PST 2009
On Fri, Jan 30, 2009 at 1:40 PM, Romain Beauxis <toots at rastageeks.org> wrote:
> Apparently, when I put packets into the ogg stream, the pages are not returned
> immediately by ogg_stream_pageout. What happens seems that I get several
> pages at once later.
libogg buffers internally until it has enough data to complete a page.
So this sounds normal, at least for some patterns of packet sizes.
> This causes me trouble since then the pages are not properly placed with the
> other vorbis audio pages, leading to warnings in oggz-validate, telling me
> that the theora packets are not well-ordered.
You have to mux based on the time equivalent of the granulepos field
in the page header. You get get this for theora pages by passing the
granulepos to th_granule_time(). (theora_granule_time() if you're
using the libtheora api.) You have to do this in general, because the
two codecs can produce pages that overlap each other.
Remuxing with oggz-rip and oggz-merge does just this, so it makes
sense that it would fix the validation problems.
HTH,
-r
More information about the theora-dev
mailing list