i have captured video using AVFoundation .i have set (video setting )and get in outputsamplebuffer kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange format. But i need YUV420 format for further processing .
My doubt is
1.difference among 420YpCbCr8BiPlanarVideoRange,420YpCbCr8BiPlanarFULLRange, 420YpCbCr8PlanarFullRange,420YpCbCr8Planar
and YUV420 ?
2.how can i convert 420YpCbCr8BiPlanarVideoRange to YUV420 ?
3. How to Convert YUV420 To 32BGRA ?
4) or some other Way to do this??? that is Any open source library or Apple Framework....
i have gone through Accelerate framework ...... it has image conversion for following planar8,planerF,RGBA8888
etc... Any way to equal those formats with 32BGRA/YUV420/ 420YpCbCr8BiPlanarVideoRange
and Do my requirement?????
Thanks in advance
thanks in advance
The main differences are:
If you have a biplanar format, then the Y data (luminance) and the CbCr data (chroma or color information) are in two separate memory areas called planes. You can use CVPixelBufferGetBaseAddressOfPlane
with index 0 to get the Y data and index 1 to get the CbCr data. If the format is planar, then both kinds of data are in the same plane (first all the Y values, then all Cb values and finally the Cr values).
If you have a full range format, then the values from 0 to 255 are used for each luma or chroma value. Video range format only use values from 16 to 235 (for some historical reasons).
The term 420 indicates how much luma and how much chroma information the format contains. It basically says that there is luma information for each pixel and chroma information for each 2x2 block.
YUV420 is - as far as I can tell - not a precisely specified format. It is often use for a planar YpCbCr 420 format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With