How to convert one pixel format to another? (420f to n12)

239 views Asked by At

So I'm getting frames in CV420YpCbCr8BiPlanarFullRange pixel format. That is a bi-planar 4:2:0 thingy.

I need to convert it to some of the formats consumed by a third party library, for example this one. enter image description here

At first sight it seems that it's the same format, but unfortunately the picture is mangled. Any ideas where is the problem? And what are some libraries that allow for conversion between the formats?

video_frame.p_data = (uint8_t *)CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 1); 

doesn't work. Neither does getting the base address of the structure.

0

There are 0 answers