Edgertronic multi-camera synchronization genlock

From edgertronic high speed video camera
Jump to navigation Jump to search

Note: Genlock terminology changed in software release v2.5.2. The change was done in a way that is backwards compatible for controlling applications that use CAMAPI.

Overview

Genlock settings

Genlock is a mode where a source camera provides frame start and trigger signals to one or more receiver cameras. The source and receiver cameras capture frames at the at the exact same rate, with the start of exposure synchronized to within +/- 1 uS of each other. Trigger events are processed by the source and distributed to the receivers in manner that causes the source and receiver camera to trigger on the exact same frame.

For each frame that is captured, the cameras go through three phases: exposure, frame data readout and idle. As long as the receiver camera has a positive idle time the receiver will stay in genlock with the source. During the exposure phase and frame data readout phase a receiver camera will ignore start-of-exposure signals from the source.

There are limitations:

  • All cameras have to be configured for compatible timing (see below). For one-to-one frame lock, each receiver has to be set to a frame rate that is greater than or equal to the source's frame rate.
  • The user is responsible to make sure all cameras can be triggered before issuing a trigger. There is no automated check that verifies whether or not a receiver camera has completed saving the previously captured video, finished the calibrate operation, has available storage, etc.

All cameras must have identical settings except for Genlock Mode, Sensitivity and Shutter. The Shutter value must not limit frame rate. You are responsible for configuring each camera; there is no configuration information flowing over the genlock cable. Incorrect camera configuration will lead to unusable videos.

Should you wish to violate the above and have different settings, you must always guarantee the following:

  1. What ever the settings (exposure, resolution etc) the receiver must be able to keep up with the source. Just because you set the source to 1000 fps doesn't magically make an SC1 set to 1280x1024 able to run faster that 494 fps.
  2. The receiver must not be set for more post-trigger frames than the source. The source camera only sends genlock timing pulses when it is filling the pre and post trigger buffers. When the source post-trigger buffer is filled, the source will stop sending pulses until it is ready for the next capture. Until then, if a genlock receiver still wants to capture more post-trigger frames, it will loose genlock sync.

Cabling

Edgertronic-2-cameras-with-genlock-cable.jpeg

The frame timing and trigger are sent on a single wire in the IO (external trigger) connector. In the simplest setup, with one source and one receiver camera, all that is needed is a 3 conductor, 2.5mm male to 2.5mm male, patch cord cable to connect the cameras. The cable was included with the camera. If you need another 3 conductor 2.5mm male to 2.5mm male patch cord cable they are commonly available.

You can also use an accessory product, the Genlock Adapter for longer cabling runs and/or supporting more than 2 genlocked cameras.

Initial configuration

The cameras need to have unique IP addresses. If you are not using DHCP, you can buy a simple 4-port network switch (such as a D-Link DES-105 5 Port 10/100 Network Switch or the D-Link DGS-105 5 Port Gigabit Network Switch. For initial configuration, plug the PC and one receiver camera into the network switch. Leave the PC configured for network IP address 10.11.12.1 and the genlock source camera configured for network IP address 10.11.12.13. Each receiver camera needs a different, unique IP address, such as 10.11.12.14, 10.11.12.15, etc. Refer to the network setup instructions to see how to set each receiver camera's IP address. Remember you can only have one receiver connected at a time when setting the camera's IP address. Once all receiver cameras have been configured, plug all cameras into the network switch. There is no need to power off the cameras.

Browse to the camera you chose to generate the genlock source; from the above instructions it will be at http://10.11.12.13. Configure the camera settings with genlock being configured as source. Then browse to each receiver camera and configure each one with identical settings, except of course set genlock to receiver. Once configured and properly cabled, look at the LEDs on all cameras to verify all cameras are in the run state (solid green camera LED). A blinking red camera LED indicates that the receiver camera isn't receiving a genlock signal.

Once the cameras are wired, configured, and triggerable, go ahead and trigger the source camera to verify the receiver cameras are responding to the trigger. During capture, look at the camera LED on each camera and verify none of them are blinking white. A blinking red/white camera LED indicates that camera was not able to maintain genlock. Check each captured video to verify the results are what you expected.

Customize camera settings

Browse to each receiver camera and adjust the settings. There are setting limitations:

  • For one-to-one frame lock, each receiver has to be set to a frame rate greater than or equal to the source's frame rate.
  • The number of post-trigger frames (Frame_rate * Duration * (1 - Pretrigger_percentage/100) must be greater than the source's post-trigger frames. Once a source has filled it's post-trigger buffer, it will momentarily stop sending genlock signals and this will make the receivers unhappy if they still expect to capture more post-trigger frames.

Once all the camera settings are adjusted, do another trial video capture to verify the timing is compatible. The metadata file will indicate if each receiver camera was able to maintain genlock.

Additional technical details, if you are trying different settings on different cameras:

  • Post trigger duration of the source camera has to be as long as the longest post trigger duration of one of the receiver cameras.
  • Frame rate must be the same on all cameras
  • Resolution can be different

Metadata file

There are two genlock related settings in each captured video metadata file.

Key Value Meaning
Genlock Off
Source
Receiver
External
Camera genlock setting.
Genlock locked True
False
None
Indicates if the receiver camera was able to maintain genlock throughout the video capture. Set to NA if camera is not configured as a genlock receiver.

There are several metadata file keys whose meaning can be effected when genlock is enabled:

Key Meaning
Frame rate The source is slowed down slightly to make sure it doesn’t over-run the receiver. All that is required is the source period must be greater than or equal to the min period that the receiver can run at given the receiver's allowed settings. This includes a little fudge factor for clock frequency error and jitter due to cabling.
Frame count The receiver may capture more frames than the source, even with identical settings, because of the frame rate adjustment that ensures both cameras stay synchronized.
Trigger delay For the receiver camera, trigger delay is meaningless. Trigger delay is reported correctly for when the camera is configured for external genlock.

Camera Settings

The genlock setting is stored on the camera so the value is used the next time you power on the camera. The value is also available in the metadata file. The possible Genlock values are described below:

Key Value Meaning
Genlock Off Camera will respond to trigger events as normal and generate its own start-of-exposure timing signal.
Source Camera will provide both the genlock trigger and genlock start-of-exposure signals on the External trigger connector.
Receiver Camera will get trigger and start-of-exposure from the External trigger connector.
External An external timing source is providing the start-of-exposure signal. The external trigger signal can be used to trigger the camera when configured for external genlock.

Genlock status reporting

Only the genlock receiver will report genlock status information, specifically genlock receiver timing error. If the receiver camera is in genlock, then normal camera status information is provided. Genlock status reporting is provided via the LEDs and CAMAPI get_camstatus() API.

LEDs

When a receiver camera is unable to maintain genlock the camera LED will blink red/white. Once the receiver camera is maintaining genlock, the camera LED will stop blinking white after a five second timeout. Entering the calibrating or saving state will clear the blinking white camera LED.

If the receiver camera doesn't detect any genlock signal, the camera LED will blink red.

Automation using CAMAPI

The original design concept for genlock was the same for the camera itself - capturing critical videos to get insight into the physical world. The video capture process was anticipated to be through the web user interface and a simple trigger button, which is all that is needed to manually capture a handful of videos. Once the edgertronic camera was integrated into more complex workflows, the use model changed, and additional aspects of the camera's overall operation need to be taken into account.

Although the cameras are in lock-step synchronization for triggering and capturing each frame, there are other aspects of the cameras that are operating asynchronously.

  • Local storage - an SD card may be full on one camera, but not on another camera.
  • SD card performance is difficult to predict. Even two SD cards in the same packaging bought at the same time might have noticeable different performance characteristics. A new SD card tends to be noticable faster until all the underlying NAND storage has been used once, then the needed erase cycles cause the performance to drop.
  • The time it takes a camera to finish the current capture and start putting pre-trigger frames in the next buffer can also be affected by the SD card performance.

If the receiver camera is experiencing a genlock timing error, the CAMAPI get_camstatus() API returns a dictionary containing the flags keyword with CAMAPI_FLAG_RECEIVER_GENLOCK_ERROR flag (0x40000) bit is set. Once the receiver camera is maintaining genlock, the CAMAPI_FLAG_RECEIVER_GENLOCK_ERROR flag is cleared after a five second timeout. In addition, entering the calibrating or saving state will clear the CAMAPI_FLAG_RECEIVER_GENLOCK_ERROR flag.

Feature interaction

  • If camera Serial console is enabled, genlock setting is forced to Off.
  • If camera is configured as a genlock receiver, camera will ignore all trigger local events (web UI trigger button, multi-function button, CAMAPI trigger() invocation, etc); expecting a genlock trigger over the External trigger connector.
  • Each camera generates its own timing for the calibration cycle.
  • When configured as a receiver camera, the camera will only use the receiver camera's frame rate setting if the genlock start-of-exposure signal is not detected for 100 ms.

False Triggers

  • Plugging in genlock cable may trigger both source and receiver cameras.
  • Unplugging genlock cable may trigger both source and receiver cameras.
  • Powering off a genlocked camera may trigger any other connected cameras.

Metadata file

The metadata file on the source camera will contain an entry indicating the delay from the incoming trigger and the start of the first frame following the trigger. The trigger delay value in the metadata file created by the receiver cameras is meaningless.

File naming

There are several CAMAPI mechanisms (trigger(), rename_last_video(), selective_save()) to allow you to name the file when you trigger the camera. How should filenaming be for handling for a group of genlocked cameras?

Example: A data acquisition system includes multiple genlocked cameras to capture an event where the event, such as a baseball pitch. The data acquisition system creates a unique GUID identifier for each event. The need is to include the GUID in the filename to enable post event data correlation.

The recommended design is to separate the camera trigger from assigning the filename. Under most conditions, sending the CAMAPI rename_last_video() using stage set to RENAME_STAGE_TRIGGERED right after triggering the genlocked cameras to each of the cameras in the genlock group.

Technical description

  • For genlock to function properly, the receiver camera(s) must support a frame rate greater or equal to the source camera's output frame rate. The easiest way to ensure this is to use identical settings on all cameras. The source camera will decrease its maximum allowed frame rate slightly to allow for the slight clock differences that are possible between the source and receiver cameras.

Signaling

The camera can be triggered from three sources:

The UI / CAMAPI trigger() API, Multi-function button, and Tip of phone jack are logically or-ed together and only the source camera responds to the trigger event.

2.5mm phone
jack signal
Genlock
OFF mode
Genlock
SOURCE mode
Genlock
RECEIVER mode
Genlock
EXTERNAL mode
tip trigger input signal
(3.3V LVCMOS, active low)
trigger input signal
(3.3V LVCMOS, active low)
unused trigger input signal
(3.3V LVCMOS, active low)
ring unused genlock output signal to receiver camera(s)
(combined frame start and trigger)
frame start input signal
(3.3V LVCMOS, active low)
frame start input signal
(3.3V LVCMOS, active low)
sleeve ground

You can use the cable listed below to genlock two cameras (which does not support external trigger via wired remote).

We recommend if you are going to genlock more than 2 cameras, use Genlock Adapters. If you are good with a soldering iron, you can make your own custom cable. To genlock 3 to 5 cameras, or to use an switch closure to trigger the source, you will need to make your own cable. To have an external trigger, you will need to make a custom cable. The signalling from the source genlock camera can drive up to 4 receiver genlock cameras. If you need to connect more than 4 receiver genlock cameras, then you will need to increase the drive by using an active cable with a 3.3V LVCMOS buffer. You can get 5v from the USB port, but will need to step it down to 3.3V before powering the VLCMOS buffer. If this doesn't make sense to you, then please use Genlock Adapters to drive more than 4 receiver genlock cameras.

If you are making your own cable, note that the wired trigger we supply will ground both the tip and ring when the button is pressed. Connect the trigger's tip and sleeve to the source camera tip and sleeve respectively, and DO NOT connect the trigger ring to either camera. Look at the table above and you'll understand why.

If you are having problems with your cabling, test out genlock using the supplied 12' 2.5mm male-male genlock camera between the source camera and one receiver camera. Setup the two cameras in the UI, and then trigger the source from the UI. Both cameras should be synced and trigger at the same instant. If you are having problems when using your custom cabling, please check your wiring.

Electrically, the tip and ring are identical circuits, with the exception that the tip is always an input, while the ring is an output on the genlock source camera and an input on all genlock receiver cameras. Each signal has a 4.7K pullup to 3.3V, followed by a 165 Ohm series resistor. The other end of the 165 Ohm resistor connects to an ESD diode clamping array (GND and 3.3V), an FPGA 3.3V LVCMOS GPIO and an SOC LVCMOS 3.3V IO.

Genlock Adapter

The Genlock Adapter allows you to capture frame synchronized videos where the camera are separated by more than 25 feet. In general, you need one Genlock Adapter per camera, unless you are routing the cabling through wiring closets, then you may need additional powered Genlock Adapters in each wiring closet.

Specs

Figure 1: Front panel
Figure 2: Back panel

Dimensions (exclusive of cables) are 108.5mm x 87.5mm x 30.5mm

Ports

The Genlock Adapter has the following ports:

You must connect one, but not both of the following inputs:

  • IN - Genlock Input from an upstream Genlock Adapter. Connect using up to 1000' of Cat-5 or Cat-6 cable. This is NOT an Ethernet port. DO NOT connect to network hardware (POE Injectors, switches, routers etc.).
  • SOURCE IN - Genlock Input from genlock source camera. Set one camera to Genlock source mode and connect using the supplied 2.5mm male to male cable. As a special case, when a genlock source camera is connected to the SOURCE IN port, you can also connect a wired or wireless trigger to the TRIGGER IN port.

One or more of the following Genlock outputs can be connected:

  • OUT1 - OUT4 - Genlock outputs to downstream Genlock Adapters. Connect using up to 1000' of Cat-5 or Cat-6 cable. This is NOT an Ethernet port. DO NOT connect to network hardware (POE Injectors, switches, routers etc.).
  • RECEIVER OUT / TRIGGER IN - Genlock Output to genlock receiver camera. Set the intended Receiver camera to Genlock Receiver mode and connect using the supplied 2.5mm male to male cable. As a special case, when a genlock source camera is connected to the SOURCE IN port, you can also connect a wired or wireless trigger to the TRIGGER IN port.

The Genlock Adapter requires 5V @ 500mA

  • POWER - Connect one of the POWER ports to an edgertronic camera USB port, or an external USB charger, using the supplied USB male A to USB male A cable. You may use the second POWER port to daisy-chain power to a second Genlock Adapter box.

Wiring

After you design your cabling layout, verify all of the following assertions are true:

  • Each camera has one Genlock Adapter
  • Each camera has one CAT5 cable used for Ethernet that goes to an Ethernet switch
  • Each genlock receiver camera has one CAT5 cable going from the camera's Genlock Adapter to another camera's Genlock Adapter
  • The genlock source camera has no more than four CAT 5 cables from genlock receiver camera's Genlock Adapters
  • Each Genlock Adapter that is not next to a camera has a USB power supply and a power source for the USB power supply
  • Maximum genlock CAT5 segment length is 1000 ft.
  • No network cable extenders being used for the genlock CAT5 wiring.

Genlock source camera

  • Using a 2.5mm male/male cable, connect the IO port, on the back of the genlock source camera, to the SOURCE IN port on the front of the Genlock Adapter
  • Using a USB A to A cable, connect one of the USB ports, on the back of genlock source camera, to one of the POWER ports on the front of the Genlock Adapter
  • Using CAT5 or CAT6 cable(s), connect one or more the the OUT1-OUT4 ports, on the back of the Genlock Adapter, to the IN port(s) on the front of one or more downstream Genlock Adapters.
  • Using the supplied power adapter or POE splitter, connect 12V to the power jack on the back of the genlock source camera.
  • Connect ethernet to the back of the genlock source camera.
  • Optionally, connect a wired or wireless trigger to the TRIGGER IN port, on the front of the Genlock Adapter, to trigger the genlock source camera and all downstream receiver cameras.

The Genlock adapter is NOT an ethernet network device. To prevent severe damage, DO NOT connect the Genlock Adapter to any ethernet network port (switches, routers, POE, servers, computers etc).

Genlock receiver camera

  • Using a 2.5mm male/male cable, connect the IO port, on the back of the genlock receiver camera, to the RECEIVER OUT port on the front of the Genlock Adapter
  • Using a USB A to A cable, connect one of the USB ports, on the back of genlock receiver camera, to one of the POWER ports on the front of the Genlock Adapter
  • Using a CAT5 or CAT6 cable, connect the IN port, on the front of the Genlock Adapter, to one of the OUT1-OUT4 port(s) on the back of an upstream Genlock Adapter.
  • Optionally, using CAT5 or CAT6 cable(s), connect one or more the the OUT1-OUT4 ports, on the back of the Genlock Adapter, to the IN port(s) on the front of one or more downstream Genlock Adapters.
  • Using the supplied power adapter or POE splitter, connect 12V to the power jack on the back of the genlock receiver camera.
  • Connect ethernet to the back of the genlock receiver camera.

The Genlock adapter is NOT an ethernet network device. To prevent severe damage, DO NOT connect the Genlock Adapter to any ethernet network port (switches, routers, POE, servers, computers etc).

Genlock Adapter connection examples

The Genlock Adapter supports several different wiring deployments.

The most important fact to keep in mind is not to confuse the cable – CAT5 – with the signaling protocol; ethernet signaling for camera control and genlock signaling for, well, genlock. CAT5 cabling with RJ45 connectors was chosen because it is inexpensive, well designed, and ubiquitous. However, using CAT5 cabling for two incompatible purposes can easily lead to confusion. CAT6 is a higher quality cable, and can be used in place of CAT5.

The diagrams below are more readable if you click on them to expand their size.

Diagram wire color list:

Color Example Usage
Medium Slate Blue            Camera power, 12v 2.5A. Included with camera.
Laser Lemon            Ethernet network cable for camera configuration, monitoring and control. 2 meter cable included with camera.
Lime Green            2.5mm cable for connecting genlock source camera genlock signal to Genlock Adapter SOURCE IN port. 1 meter cable included with Genlock Adapter.
Violet            USB A to USB B cable for powering Genlock Adapter. 1 meter cable included with Genlock Adapter.
Scarlet Red            CAT5 with RJ45 connectors for connecting two Genlock Adapters together. Maximum CAT5 length between two Genlock Adapters is 1.5 kilometers.
Dark Green            2.5mm cable for connecting Genlock Adapter RECEIVER OUT to genlock receiver camera. 1 meter cable included with Genlock Adapter.

Genlock cable extender

If you have two camera more than 25 feet apart, you can extend the distance by using two Genlock Adapters, as shown in the diagram.

Genlock-adapter-diagram-extender-topology.svg

If the camera are more than 1000 ft apart you can put additional genlock adapters at least every 1000 ft. Power each Genlock Adapter, except the first and last, with a USB power supply.

Star or home run topology

If your cabling is going to follow typical small installation ethernet wiring, there will be one wiring closet that contains the ethernet network switch. This wiring topology is call star or alternately home run topology.

Genlock-adapter-diagram-star-topology.svg

For example, if you have one genlock source camera and 3 genlock receiver cameras, the following equipment would be needed for star topology.

  • 4 cameras, one configured as genlock source camera and 3 cameras configured as genlock receiver.
  • 5 Genlock Adapters, one for each camera and one for the wiring closet. One USB power supply is needed for the Genlock Adapter in the closet.
  • 4 genlock CAT5 cables, going from the wiring closet to each camera.
  • 4 2.5mm cables that are included with the Genlock Adapter.
  • 5 USB-A to USB-A cables that are included with the Genlock Adapter.
  • 1 USB charger.
  • If you have a second wiring closet, with more cameras to connect, the pattern repeats. The figure show a second wiring closet with an additional Genlock Adapter and USB charger.

Daisy chain topology

One Genlock Adapter per camera, each camera having 3 CAT5 cables (1 Ethernet, 2 genlock), except for genlock source camera and the last receiver camera only needing 2 CAT5 cables (1 Ethernet, 1 genlock).

Genlock-adapter-diagram-daisy-chain-topology.svg