Hi all ! I am experiencing a strange issue with the theora encoding process. 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. 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. The streams look good otherwise, in particular, the warning disappears if I extract them with oggzdump and remux then with oggzmerge. I can also see in the resulting stream that the theora pages are well-muxed with the vorbis pages in this case.. Am I missing something ? I can provide more details if needed. Thanks for your help ! Romain
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
Le Sunday 01 February 2009 12:52:51, vous avez ?crit?:> > In the documentation for theora, it is written: one frame = one page. > > It is a frame == a packet, so the documentation would be wrong.Woops, me bad.> Muxing is done by ensuring you have at least one page available > for all continuous streams, and writing the one that maps to the > lowest time, etc (discontinuous streams are written the same way, > but you don't ensure you have a page for those, they just come > as they do).Ok. Why I still don't understand is why I get several pages at once. I mean that I put a packet, I check for a page: nothing. If I recursively do that, then the first time I would get a page, I get several of them. Shouldn't it be a page and then no more until I add more packets ? Romain