title: How to fill 'extradata' field of AVCodecContext with SPS and PPS data?
body: <p>Here is the problem:  When decoding H264 stream with <code>ffmpeg</code>, I can obtain raw data of SPS and PPS but I have no idea how to fill them into the <code>extradata</code> field of <code>AVCodecContext</code>.  Without <code>extradata</code>, I can't decode frames properly.  Every time I call <code>avcodec_decodec_video2</code>, the return value is positive but the <code>got_picture</code> flag is always <code>zero</code>.</p>
  <p>The stream I am dealing with looks like this:</p>
  <pre><code>[0x67]...[0x68]...[0x61]...[0x61]...  .......  [0x61]...[0x67]...[0x68]...  ......
  </code></pre>