<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Dear all<br>
<br>
Conrad, thank you for your inputs and your help so far. I will use and
test the seek-rewrite branch as soon as possible.<br>
<br>
I figured out that the Keyframe position in the granulepos is the
NUMBER of the keyframe. When seeking with OGGZ, one has to supply the
TIME-position (milliseconds) of the desired frame. So I made a short
workaround by calculating the milliseconds position as follows:<br>
<blockquote><i>ms = (granulepos >> shift) * 1000 / noFPS;<br>
</i></blockquote>
Needless to say, this won't point me to the exact keyframe position.
Probably this rough calculation is not exact enough?<br>
What is the best approach to calculate the TIME-position for
oggz-seeking out of a given frame number?<br>
<br>
Kind regards,<br>
Stefan<br>
<br>
<br>
Am 08.06.2010 00:48, schrieb Conrad Parker:
<blockquote
cite="mid:AANLkTimTWLgg82jhm2sfqqiM9W8wd6OmLjhTd-N6qNY7@mail.gmail.com"
type="cite">
<pre wrap="">On 7 June 2010 20:02, Stefan Weber <a class="moz-txt-link-rfc2396E" href="mailto:s_weber@blyth.ch"><s_weber@blyth.ch></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Conrad
Thanks for your reply to my request. I was able to eliminate some questions
now.
But I obviously still have some issues calculating the keyframe position.
This is what I do:
ogg_int64_t granule = oggz_tell_granulepos(oggz);
int shift = oggz_get_granuleshift(oggz, sn);
int noOfFramesSinceKeyframe = granule>>shift;
int keyFramePosition = oldPosition - noOfFramesSinceKeyframe;
oggz_seek_units(oggz, keyFramePosition, SEEK_SET);
oldPosition being the position where initially has been seeked to as from
oggz_tell_units().
Seeking works, but not to keyframes :( Am I getting wrong some units or
something?
</pre>
</blockquote>
<pre wrap="">
This line:
| int noOfFramesSinceKeyframe = granule>>shift;
calculates the position of the previous keyframe, not the offset since. See:
<a class="moz-txt-link-freetext" href="http://wiki.xiph.org/GranulePosAndSeeking">http://wiki.xiph.org/GranulePosAndSeeking</a>
so you should be able to use that calculation directly for keyFramePosition.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">If you're working with this now anyway, please try the seek-rewrite
branch, from the repo at github: <a class="moz-txt-link-freetext" href="http://github.com/kfish/liboggz">http://github.com/kfish/liboggz</a>
</pre>
</blockquote>
<pre wrap="">
Whats different in this branch? Why would I use it?
</pre>
</blockquote>
<pre wrap="">
It has improvements in both efficiency and accuracy, but does not have
as much real-world testing. If people test it and report good results
then it will be released as the main version sooner.
Conrad.
</pre>
</blockquote>
</body>
</html>