isight snippets

How to capture photos/videos with iSight and Objective-C

Tagged cocoa, isight, objective-c, record  Languages objectivec

There are plenty of resources online that explain how to access iSight:

This article explains how to use QuartzComposer for capturing images with iSight. The benefit of using QuartzComposer is that you don't have to write a lot of code to capture an image. All you have to do is setup a QCView with IB and bind it to an outlet, then to get the snapshot you call this method:

NSImage *screenshot = [isightView snapshotImage];

Alternatively, you could also use:

- (id) createSnapshotImageOfType:(NSString*)type

The code in the article didn't work for me:

NSImage *currentImage = [qcView valueForOutputKey:@"ImageOutput"];

The article also forgot to mention that you have to import and link to the following frameworks:

#import <QuartzCore/QuartzCore.h>
#import <Quartz/Quartz.h>

Haven't tried this one yet.

This example is not complete.

Have a look at one of the demos like StillMotion