title: FFMPEG h264. I do not need all frames
body: <p>I am following the simple loop of sending packets to a decoder and receiving frames from it</p>
  <pre><code>    ret := lib.avcodec_send_packet(c.СodecContext, packet.avPacket)
      frame := lib.av_frame_alloc()
      ret = lib.avcodec_receive_frame(c.СodecContext, frame)
  </code></pre>
  <p>Once I have a frame I send it over to a different library for face detection. I only need to send frames to the second library once in a while, say once in 400ms. As a result, more often than not, I allocate space for the frames, receive them and immediately discard them. Is there a way to keep sending packets to the decoder so it could keep its internal state consistent without receiving any frames until I need them? I have tried using skip_frame field, but it seems like it skips packets completely without applying them to its internal state. As a result I receive frames with artifacts once I set the skip_frame field back to AVDISCARD_NONE. Any help will be highly appreciated. Thank you.</p>