1

I'm using the following AVCaptureVideoDataOutputSampleBufferDelegate method to get the Brightness Value, Exposure, and other bits of metadata from a video output in realtime. However, the meta data dictionary returns NULL. I took the code snippet from WWDC 10, so maybe something has changed since then.

- (void) captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {

    CFDictionaryRef metaDict = CMGetAttachment(sampleBuffer, CFSTR ("MetadataDictionary"), NULL);

    if (metaDict) {
        CFShow(metaDict);
    }
}

I've also noticed a similar question was asked and the response was to use:

NSDictionary *exifDictionary = (NSDictionary*)CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary, NULL);

But the compiler doesn't recognize kCGImagePropertyExifDictionary. It's looking for a CFStringRef for that parameter.

silverSuns
  • 218
  • 2
  • 16

0 Answers0