Working with multiple cameras
Top  Previous  Next

Before creating your multiple camera application, you should configure your local network for multiple camera setup.

The easiest way to operate multiple GigE Vision cameras is to use a single network adapter and Gigabit Ethernet switch. You can also operate multiple cameras through multiple network adapters installed on your system. In this case, each network card and corresponding camera must be assigned a subnet different from the subnet of another network card/camera.

For the two-camera connection through a pair of network adapters follow the procedure below.

a) Make sure two Gigabit Ethernet cards are installed on your system.

b) Refer to steps 1-7 of Network Setup and configure each network card with the following addresses:

Network card 1: IP address: 169.254.100.1 Subnet mask: 255.255.255.0  
Network card 2: IP address: 169.254.200.1 Subnet mask: 255.255.255.0  
     
c) Connecting both cameras to corresponding adapters, one by one, and using the manufacturer provided IP configuration utility assign the following address to the camera:

Camera 1: IP address: 169.254.100.2    Subnet mask: 255.255.255.0  
Camera 2: IP address: 169.254.200.2      Subnet mask: 255.255.255.0  
 
Your system is now configured for working with two cameras.


Programmatically, interfacing to multiple cameras is as easy as dropping a few ActiveGige objects on the surface of your application.

1. Start by creating a new project. Depending on the development environment you are using, refer to one of the following chapters for more details:
Visual Basic
Visual C++
VB.NET
Visual C#

2. Configure each ActiveGige object for a different camera by clicking a corresponding ActiveGige window and modifying the Camera property. Do not configure different ActiveGige objects for the same camera. Multiple instances of ActiveGige cannot acquire video from the same camera. For the same reason, if you run several ActiveGige-based applications, make sure that each of them connects to a different camera.

3. Add FrameAcquired event handlers per each ActiveGige object following the procedure for your language environment. Due to the multithreading nature of ActiveGige, they will not interfere with each other.

4. Add the acquisition command for each ActiveGige object to initiate the video streaming. In VB.NET you might have the following lines in your code:

AxActiveGige1.Acquire =
True
AxActiveGige2.Acquire = True
AxActiveGige3.Acquire = True

5. If you want to process the situation when a camera is being plugged or unplugged, add CameraPlugged and CameraUnplugged events to your code.

6. For more information refer to the code of the MultiGcam sample.

The same general rules apply if you use DirectShow. You can run several instances of the Video Capture Source Filter in your system or in your application provided each instance is configured for a different camera. If you execute several copies of a DirectShow-based video capture application such as Microsoft's Amcap, each of them will attempt to automatically configure itself for a different camera and memorize corresponding camera settings in the system registry upon exiting. As an alternative, you can use the FilterConfig utility to register several GigE Vision DirectShow devices in the system, each one associated with a specific camera. For more information on using DirectShow refer to DirectShow Reference Guide.