<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#666666">
    On 03/15/2011 01:41 PM, Benjamin M. Schwartz wrote:
    <blockquote cite="mid:4D7FA4E7.6070103@fas.harvard.edu" type="cite">
      <pre wrap="">On 03/15/2011 01:36 PM, Bjoern D. Rasmussen wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Since Theora is fed with a
framerate which isn't precise the time of each frame when I play it in
VLC doesn't match the exact time of when the frame occurred. So
basically I wonder how can I sync a video frame to a clock using
Theora and Ogg?
</pre>
      </blockquote>
      <pre wrap="">
Ogg Theora operates at a strictly fixed framerate.  If you start the
stream at 30 fps, then it is a 30 fps stream, and the time of each frame
is exactly determined by its number.  If your webcam is dropping frames
then you must fill in the gaps.  You can most easily do this by submitting
frames multiple times to make up for any dropped frames.

The encoder has various optimizations for the special case of duplicate
frames, but these are not important for your immediate problem.

--Ben
</pre>
    </blockquote>
    Ben and others on this list know about this much more than I do, but
    I thought we should mention that if you want to get something like
    "variable" frame rates, you just set your framerate to the lowest
    common denominator of all possible frame rates, and then just use
    drop frames in the stream to fill in the blanks between the times
    that your real video frames come in.  This sounds a lot more
    complicated than Ben's suggestion, but I just thought I'd throw it
    out...and also appear like I know what I'm talking about.<br>
    <br>
    (That is, until someone corrects what I said because I got it
    wrong...:p)<br>
  </body>
</html>