title: Setting and getting properties of Python cv2.VideoCapture object does not work
body: <p>I am trying to set the return format for a video stream from an Imaging Source DFK31AU03 USB 2.0 camera. When I get the video format using the following Python2 code:</p>
  
  <pre><code>import cv2
  
  # Get a handle to the camera
  cam = cv2.VideoCapture(0)
  
  # Print various camera properties
  print "CV_CAP_PROP_FORMAT: " + str(cam.get(cv2.cv.CV_CAP_PROP_FORMAT))
  print "CV_CAP_PROP_MODE: " + str(cam.get(cv2.cv.CV_CAP_PROP_MODE))
  print "CV_CAP_PROP_FPS: " + str(cam.get(cv2.cv.CV_CAP_PROP_FPS))
  print "CV_CAP_PROP_CONTRAST: " + str(cam.get(cv2.cv.CV_CAP_PROP_CONTRAST))
  print "CV_CAP_PROP_GAIN: " + str(cam.get(cv2.cv.CV_CAP_PROP_GAIN))
  print "CV_CAP_PROP_FRAME_WIDTH: " + str(cam.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH))
  print "CV_CAP_PROP_FRAME_HEIGHT: " + str(int(cam.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
  print "CV_CAP_PROP_POS_FRAMES: " + str(cam.get(cv2.cv.CV_CAP_PROP_POS_FRAMES))
  print "CV_CAP_PROP_EXPOSURE: " + str(cam.get(cv2.cv.CV_CAP_PROP_EXPOSURE))
  
  # Edit a troublesome property and print again
  cam.set(cv2.cv.CV_CAP_PROP_MODE, cv2.cv.CV_8UC1);
  
  # Print the "MODE" property again
  print "\n-- This is one of the problem variables --"
  print "The \"MODE\" property should be set to: " + str(cv2.cv.CV_8UC1)
  print "CV_CAP_PROP_MODE: " + str(cam.get(cv2.cv.CV_CAP_PROP_MODE))
  
  # Release the handle to the camera
  cam.release()
  </code></pre>
  
  <p>This code prints some of the properties of the camera. For me, the problem is that many of the properties print as -1.0 or 0.0 when they should have other values. The documentation that I have found for this class is quite poor and there is little explanation as to what each value means and possible reasons for the properties of the camera not being returned. The camera I am using is not cheap.</p>
  
  <p>Here is a sample output of the code as it runs for me:</p>
  
  <p><a href="https://i.stack.imgur.com/5G7WO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5G7WO.png" alt="enter image description here"></a></p>
  
  <p>Is it the case that my camera does not have access to these properties? It is not cheap camera so this would be surprising. Any help would be appreciated. </p>