Determining size of data[0] in AVFrame of FFMPEG
To get the buffer size:
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
To copy pixel data:
int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
int width, int height,
unsigned char *dest, int dest_size);