title: FFMPEG - format not available?
body: <p>I'm converting some code from FFMPEG 0.8 to FFMPEG 1.2. I have an error during the call to the method <code>avcodec_open2()</code>:</p>
  <pre class="lang-none prettyprint-override"><code>Specified pixel format %s is invalid or not supported
  </code></pre>
  <p>The format I use is : <code>AV_PIX_FMT_RGB24</code>. It should be enabled by default, right?</p>
  <p>Below is my code:</p>
  <pre><code>av_register_all();
  
  codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
  
  if(!codec)
  {
      throw SystemException(&quot;codec not found&quot;);
  }
  
  codecContext = avcodec_alloc_context3(codec);
  
  codecContext-&gt;bit_rate = 200000;
  codecContext-&gt;time_base.den = 1;
  codecContext-&gt;time_base.num = 90000;
  codecContext-&gt;gop_size = 8;
  codecContext-&gt;pix_fmt = AV_PIX_FMT_RGB24;
  
  _codecContext-&gt;width = 320
  _codecContext-&gt;height = 240
  
  if(avcodec_open2(_codecContext, _codec, NULL) &lt; 0)
  {
      throw SystemException(&quot;Unable to open codec&quot;);
  }
  </code></pre>