There is a colorspace mismatch between the data of the CGImage and the destination AVFrame. In order to fix that, you need to convert the CGImage data (probably in ARGB) into the YUV420 format (FFMpeg has built-in format converter). You can get information on the colorspace of a CGImage with the CGImageGetBitsPerComponent
, CGImageGetBitsPerPixel
and CGImageGetBytesPerRow
functions.
Laurent Etiemble
2010-06-25 18:46:09