title: Reliably get PTS values in ffmpeg?
body: <p>I'm trying to write a method that will provide the next frame and presentation time stamp when queried.  The code currently looks something like this:</p>
  
  <pre><code>while( getNextFrame(image, pts) )
  {
      // show current image
      drawImage(currentImage);
      sleep(pts);
      currentImage = image;
  }
  </code></pre>
  
  <p>I've been following the Dranger tutorials to this point, but have stalled on reliably getting a PTS value for frames (<a href="http://www.dranger.com/ffmpeg/tutorial05.html" rel="nofollow">http://www.dranger.com/ffmpeg/tutorial05.html</a>).  The PTS values returned are always 0.</p>
  
  <p>Also, <code>get_buffer()</code> has been deprecated, so I'm now using the <code>get_buffer2()</code> method to set the global pts value.  However, the <code>release_buffer</code> method has also been deprecated and I can't seem to find it's replacement.  This leads me to believe that the method laid out in the tutorials may no longer be the best way of accomplishing this task.</p>
  
  <p>In short, using up to date ffmpeg, what's the best way to grab frame pts values reliably?</p>