Quartz Composer iSight Prank

by Chris Adamson

I had a nightmare where someone turned on my iSight and started spying on me.

It looked a little something like this:

The above only works if you have Tiger and an iSight or other webcam. Still, it's quite a freak out moment when someone else can turn on your iSight and incorporate it into their web page, even though you're the only one seeing it.

How this trick works: Quartz Composer all the way. If you've installed the dev tools, this is definitely something to play with.

The actual composition is trivial and consists of just two pieces: the video input and a billboard to render it:

image

Drag a line from the video input's "Image" output to the billboard's "Image" input, then use the inspector on the billboard to set the width to 2 (you don't set the height because a billboard keeps the aspect ratio of its sources).

Export this to a QuickTime movie, 320x240. Notice how it's only 8KB - Quartz Composer compositions are a new track type for QuickTime, and they can be quite compact (especially if, like here, they don't have any media samples of their own). Open the movie in QT Player just to make sure things are hoopy. Note that only one app can use your camera at a time, so you'll have to close the Quartz Composer viewer (or quit QC) for QT Player to get the video. Happy? Embed the video in HTML (I have the boiler plate in an old QuickTime for Java article, under the heading "When Not to use QuickTime for Java"). Now you're all set to scare your dear friends.

BTW, this idea is not original to me by any means. I was originally freaked out by seeing my own image on bbum's blog-o-mat, which adds a series of video effects to the capture image (again, totally what Quartz Composer was built to do). A sample of that page:

image

Notice my wife's G4 Cube over my shoulder!

And I only went looking for that because of an Apple BoF at JavaOne where they showed an "A-ha Effect" video playing in a Java CocoaComponent.

Come to think of it, should I pitch Derrick an article on Quartz Composer? :-)


4 Comments

Michael_Maibaum
2005-07-21 03:18:27
the video is not sent over the wire...
just to clarify to the other bloggers in the trackbacks - there is no privacy leak - QC is just showing the local data available, nothing is going out to the other webserver or anywhere.


invalidname
2005-07-21 03:40:22
the video is not sent over the wire...

Good point, Michael. That's what I was trying to say with the phrase "even though you're the only one seeing it," but it probably doesn't make the point strongly enough. This is only happening within the context of your own browser.

-Chris (invalidname

Ogg
2006-04-12 09:14:59
Nice, you can always save it as a screen saver to.
MacUser
2006-06-05 17:12:31
CUBE!!!!!