<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 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> -> read data until a full packet is formed<br> -> extract frame and offset from this packet, if frame=currentFrame and offset is 0<br> then stop, else decide in which direction to seek(forward if frame<currentFrame, or backward if offset>0 and frame=currentFrame)<br><br>Every time curretByteOffset is incremented(with a value that gets halfed now, if we seeked before currentFrame and/) 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><chris@pearce.org.nz></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Chris Pearce <chris@pearce.org.nz><br>Subject: Re: [theora] oggz reading & seeking<br>To: "Manolache Adrian" <prog_ady@yahoo.com><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>> I've rewritten my theora player using liboggz. I've stumbled upon a<br>> few issues though. First of all liboggz exposes oggz_read and oggz_run,<br>> but how can i read only sound data, or only video
data using liboggz,<br>> say something like this: oggz_read_sound(1024), oggz_read_video(1024).<br>> Second of all i tried using liboggz's seek function. Immediately after<br>> the seek i get some "garbage" frames: how can i address this issue?<br>> <br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> theora mailing list<br>> <a ymailto="mailto:theora@xiph.org" href="/mc/compose?to=theora@xiph.org">theora@xiph.org</a><br>> <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