<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks, i'll take a look into ligoggz and also give liboggplay a try.<br><br>--- On <b>Thu, 8/20/09, Chris Pearce <i><email@example.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Chris Pearce <firstname.lastname@example.org><br>Subject: Re: [theora] How to seek theora streams<br>To: "Manolache Adrian" <email@example.com><br>Cc: firstname.lastname@example.org<br>Date: Thursday, August 20, 2009, 2:36 AM<br><br><div class="plainMail">Seeking robustly is hard.<br><br>A good place to start is by looking at liboggz's seeking code in oggz_seek.c, oggz_bounded_seek_set(). Conrad also has a seek-rewrite branch in his git repository which cleans up that code significantly.<br><br>An example of a program which uses liboggz's seeking is oggplayer. It uses liboggplay which in turn uses liboggz to
seek:<br><a href="http://www.bluishcoder.co.nz/2009/03/oggplayer-simple-ogg-player-using.html" target="_blank">http://www.bluishcoder.co.nz/2009/03/oggplayer-simple-ogg-player-using.html</a><br><br>However, liboggz does not seek back to the theora keyframe prior to your seek target. So if you use oggz_seek() and just start decoding from there, you'll get garbage in your theora frames until libtheora hits a keyframe packet.<br><br>This thread has some discussion of some solutions for this:<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>Do you need your seek to be millisecond accurate? If not, you can just do a rate-estimation (e.g. seek file to offset (file_size / media_duration) * seek_target), ogg_sync_pageseek(), and then decode forward from there. VLC takes this approach, and it works well enough.<br><br><br>All the best,<br>Chris
Pearce.<br><br><br>On 20/08/2009 8:05 a.m., Manolache Adrian wrote:<br>> I need to be exposed to a way of seeking theora streams. I have<br>> repeatedly found the same question asked on a different forums but could<br>> not find an answer. I'm working on a game and started integrating video<br>> with theora, the sound works just fine with ogg/vorbis(i find it easy to<br>> seek using ov_raw_seek for audio files). Could someone please point me<br>> to some example/code of how can i seek with theora?<br>> <br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> theora mailing list<br>> <a ymailto="mailto:email@example.com" href="/firstname.lastname@example.org">email@example.com</a><br>> <a href="http://lists.xiph.org/mailman/listinfo/theora"