title: VideoCapture cap(0) from Kinect v1 Sensor on Mac
body: <p>I would like to capture video frames from Kinect v1 sensor by using the OpenCV line VideoCapture cap(0) in Xcode. However, I only managed to capture frames from my Mac's webcam. If I changed to VideoCapture cap(1), I got "out device of bound" error. Anyone can help to solve this?</p>
  
  <p>I'm using:</p>
  
  <p>1) MacOS Sierra version 10.12
  2) Xcode Version 8.3.3 (8E3004b)
  3) Opencv 3.2.0, installed using cmake-3.9.2_0.darwin_16.x86_64</p>
  
  <p>This is the output when executing <code>ffmpeg -hide_banner -f avfoundation -list_devices true -i ""</code> :</p>
  
  <pre><code>[AVFoundation input device @ 0x7fcc1851b740] AVFoundation video devices:
  [AVFoundation input device @ 0x7fcc1851b740] [0] FaceTime HD Camera
  [AVFoundation input device @ 0x7fcc1851b740] [1] Capture screen 0
  [AVFoundation input device @ 0x7fcc1851b740] AVFoundation audio devices:
  [AVFoundation input device @ 0x7fcc1851b740] [0] Built-in Microphone
  : Input/output error
  </code></pre>
  
  <p>Below is my code:</p>
  
  <pre><code>VideoCapture cap(0); //capture the video from webcam
  
  if ( !cap.isOpened() )  // if not success, exit program
  {
      cout &lt;&lt; "Cannot open the web cam" &lt;&lt; endl;
      return -1;
  }
  
  while (true) {
  
      Mat img;
      cap.read(img);
      namedWindow( "Video Streams", CV_WINDOW_AUTOSIZE );
      imshow("Video Streams", img);
  
      if (waitKey(30) == 27)
      {
          break;
      }
  }
  
  return 0;
  </code></pre>
  
  <p>}</p>