title: FFmpeg C API - seek through live stream
body: <p>I've opened a live RTMP stream using FFmpeg's C library, and I need to programmatically seek to the very end of the stream. This is after the stream is paused for an indeterminate amount of time. The closest I could get is the following:</p>
  
  <pre><code>av_seek_frame(pFormatCtx, -1, pFormatCtx-&gt;duration, 0);
  avcodec_flush_buffers(pCodecCtx);
  </code></pre>
  
  <p>But the duration is 0 for live streams. Any ideas?</p>