title: VLC: "avcodec error: more than 5 seconds of late video"
body: <p>I'm muxing mpeg4 video to avi container. The video stream is ~4fps, so I set <code>AVCodecContext</code> <code>time_base</code> to 1/4 (<code>formatContext-&gt;streams[0]-&gt;codec-&gt;time_base</code>...) , and then rescal each frame timestamp, because the original time-stamps are in milliseconds. The resulting value I assign to a packet <code>pts</code> and <code>dts</code>. </p>
  
  <p>When I play this avi with VLC, the video is not smooth, and I get the following message repeatedly: </p>
  
  <blockquote>
    <p>avcodec error: more than 5 seconds of late video -> dropping frame
    (computer too slow ?)</p>
  </blockquote>
  
  <p>Is there something wrong with the above pts/dts calculation?</p>
  
  <p>The following table demonstrates how the timestamps are rescaled (original->rescaled)</p>
  
  <pre><code>stream: 0 1329471005111-&gt;1
  stream: 0 1329471005348-&gt;2
  stream: 0 1329471005588-&gt;3
  stream: 0 1329471005828-&gt;4
  stream: 0 1329471006068-&gt;5
  stream: 0 1329471006308-&gt;6
  stream: 0 1329471006551-&gt;7
  stream: 0 1329471006788-&gt;8
  stream: 0 1329471007028-&gt;9
  stream: 0 1329471007268-&gt;10
  stream: 0 1329471007508-&gt;11
  stream: 0 1329471007748-&gt;12
  stream: 0 1329471007988-&gt;13
  stream: 0 1329471008228-&gt;14
  stream: 0 1329471008468-&gt;15
  </code></pre>