[prev in list] [next in list] [prev in thread] [next in thread] 

List:       theora
Subject:    Re: [theora] Mapping from granulepos to absolute time
From:       Conrad Parker <conrad () metadecks ! org>
Date:       2009-12-14 0:03:56
Message-ID: dba6c0830912131603r6eaa9e22jbdb1e71f353e31bf () mail ! gmail ! com
[Download RAW message or body]

2009/12/14 Pushkar Pradhan <pradhan.pushkar@gmail.com>:
> I am trying to figure out how theora timestamps map to absolute time values.
> This information would be needed to seek by 1 sec, 5 secs etc.
> I understand the granulepos is interpreted as Absolute number of key frames
> so far | number of frames since last key frame. E.g. 1000|1, 1000|2, ...

No, it is interpreted as:

frame number of most recent keyframe | number of frames since

so for the frame 1000|1, the frame number is simply 1000+1 = 1001.

> How does this map to absolute time in millisecs since the start, I can think
> of the following formula:
> Total number of frames = Total number of keyframes * Key frame interval +
> prediction frames
> Total number of millisecs = (Total number of frames / Frame rate) * 1000
>
> Is this correct?

No, the keyframe interval is not necessarily constant.

so, just take the frame number that I described above, and divide by
the frame rate.

cheers,

Conrad.
_______________________________________________
theora mailing list
theora@xiph.org
http://lists.xiph.org/mailman/listinfo/theora
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic