A: 

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
Thank you for your replying,Laurent Etiemble. but still I can't convert. Could you give me more information Please.if you give me some code,I appreciate you.Thank you.
SUKIYAKI