FFmpeg——AVFrame中 的 data
AVFrame中 的 data 的定义如下:
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。typedef struct AVFrame { #define AV_NUM_DATA_POINTERS 8 /** * pointer to the picture/channel planes. * This might be different from the first allocated byte * * Some decoders access areas outside 0,0 - width,height, please * see avcodec_align_dimensions2(). Some filters and swscale can read * up to 16 bytes beyond the planes, if these filters are to be used, * then 16 extra bytes must be allocated. * * NOTE: Except for hwaccel formats, pointers not needed by the format * MUST be set to NULL. */ uint8_t *data[AV_NUM_DATA_POINTERS]; // ... } AVFrame;
对于planar模式的YUV:
- data[0]指向Y分量的开始位置
- data[1]指向U分量的开始位置
- data[2]指向V分量的开始位置
- data[0]指向数据的开始位置
- data[1]和data[2]都为NULL

更多精彩