<p>Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? </p>

[{'answer_id': 8977, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 2, 'selected': False, 'text': '<p>I don\'t have a Mac here, but there is some Documentation up here:</p>\n\n<p><a href="http://developer.apple.com/documentation/Hardware/Conceptual/iSightProgGuide/01introduction/chapter_1_section_1.html" rel="nofollow noreferrer">http://developer.apple.com/documentation/Hardware/Conceptual/iSightProgGuide/01introduction/chapter_1_section_1.html</a></p>\n\n<p>It looks like you have to go through the QuickTime API. There is supposed to be a Sample Project called "MungGrab" which could be worth a look according to <a href="http://www.mailinglistarchive.com/quicktime-api@lists.apple.com/msg02698.html" rel="nofollow noreferrer">this thread</a>.</p>\n'}, {'answer_id': 9128, 'author': 'dbr', 'author_id': 745, 'author_profile': 'https://Stackoverflow.com/users/745', 'pm_score': 0, 'selected': False, 'text': "<p>Aside from ObjC, you can use the PyObjC or RubyCocoa bindings to access it also. If you're not picky about which language, I'd say use Ruby, as PyObjC is horribly badly documented (even the official Apple page on it refers to the old version, not the one that came with OS X Leopard)</p>\n\n<p>Quartz Composer is probably the easiest way to access it, and .quartz files can be embed in applications pretty easily (and the data piped out to ObjC or such)</p>\n\n<p>Also, I suppose there should be an example or two of this in the /Developer/Examples/</p>\n"}, {'answer_id': 9975, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 1, 'selected': False, 'text': '<p>There\'s a command line utility called <code><a href="http://www.intergalactic.de/pages/iSight.html" rel="nofollow noreferrer">isightcapture</a></code> that does more or less what you want to do. You could probably get the code from the developer (his e-mail address is in the readme you get when you download the utility).</p>\n'}, {'answer_id': 10698, 'author': 'Nick Brosnahan', 'author_id': 528, 'author_profile': 'https://Stackoverflow.com/users/528', 'pm_score': 3, 'selected': False, 'text': '<p>You should check out the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004574-CH1-DontLinkElementID_41" rel="nofollow noreferrer">QTKit Capture documentation</a>.</p>\n\n<p>On Leopard, you can get at all of it over the RubyCocoa bridge:</p>\n\n<pre><code>require \'osx/cocoa\'\nOSX.require_framework("/System/Library/Frameworks/QTKit.framework")\n\nOSX::QTCaptureDevice.inputDevices.each do |device|\n    puts device.localizedDisplayName\nend\n</code></pre>\n'}, {'answer_id': 11150, 'author': 'Jeremy', 'author_id': 1114, 'author_profile': 'https://Stackoverflow.com/users/1114', 'pm_score': 2, 'selected': False, 'text': '<p>If you poke around Apple\'s mailing lists you can find some code to do it in Java as well. <a href="http://lists.apple.com/archives/QuickTime-java/2007/Jan/msg00003.html" rel="nofollow noreferrer">Here\'s a simple example suitable for capturing individual frames</a>, and <a href="http://lists.apple.com/archives/QuickTime-java/2005/Nov/msg00036.html" rel="nofollow noreferrer">here\'s a more complicated one that\'s fast enough to display live video</a>.</p>\n'}, {'answer_id': 280972, 'author': 'Kristof Van Landschoot', 'author_id': 15745, 'author_profile': 'https://Stackoverflow.com/users/15745', 'pm_score': 1, 'selected': False, 'text': '<p>One thing that hasn\'t been mentioned so far is the <a href="http://developer.apple.com/documentation/GraphicsImaging/Reference/IKImagePicker_Class/IKImagePicker_Reference.html" rel="nofollow noreferrer">IKPictureTaker</a>, which is part of Image Kit.  This will come up with the standard OS provided panel to take pictures though, with all the possible filter functionality etc. included.  I\'m not sure if that\'s what you want.</p>\n\n<p>I suppose you can use it from other languages as well, considering there are things like <a href="http://www.cocoadev.com/index.pl?CocoaBridges" rel="nofollow noreferrer">cocoa bridges</a> but I have no experience with them.</p>\n\n<p>Googling also came up with <a href="https://stackoverflow.com/questions/57424?sort=newest">another question on stackoverflow</a> that seems to address this issue.</p>\n'}, {'answer_id': 2193100, 'author': 'meduz', 'author_id': 234547, 'author_profile': 'https://Stackoverflow.com/users/234547', 'pm_score': 0, 'selected': False, 'text': '<p>From a related question which specifically asked the solution to be pythonic, you should give a try to <a href="http://github.com/motmot/pycamiface" rel="nofollow noreferrer">motmot\'s camiface</a> library from Andrew Straw. It also works with firewire cameras, but it works also with the isight, which is what you are looking for.</p>\n\n<p>From the tutorial:</p>\n\n<pre><code>import motmot.cam_iface.cam_iface_ctypes as cam_iface\nimport numpy as np\n\nmode_num = 0\ndevice_num = 0\nnum_buffers = 32\n\ncam = cam_iface.Camera(device_num,num_buffers,mode_num)\ncam.start_camera()\nframe = np.asarray(cam.grab_next_frame_blocking())\nprint \'grabbed frame with shape %s\'%(frame.shape,)\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/8970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/85/']