<br><br><div class="gmail_quote">On Sat, Nov 8, 2008 at 5:05 AM, Conrad Parker <span dir="ltr">&lt;<a href="mailto:conrad@metadecks.org">conrad@metadecks.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/11/6 salsaman &lt;<a href="mailto:salsaman@gmail.com">salsaman@gmail.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt; Hi all,<br>
&gt; I have been working on an ogg/theora demuxer/decoder plugin for LiVES<br>
&gt; (<a href="http://lives.sourceforge.net" target="_blank">http://lives.sourceforge.net</a>). The decoder has a very simple interface, in<br>
&gt; fact there are only two major functions: - a function to get details (frame<br>
&gt; size, fps, palette, etc) from a URL; - a function to get a given frame from<br>
&gt; a specified URL and copy the resulting frame into memory buffers.<br>
&gt;<br>
&gt; The code can be seen here:<br>
&gt;<br>
&gt; <a href="http://lives.cvs.sourceforge.net/viewvc/lives/lives-plugins/plugins/decoders/ogg_theora_decoder.c?view=log" target="_blank">http://lives.cvs.sourceforge.net/viewvc/lives/lives-plugins/plugins/decoders/ogg_theora_decoder.c?view=log</a><br>

&gt;<br>
&gt; The function which is causing problems is get_frame(). Here the first pass<br>
&gt; will seek to the keyframe before the target frame, then decode until we<br>
&gt; reach the target frame, at which point the frame is output. The output is<br>
&gt; done by way of ogg_data_process() which in turn calls ogg_theora_read().<br>
&gt;<br>
&gt; So far so good. However, on the second and subsequent frames, assuming we<br>
&gt; are playing forwards sequentially, a shortcut is taken - at line 960:<br>
&gt;<br>
&gt; if<br>
&gt; (tframe&gt;last_frame&amp;&amp;((tframe-last_frame&lt;=max_frame_diff||kframe==last_kframe)))<br>
&gt; {<br>
&gt;<br>
&gt; here, tframe is our target frame, (static) last_frame is the last frame<br>
&gt; output, and max_frame_diff is the keyframe skip / 2<br>
&gt; If we are playing sequentially, then this shortcut will be taken - it sets<br>
&gt; cont(inue) to TRUE and drops back into ogg_data_process(), and processing<br>
&gt; should continue exactly where we left off last time. However what I see is<br>
&gt; this - I am using 3 test clips. On one of the clips, playbck works<br>
&gt; perfectly; however, on the other two clips, it looks like frames are being<br>
&gt; skipped - the clip plays back too fast, with distortion, and we reach EOF<br>
&gt; too soon.<br>
&gt;<br>
&gt; Maybe somebody can take a quick look at the code and tell me where I am<br>
&gt; going wrong ?<br>
<br>
</div></div>can you post links to the 3 files? it might be easier to debug if we<br>
can reproduce the problem, or at least look at the file contents.<br>
Also, does this happen when viewing any frame offsets in those files,<br>
or for particular frames?<br>
<font color="#888888"><br>
Conrad.<br>
</font></blockquote></div><br><br>Hi Conrad,<br>thanks for your response. The file which does work is rather large (about 700MB) and exists only my local machine, given the file size and my slow connection it is a bit difficult to upload it. The two files which don`t work are a small test file with 17 frames (<a href="http://www.xs4all.nl/~salsaman/testogg.ogg">http://www.xs4all.nl/~salsaman/testogg.ogg</a>) and this file: <a href="http://upload.wikimedia.org/wikipedia/commons/0/0c/Experience_ubuntu.ogg">http://upload.wikimedia.org/wikipedia/commons/0/0c/Experience_ubuntu.ogg</a><br>
<br>If you have a Linux or BSD machine available, you can test out the player code yourself:<br>download and install the CVS version of LiVES (see <a href="http://lives.sf.net?do=cvs">http://lives.sf.net?do=cvs</a>) and then go to File/Open and select one of the files. The file will open up almost instantly (yay !) and clicking around randomly on the timeline shows the correct frame. The problem can be seen when playback is triggered.<br>
<br>To answer your question, the problem occurs no matter which frame is seeked to as the start frame. Note also that there is visible distortion (blockiness) during playback, indicating that frames are actually being omitted rather than the file simply being played back too fast (which of course I have checked for and eliminated the possibility of).<br>
<br>Regards,<br>Gabriel.<br><a href="http://live.sf.net">http://live.sf.net</a><br>