title: libx264 encode error Input picture width (40) is greater than stride (0)
body: <p>I used libx264 in ffmpeg to encode video, I used the configuration below.</p>
  
  <pre><code>enCodecContext-&gt;bit_rate = 300000;
  enCodecContext-&gt;width = 80;
  enCodecContext-&gt;height = 60;
  enCodecContext-&gt;time_base = (AVRational) {1, 25};
  enCodecContext-&gt;gop_size = 10;
  enCodecContext-&gt;max_b_frames = 1;
  enCodecContext-&gt;pix_fmt = PIX_FMT_YUV420P;
  enCodecContext-&gt;qcompress = 0.6;
  av_opt_set(enCodecContext-&gt;priv_data, "preset", "slow", 0);
  </code></pre>
  
  <p>But when I called <code>avcodec_encode_video2</code> with <code>enCodecContext</code>, I got the error <code>Input picture width (40) is greater than stride (0)</code>.</p>
  
  <pre><code>avcodec_encode_video2(enCodecContext, &amp;filteredAVPacket, pFilteredAVFrame, &amp;got_packet_ptr);
  </code></pre>
  
  <p>The <code>pFilteredAVFrame-&gt;width</code> and <code>pFilteredAVFrame-&gt;height</code> is <code>80</code> and <code>60</code> respectively.</p>
  
  <p>Did I missed something when configured <code>libx264</code>, How can I get a workable configuration for <code>libx264</code> to encode my video?</p>