Vizard 8 » Reference » Multimedia » VideoCamera extension » Generic capture devices
8.3.1

Generic capture devices

This VideoCamera implementation provides an interface to connect to any standard DirectShow capture device. This commonly includes web cameras and DV cameras.

Example

Here is an example that will connect to the next available capture device:

#Create Video Camera extension
video = viz.add('VideoCamera.dle')

#Connect to next available generic video capture device
cam = video.addWebcam()

This example will connect to the capture device using the maximum provided image size:

#Create Video Camera extension
video = viz.add('VideoCamera.dle')

#Connect to capture device using maximum image size
cam = video.addWebcam(size=video.WEBCAM_MAX_SIZE)

Interface

The generic capture device implementation provides the following video camera extension commands:

Method

Description

video.addWebcam(id = -1 , size = video.WEBCAM_DEFAULT_SIZE )

Connect to the capture device at the specified id and requested size.

 

id is 0-based index of the capture device to connect to. If id is less than zero, then the next available capture device will be connected to.

 

size can be a (width,height) tuple containing the desired capture size, or one of the following size constants:

 

  video.WEBCAM_DEFAULT_SIZE - The default size provided by the device

  video.WEBCAM_MAX_SIZE - The largest size supported by the device

  video.WEBCAM_MIN_SIZE - The smallest size supported by the device

  video.WEBCAM_MAX_FPS - The largest size with the fastest capture rate.

 

video.getWebcamNames(available=False)

Returns a list of all the detected capture device names. If available is True, this will return a list of all the capture devices that are not already in use by Vizard.