Camera Nodes¶
libavg supports a number of different camera capture subsystems. Each subsystem supports different features, and may need to be setup slightly differently. Currently, the most advanced subsystems are the firewire subsystems (libdc1394 for linux/mac and cmu1394 for windows).
General Setup¶
The tracker module and the CameraNode both use the same camera code, so the settings are similar:
driver |
The camera subsystem to use. Valid values are firewire (uses libdc1394 version 2.x under linux/mac and cmu1394 under windows), v4l and directshow. |
device |
The camera device to access. The exact format of this parameter depends on the driver chosen. |
unit |
The unit within the device to use. This allows support e.g. for stereo cameras (or channel switching in the case of tv cards). Again, the exact format depends on the driver. |
format |
The pixel format the camera should use for the images. |
capturewidth ,captureheight |
Camera node only: The width and height of the camera image. Corresponds to the size entry in avgtrackerrc. |
framerate |
Frames per second to be delivered by the camera. If this is higher than the rate at which the frames are used, excess camera frames are discarded. |
fw800 |
Boolean parameter that determines whether to use 800 mbit firewire. Sadly, there is no easy way to autodetect support for this, so it needs to be set to True whenever an 800 mbit data rate is desired. |
In addition, there are several camera settings parameters (brightness, exposure, sharpness, saturation, gamma, shutter, gain and strobeduration) which may or may not be supported by the camera or the driver. The firewire drivers support all of them. Note that in the case of firewire, the exposure parameter is auto exposure. Setting a parameter to -1 turns on auto mode.
To test the setup, the avg_showcamera.py
utility is available. Start it without parameters to access the documentation. avg_showcamera.py --list
outputs a list of available cameras and image formats.
Subsystems¶
Firewire libdc1394¶
This subsystem is active under Linux and Mac OS X if driver is set to firewire. It supports version 2.x of libdc1394. libdc1394 is a library for interacting with firewire cameras that conform to the DCAM specification. It should work with any firewire camera that implements this specification. Driver-specific parameters are:
decive |
Used as the guid (in hex) of the device to open. If this parameter is 0 (the default), the first camera on the bus is opened. |
unit |
This corresponds to the DCAM unit in the device that should be opened. Again, 0 is the default and implies that the first unit should be opened. |
Firewire CMU1394¶
This subsystem is active under Windows if driver is set to firewire. It uses the CMU 1394 Camera Driver to support DCAM-compatible firewire cameras. Driver-specific parameters are:
device |
Used as the guid (in decimal) of the device to open. If this parameter is 0 (the default), the first camera on the bus is opened. |
unit |
Unsupported |
Video4Linux¶
Video4Linux is the video capture framework for Linux. It supports a wide variety of capture devices, including USB webcams and TV capture cards. Driver-specific parameters are:
device |
The device file to open. Default is /dev/video0 |
unit |
The v4l channel to open. |
The v4l_info utility is very helpful in determining the modes supported by attached devices.
DirectShow¶
DirectShow is Microsoft's multimedia framework. Most cameras should work with this capture subsystem. Driver-specific parameters are:
device |
The device string format for DirectShow is fairly flexible. If you do not care which camera is used, you may simply leave this parameter blank. If you need to specify a specific camera, set this parameter to be either the 'Display Name', the 'Device Description', or some part of the 'Device Instance Path' for the device. These bits of information can be found within the 'Device Manager' 'Device Properties' entry for the device under the 'Details' tab. |
unit |
Unused |