What's the difference between CVImageBuffer which is returned by CMSampleBufferGetmageBuffer
and CVPixelBuffer? I just want to retrieve the image planes (RGBA) but I can't figure out how to retrieve this information from CVImageBuffer. I'm using Swift.
Thanks.
A Core Video pixel buffer is an image buffer that holds pixels in main memory. Applications generating frames, compressing or decompressing video, or using Core Image can all make use of Core Video pixel buffers.
An interface for managing different types of image data.
They are identical in swift. If you look at the definition underneath, you will see this:
public typealias CVPixelBuffer = CVImageBuffer
which means that you can use you can use the methods here if you want to find the image planes(I don't know what that means exactly). But CVPixelBuffer is a concrete implementation of the abstract class CVImageBuffer. There are two types of CVImageBuffers in use at the moment-CVPixelBuffers and OpenGLBuffers. You can choose to break the abstraction if you know for certain that your CVImageBuffer is a CVPixelBuffer.
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