[Libav-user] Encoding RGB Data to YUV420p

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Feb 14 02:11:20 CET 2013


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



More information about the Libav-user mailing list