简体   繁体   中英

Capture MacBook Pro iSight video with C++

I'd like to grab a frame from my MacBook Pro iSight in C++ and do some elaborations on it. I already know how to do that in ObjC with QTKit, but is there any way to do the same thing in C++?

NOTE: I tried to install OpenCV with macports, but the framework doesn't seem to support iSight cameras.

You could do that using OpenCV ( http://opencv.willowgarage.com/wiki/ )

And here is a sample code you can copy/paste to try it : http://www.geckogeek.fr/lire-le-flux-dune-webcam-camera-video-avec-opencv.html (article in french but code is in english)

You can also use the Integrating Vision Toolkit ( http://ivt.sourceforge.net ), which supports Mac OS X and Quicktime.

Here are the steps:

  1. Install the Quicktime SDK, if you haven't yet.
  2. Download the current version of the IVT and unpack the archive.
  3. Set the flag 'USE_QUICKTIME = 0' to 'USE_QUICKTIME = 1' in IVT/src/Makefile.base
  4. Run 'make' in IVT/src
  5. Run 'make' in IVT/examples/CaptureApp
  6. Run '../../files/make_app.sh CaptureApp captureapp' in IVT/examples/CaptureApp
  7. Run the application, either by double clicking on the generated icon, or by typing 'open CaptureApp.app'.

If you have any questions, let me know (you can find my contact information on the IVT homepage). I also answer questions in the IVT Sourceforge forum usually quite fast.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM