Pergunta

Does anyone know how to convert Intel Media SDK (version: Media SDK 2010) H.264 video frame decoded output NV12 format to RGB888 (RGB24) bit conversion?

Basically Media SDK decoder output will be in NV12 format and the render needs the RGB24 bit format, so if any conversion code avaiable for converting NV12-->RGB24 would be great help for us.

Foi útil?

Solução

Have a look at YUV to RGB Conversion and afterwards you can use the information about YUV pixel formats (link directs to NV12) as input to the first link and do the conversion.

Outras dicas

Check out this code: https://github.com/andrechen/yuv2rgb Although it for NV21, but the only difference is order of UV (VU) bytes. All you need to do, is to reverse the order (loadvu function):

static void loadvu(int& U, int& V, unsigned char const* &uv) {
    U = (*uv++) - 128;
    V = (*uv++) - 128;
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top