How to access a webcam on a MacBook?

How can I access a FaceTime / iSight camera built into MacBook / MacBook Pro and iMac on Mac OS X Lion? I have to imagine that there is a way to access this outside of using Xcode. What libraries do I need to feed to g ++ and how do I compile it? I know that people did it, I'm just not sure how I would do it.

+8
c ++ image g ++ camera macos
source share
1 answer

On Mac OS X Lion, you'll want to use the AV Foundation framework to capture video. The AV Foundation Programming Guide provides clear instructions for capturing audio and video. You do not need to use Xcode, but you need to use some Objective-C. If you mainly program in C ++, you will usually have an Objective-C object compiled using the Objective-C ++ compiler to configure various AV Foundation objects and to act as a video capture delegate to which video frames are attached. After you receive the video frames, you can transfer them back to your C ++ code, which will be used at your request. The whole process is not particularly complicated if you have moderate experience with Objective-C.

Please note: if you need to target Mac OS X versions to Lion (10.7), you will have to use QTKit. It also requires Objective-C, and the methods for using it are similar, but the possibilities of this structure are more limited.

+5
source share

All Articles