title: Video capture of an external USB webcam with python cv2 (on Windows)
body: <p>I am trying to capture a video via python (cv2) from an external usb webcam (Logitec c922 pro stream) on Windows.
  In order to verify that the connection is working even for an image capture, I tried the following code:</p>
  
  <h1>___________________________________</h1>
  
  <pre><code>import cv2
  cam = cv2.VideoCapture(-1)
  while True:
      s, img = cam.read()   
      picName = 'pic.png'
      cv2.imwrite(picName, img)
  </code></pre>
  
  <h1>___________________________________</h1>
  
  <p>When I run this code, a dialog box opens to choose between the 2 external cameras connected. When I choose the Logitec camera, it is turned on but the saved images are black, which is not what the camera views.</p>
  
  <ol>
  <li>Can I skip the dialog box part and choose the Logitec camera via the code?</li>
  <li>How can I capture actual images from the external webcam?   </li>
  </ol>