[Libav-user] How to Convert AV_PIX_FMT_RGB24 to AV_PIX_FMT_YUV420P
cpsmusic at yahoo.com
Thu Feb 14 12:46:42 CET 2013
Chris Share <cpsmusic at ...> writes:
>> The scaling_video.c is close to what I need however the
>> conversion is the opposite of what I want. What I'm
>> not clear about is how to change the "fill_yuv_image"
>> function to something like "fill_rgb_image".
>The function is used to provide an artificial source image.
>You don't need it since you already have an input image.
>> How does the RGB data get written into the
>> "uint8_t *data"? Is it written consecutively (all R
>> values get written to data, all G values to data, etc.)?
>That would be planar RGB, see PIX_FMT_GBR.
>RGB is a packed format, see libavutil/pixfmt.h
Does that mean I should use AV_PIX_FMT_GBRP as the input format?
In pixfmt.h it mentions the following: "///< planar GBR 4:4:4 24bpp". Does this mean that each color value needs to be set to a 24-bit data type?
Also, I'm still not clear about how to get the RGB data into the "uint8_t *src_data" - how do I actually do this?
>Note that all this has limited relevance for you if you
>don't rescale yourself but use the scale filter (or
Sorry, but I'm not sure what you mean.
More information about the Libav-user