1

Is there any way using AVFoundation and CoreVideo to get color info, aperture and focal length values in real-time?

Let me explain. Say when I am shooting video I want to sample the color in a small portion of the screen and output that in RGB values to the screen? Also, I would like to show what the current aperture is set at.

Does anyone know if it is possible to gather these values? Currently I have only seen that this is possible with still images.

Ideas?

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412

3 Answers3

2

AVCaptureStillImageOutput will get you a real time still from the video stream, including exif data for focal length, aperture, etc. Color info you could calculate yourself from that bitmap.

akaru
  • 6,299
  • 9
  • 63
  • 102
  • I am developing an iOS application and I need to get the same information as Nic Hubbard (exif data, especially for focal length). I am unable to get this value from AVCaptureStillImageOutput, I tried a lot of stuff founded on SO and other website. I asked a question here : http://stackoverflow.com/questions/22142395/how-to-get-exif-data-from-avcapturestillimageoutput If you can have a look a it, would be very very helpful for me! – Humbertda Mar 06 '14 at 17:00
  • The focal length is fixed but differs from product models. As another user posted, ifixit.com may have that information available @Humbertda – Pavan Mar 17 '14 at 20:38
1

AVFoundation, CoreVideo, and CoreMedia include support for getting a video bitmap in "real-time". From there you can process a portion of the RGB pixels however you want.

I don't know of any current public iOS API to get you the aperture.

The focal length is fixed, but differs between product models. ifixit.com might have that info.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
0

You can get the aperture by:- camera.lensAperture this will give the aperture of the camera of iPhone whichever you selected

Saurav_Sharma
  • 130
  • 1
  • 10