title: pygame Camera class Error: Cannot set capture resolution
body: <p>I'm trying to save a screenshot from a camera to a file. I'm using Python 2.7 32 bit and pygame 1.9 32 bit on Windows 8. I spent a while Googling this problem and couldn't find much online.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import pygame
  import pygame.camera
  import sys
  
  pygame.camera.init()
  pygame.display.set_mode((800, 600))
  cameraCount = len(pygame.camera.list_cameras())
  if cameraCount &lt; 1:
      print "No cameras found!"
      raw_input()
      sys.exit(0)
  
  x = 0
  
  if cameraCount &gt; 1:
      print "Multiple cameras found, choose a number 0 through ", cameraCount
      x = -1
      while int(x) &gt; cameraCount or int(x) &lt; 0:
          x = raw_input()
  
  cam = pygame.camera.Camera(x)
  cam.start()
  snapshot = cam.get_image()
  pygame.image.save(snapshot, "testing.png")
  print "done!"
  raw_input()
  </code></pre>
  
  <p>And here is the error I am receiving:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Cody\Desktop\Python\cameraa.py", line 21, in &lt;module&gt;
      cam = pygame.camera.Camera(x)
    File "C:\Python27\lib\site-packages\pygame\_camera_vidcapture.py", line 52, in
   __init__
      self.dev.setresolution(width, height)
  vidcap.Error: Cannot set capture resolution.
  </code></pre>
  
  <p>I found a list of my webcam's supported resolutions and tried each once of them, none of which worked.</p>
  
  <p>Any help is appreciated, thanks.</p>