title: FFmpeg : Encode Rgb Frames (AvFrames) to H264
body: <p>When I encode Rgb24 frame with H264 I get &quot;input width is greater than than stride&quot;...</p>
  <p>By the way if I give raw image which is Yuv420p, ffmpeg successfully encodes it...</p>
  <p>What I wanted to know is:</p>
  <p>i) Do we have to give Yuv format for encoding? Can't give rgb frame for encoding h264?<br />
  ii) If we can give rgb frame, what is the trick?</p>