Log in or register to post comments

How to retrieve YUV Format of video frames?

February 23, 2016 - 6:21pm #1

I'm trying to retrieve the video frame image. I'm using Vuforia iOS SDK 5.0

- (void)renderFrameQCAR {

 

    QCAR::State state = QCAR::Renderer::getInstance().begin();

    QCAR::Renderer::getInstance().drawVideoBackground();

 

    QCAR::Frame frame = state.getFrame();

    int numImages = frame.getNumImages();

 

    for (int i=0; i < numImages; i++) {

        const QCAR::Image* image = frame.getImage(i);

        const uint8_t* pixels =static_cast<const uint8_t*>(image->getPixels());

        NSUInteger width = image->getWidth();

        NSUInteger height = image->getHeight();

        NSUInteger stride = image->getStride();

 

        QCAR::PIXEL_FORMAT format = image->getFormat();

 

        //process the image pixels

        ...

    

       }
}
 
 
I can successfully get the pixel buffer, width, height, stride, format from the image. The problem is that the format from image->getFormat() is YUV. But there are a lot of YUV formats. We don't know which YUV format is for pixels. We cannot do any further process without the details of theYUV format
 
My question is
  1. Is there a way to retrieve the detailed YUV format, such as,  YUV444, YUV420p, NV21 or NV12?
  2. Is there a way to set the YUV format for the video frame in QCAR?  We can set kCVPixelBufferPixelFormatTypeKey for AVCaptureVideoDataOutput, when using iOS AV Founding. Can we do something similiar for QCAR?

How to retrieve YUV Format of video frames?

March 7, 2016 - 6:23pm #3

Thank you, AlessandroB. It is useful for us.

How to retrieve YUV Format of video frames?

February 26, 2016 - 12:32am #2

YUV NV21

Log in or register to post comments