On Tue, 12 Feb 2013 15:34:13 -0800 (PST), Chris Share <[email protected]> wrote: > Hi, > > I posted the following to this forum a week ago but received no response. Can > anyone help with this? > > I'm new to libav. I'd like to write a simple test application that converts a > .png image to a movie. I'm basing my code on the "output-example.c" example. > The .png image data is stored in an array of chars as RGBA values. > > Am I right in thinking that I need to substitute the code in "fill_yuv_image" > with code that writes the array of chars to the AVFrame? > > Is there an example of how to do this anywhere? > > I'm not clear about a few things here: > > Firstly, do I need to rearrange the RGBA data in the input vector so that > it's suitable for encoding as YUV420p? I imagine I need to remove the A data > (?) > > Secondly, I understand that there's a Y value for every pixel and that the Cb > and Cr values are used for four (2x2) pixels. What I don't understand is how > the RGB data gets "reduced" to the Cb and Cr values - is there an example of > how to do this anywhere? >
You certainly don't want to do manual conversion between RGB and YUV. That's what libswscale is for. -- Anton Khirnov _______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
