title: ffmpeg::avcodec_encode_video setting PTS h264
body: <p>I'm trying to encode video as H264 using libavcodec</p>
  
  <p><code>ffmpeg::avcodec_encode_video(codec,output,size,avframe);</code></p>
  
  <p>returns an error that I don't have the avframe->pts value set correctly.<br>
  I have tried setting it to 0,1, AV_NOPTS_VALUE and 90khz * framenumber but still get the error <code>non-strictly-monotonic PTS</code></p>
  
  <p>The ffmpeg.c example sets the packet.pts with ffmpeg::av_rescale_q() but this is only called after you have encoded the frame !</p>
  
  <p>When used with the MP4V codec the avcodec_encode_video() sets the pts value correctly itself.</p>