There are additional libraries in libav named libavfilter and libswscale. Use one of these libraries to convert your images, I recommend swscale as it can be done in a few lines. Read up on the sws_getContext and sws_scale functions. You will have to make your RGBA vector into an AVPicture too, also not difficult. As the poster above mentioned, those C programs will have in depth examples.<div>
<br></div><div>Marty<br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 8:48 PM, Chris Share <span dir="ltr"><<a href="mailto:cpsmusic@yahoo.com" target="_blank">cpsmusic@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>I'm new to video programming (my background is audio programming). Could you expand on this please?</span></div><div><br></div>
  <div style="font-family:'times new roman','new york',times,serif;font-size:12pt"> <div style="font-family:'times new roman','new york',times,serif;font-size:12pt"> <div dir="ltr"> <font face="Arial"> <hr size="1">
  <b><span style="font-weight:bold">From:</span></b> Carl Eugen Hoyos <<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>><br> <b><span style="font-weight:bold">To:</span></b> <a href="mailto:libav-user@ffmpeg.org" target="_blank">libav-user@ffmpeg.org</a> <br>
 <b><span style="font-weight:bold">Sent:</span></b> Thursday, 14 February 2013 12:11 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Libav-user] Encoding RGB Data to YUV420p<br> </font> </div><div><div class="h5">
 <br>Chris Share <cpsmusic@...> writes:<br><br>> I've got the
 .png image data in a vector as RGB data <br>> (0-255 range).<br>> <br>> What I'm not clear about is how to convert this image <br>> data to YUV420p format as per the decoding_encoding.c <br>> example.<br>
<br>See the scaling_video.c and filtering_video.c examples:<br>You can either use the scale filter or libswscale directly.<br><br>> I posted a question on this topic on a general <br>> programming site and it was suggested that I should <br>
> convert the RGB data to YUV444 and then convert this <br>> to YUV420p. Is that correct?<br><br>It does not sound correct (or at least not the easiest way) <br>to me.<br><br>Carl Eugen<br><br>_______________________________________________<br>
Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br><br> </div></div></div> </div>  </div></div><br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div>