[Libav-user] Encoding RGB Data to YUV420p

Marty Sullivan mjs5450 at rit.edu
Thu Feb 14 15:33:46 CET 2013


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.

Marty

On Wed, Feb 13, 2013 at 8:48 PM, Chris Share <cpsmusic at yahoo.com> wrote:

> I'm new to video programming (my background is audio programming). Could
> you expand on this please?
>
>   ------------------------------
> *From:* Carl Eugen Hoyos <cehoyos at ag.or.at>
> *To:* libav-user at ffmpeg.org
> *Sent:* Thursday, 14 February 2013 12:11 PM
> *Subject:* Re: [Libav-user] Encoding RGB Data to YUV420p
>
> Chris Share <cpsmusic at ...> writes:
>
> > I've got the .png image data in a vector as RGB data
> > (0-255 range).
> >
> > What I'm not clear about is how to convert this image
> > data to YUV420p format as per the decoding_encoding.c
> > example.
>
> See the scaling_video.c and filtering_video.c examples:
> You can either use the scale filter or libswscale directly.
>
> > I posted a question on this topic on a general
> > programming site and it was suggested that I should
> > convert the RGB data to YUV444 and then convert this
> > to YUV420p. Is that correct?
>
> It does not sound correct (or at least not the easiest way)
> to me.
>
> Carl Eugen
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130214/fcde1e1a/attachment.html>


More information about the Libav-user mailing list