??????? I've rewritten my theora player using liboggz. I've stumbled upon a few issues though. First of all liboggz exposes oggz_read and oggz_run, but how can i read only sound data, or only video data using liboggz, say something like this: oggz_read_sound(1024), oggz_read_video(1024). ? ? ? ?? Second of all i tried using liboggz's seek function. Immediately after the seek i get some "garbage" frames: how can i address this issue? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora/attachments/20090824/382c9973/attachment.htm
> how can i read only sound data, or only video data using liboggz, say > something like this: oggz_read_sound(1024), oggz_read_video(1024).I think you'll have to add that layer yourself. Beware not to cause too much buffering while doing so, though.> Second of all i tried using liboggz's seek function. Immediately > after the seek i get some "garbage" frames: how can i address this issue?You need to seek to the last keyframe at or before your seek point, as inter frames build on that keyframe. I believe liboggz is being worked on to have some code to help with that, but for now, you'll have to seek in two steps: First seek wherever you want to get, then seek to the right keyframe, which you can deduce from the first seeked frame's granpos. See http://wiki.xiph.org/GranulePosAndSeeking for more info.
Your decode will be encountering only interframes after the seek. It will return garbage until it encounters a keyframe. As ogg.k.ogg.k says, you need to seek back to the previous keyframe and decode forwards from there. I fixed this in Firefox's HTML video element implementation. There's a patch in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=463358 which you may find useful. This uses the double-bisect method ogg.k mentioned. It still fails in some cases, due to these reasons: http://lists.xiph.org/pipermail/theora/2009-July/002549.html Seeking is hard. Another solution is here, but it's not as fast on local files: http://lists.xiph.org/pipermail/theora/2009-July/002544.html Chris P. On 8/24/2009 7:06 AM, Manolache Adrian wrote:> I've rewritten my theora player using liboggz. I've stumbled upon a > few issues though. First of all liboggz exposes oggz_read and oggz_run, > but how can i read only sound data, or only video data using liboggz, > say something like this: oggz_read_sound(1024), oggz_read_video(1024). > Second of all i tried using liboggz's seek function. Immediately after > the seek i get some "garbage" frames: how can i address this issue? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > theora mailing list > theora at xiph.org > http://lists.xiph.org/mailman/listinfo/theora