title: Convert from NV12 to RGB/YUV420P using libswscale
body: <p>I'm developing an application which needs to transform NV12 frames from h264_cuvid decoder to RGB in order to modify those frames. I checked <a href="https://stackoverflow.com/questions/16112063/how-can-i-use-ffmpegs-swscale-to-convert-from-nv12-to-rgb32/45924479#45924479">this question</a> but I don't not the 'Stride' value.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>uint8_t *inData[2] = { videoFrame-&gt;data[0], videoFrame-&gt;data[0] + videoFrame-&gt;width * videoFrame-&gt;height };
  int inLinesize[2] = { videoFrame-&gt;width, videoFrame-&gt;width };
  
  sws_scale(convert_yuv_to_rgb, inData, inLinesize, 0, videoFrame-&gt;height, aux_frame-&gt;data, aux_frame-&gt;linesize);
  </code></pre>
  
  <p>But it does not work. Although the problem is on colours because I can see the luminance plane correctly.</p>