假设我的内存中有一个NV12帧作为字节数组。我知道:
到目前为止,这就是我所拥有的:
SwsContext* context = sws_getContext(frameWidth, frameHeight, AV_PIX_FMT_NV12, frameWidth, frameHeight, AV_PIX_FMT_RGB32, 0, nullptr, nullptr, nullptr);
sws_scale(context, 所以我不知道规模的参数应该是什么:
任何帮助都很感激。
发布于 2013-04-22 09:46:20
/// uint8_t * Y;
/// uint8_t * out;
// 2 planes for NV12: Y and interleaved UV
uint8_t * data[2] = {Y, Y + Stride * Height};
// Strides for Y and UV
// U and V have Stride/2 bytes per line;
// Thus, we have 2 * Stride/2 bytes per line in UV plane
int linesize[2] = {Stride, Stride};
uint8_t * outData[1] = {out}; // RGB have one plane
int outLinesize[1] = {frameWidth*4}; // RGB32 Stride
sws_scale(context, data, linesize, 0, Height, outData, outLinesize);https://stackoverflow.com/questions/16112063
复制相似问题