<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks a lot you guys! I am using liboggz and i need this for playback from disk. I tried patching my liboggz with the patches mentioned by Chris but haven't had any luck(tried skipping the files that we're not there but always got a malformed patch file error when no more skipping could be done).<br><br>So after reading the URL's you posted i tried using the not so fast method described here <a href="http://lists.xiph.org/pipermail/theora/2009-July/002544.html" target="_blank">http://lists.xiph.org/pipermail/theora/2009-July/002544.html</a>. I've been successuful in eliminating the artefacts but it is rather slow. <br><br>I tried implementing the following approach then: <br><br>1.0 seek to time t, retrieve&nbsp; current byteOffset (with oggz_tell) and currentFrame<br>2.0 repeat until the offset of the current frame is not 0(beginning of the
 frame)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; read data until a full packet is formed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; extract frame and offset from this packet, if frame=currentFrame and offset is 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then stop, else decide in which direction to seek(forward if frame&lt;currentFrame, or backward if offset&gt;0 and frame=currentFrame)<br><br>Every time curretByteOffset is incremented(with a value that gets halfed now, if we seeked before currentFrame and/)&nbsp; or decremented so this process is reasonably fast.<br><br>I do get some artefacts though, even if this method is faster. I'm wondering if i am missing something obvious. Here is some code if that would help better understand the approach i am using:<br><br>The seek routine(the numbers are just for
 testing).<br><br>http://pastebin.com/m25e13603<br><br>and everytime a video packet arrives i call this function:<br><br>http://pastebin.com/m1ac79d2b<br><br><br><br>--- On <b>Mon, 8/24/09, Chris Pearce <i>&lt;chris@pearce.org.nz&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Chris Pearce &lt;chris@pearce.org.nz&gt;<br>Subject: Re: [theora] oggz reading &amp; seeking<br>To: "Manolache Adrian" &lt;prog_ady@yahoo.com&gt;<br>Cc: theora@xiph.org<br>Date: Monday, August 24, 2009, 6:23 PM<br><br><div class="plainMail">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.<br><br>I fixed this in Firefox's HTML video element implementation. There's a patch in this bug: <a
 href="https://bugzilla.mozilla.org/show_bug.cgi?id=463358" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=463358</a><br>which you may find useful. This uses the double-bisect method ogg.k mentioned. It still fails in some cases, due to these reasons: <a href="http://lists.xiph.org/pipermail/theora/2009-July/002549.html" target="_blank">http://lists.xiph.org/pipermail/theora/2009-July/002549.html</a><br>Seeking is hard.<br><br>Another solution is here, but it's not as fast on local files:<br><a href="http://lists.xiph.org/pipermail/theora/2009-July/002544.html" target="_blank">http://lists.xiph.org/pipermail/theora/2009-July/002544.html</a><br><br><br>Chris P.<br><br>On 8/24/2009 7:06 AM, Manolache Adrian wrote:<br>&gt;&nbsp;&nbsp;&nbsp;I've rewritten my theora player using liboggz. I've stumbled upon a<br>&gt; few issues though. First of all liboggz exposes oggz_read and oggz_run,<br>&gt; but how can i read only sound data, or only video
 data using liboggz,<br>&gt; say something like this: oggz_read_sound(1024), oggz_read_video(1024).<br>&gt; Second of all i tried using liboggz's seek function. Immediately after<br>&gt; the seek i get some "garbage" frames: how can i address this issue?<br>&gt; <br>&gt; <br>&gt; <br>&gt; ------------------------------------------------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; theora mailing list<br>&gt; <a ymailto="mailto:theora@xiph.org" href="/mc/compose?to=theora@xiph.org">theora@xiph.org</a><br>&gt; <a href="http://lists.xiph.org/mailman/listinfo/theora" target="_blank">http://lists.xiph.org/mailman/listinfo/theora</a><br><br></div></blockquote></td></tr></table><br>



start: 0000-00-00
end: 0000-00-00