APEX AD10 GMSL External Camera Trigger#

Camera working mode selection#

Work mode

Pattern description

Differences in usage

Attention

Use external trigger

The start time of exposure will be controlled by the device, and all cameras will shoot simultaneously.

You can use the default Linux method and the SDK to obtain images.

All cameras need to use the same working mode.

Function and role:#

1 Eliminate the time difference between cameras: In the traditional continuous shooting mode, each camera works independently, and there are slight differences in the time points of exposure and image acquisition. For scenarios such as high-speed moving object analysis, multi-view 3D reconstruction, and precision industrial inspection, this time difference can lead to data misalignment or inconsistency, affecting the accuracy of the results. The external trigger function enables all cameras to strictly follow the command of the same external signal, achieving simultaneous shooting.

1 Unified frame rate control: Through the configuration interface, the system will automatically list all the frequencies commonly supported by all connected cameras for selection, and an accurate trigger frequency can be uniformly set for all cameras that support external triggering.

Key advantages:#

  • High-precision synchronization: All cameras start exposure the moment they receive an external trigger signal, achieving microsecond-level or even higher-precision synchronization.

  • Consistent and controllable frame rate: Uniformly set and verify the shooting frequency of all cameras to ensure the consistency of data acquisition rhythm.

  • Simplified configuration: The external trigger mode can be enabled and the commonly supported frequency can be selected through an intuitive software interface, without the need for complex underlying commands.

  • Flexible compatibility: Supports obtaining the synchronized image stream through the standard Linux method or using our SDK.

Application scenarios:#

  • Autonomous Driving/Robot Vision: Multiple cameras synchronously capture environmental information to ensure the spatio-temporal consistency of perception data.

  • Industrial Automation and Machine Vision: Multi-station synchronous measurement and positioning of high-speed moving objects on the production line, robot guidance and grasping.

  • Sports Science Analysis: Multiple cameras capture the movements of athletes for accurate motion trajectory and pose reconstruction.

  • VR/AR: Build spatial perception or synchronously record the real environment with multiple cameras.

  • Scientific Research Experiments: Experiments that require multiple sensors to collect data at strictly the same time point.

Usage method#

After selecting the corresponding camera, if the camera supports external triggering, the “Use external trigger mode” option will be available.

In the external trigger mode, you can select the supported trigger frequencies.

Since the trigger is the same for all cameras, the selectable frequencies are the trigger frequencies commonly supported by all cameras.

How to verify that the external trigger is successful#

Condition 1: The camera images can be obtained normally#

gst-launch-1.0 -v v4l2src device="/dev/video1" ! video/x-raw,width=1280,height=720,format=UYVY ! xvimagesink

Condition 2: The camera frame rate is consistent with the set trigger frequency.#

You can use the v4l-utils tool in Linux to verify whether the corresponding video port is outputting images normally and whether the frame rate is normal.

Install the v4l-utils tool.

# Update the Ubuntu software source
sudo apt update

# Install tools
sudo apt install v4l-utils

Use this tool to obtain the output images and frame rate based on the resolution of the camera used and the insertion position.

# Take the camera with video0 and 1280x720 resolution as an example
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap

Video output#

You can use the following commands to quickly open the camera to confirm the effect.

Method 1: Quickly turn on the camera without entering parameters#

Light up the camera#

sudo chmod +x /opt/miivii/features/gmsl_camera/bin/cameras_sdk_demo 
cd /opt/miivii/features/gmsl_camera/bin/ 
# Turn on cameras (Automatically turn on all cameras. To turn on a specific camera, specify the channel number) 
./cameras_sdk_demo 

#

Method 2: Enter camera parameters to turn on the camera#

Display a single-channel 720P camera#

gst-launch-1.0 -v v4l2src device="/dev/video1" ! video/x-raw,width=1280,height=720,format=UYVY ! xvimagesink

Display a single 1080P camera#

gst-launch-1.0 -v v4l2src device="/dev/video0" ! video/x-raw,width=1920,height=1080,format=UYVY ! xvimagesink

Display four 1080p cameras#

# Take the camera resolution of 1920x1080 as an example here. Execute the following commands in sequence in the terminal under the Ubuntu desktop.
# Set the display width and height, which can be customized. MIIVII_WIDTH=960
MIIVII_HEIGHT=540 
# Set the image format and actual image width and height of the four cameras 
MIIVII_CONFIG="video/x-raw(memory:NVMM),format=(string)UYVY, width=1920, height=1080"

gst-launch-1.0 nvcompositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$MIIVII_WIDTH sink_0::height=$MIIVII_HEIGHT \
sink_1::xpos=$MIIVII_WIDTH sink_1::ypos=0 sink_1::width=$MIIVII_WIDTH sink_1::height=$MIIVII_HEIGHT \
sink_2::xpos=0 sink_2::ypos=$MIIVII_HEIGHT sink_2::width=$MIIVII_WIDTH sink_2::height=$MIIVII_HEIGHT \
sink_3::xpos=$MIIVII_WIDTH sink_3::ypos=$MIIVII_HEIGHT sink_3::width=$MIIVII_WIDTH sink_3::height=$MIIVII_HEIGHT ! nv3dsink \
nvv4l2camerasrc device=/dev/video0 ! $MIIVII_CONFIG ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! comp. \
nvv4l2camerasrc device=/dev/video1 ! $MIIVII_CONFIG ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! comp. \
nvv4l2camerasrc device=/dev/video2 ! $MIIVII_CONFIG ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! comp. \
nvv4l2camerasrc device=/dev/video3 ! $MIIVII_CONFIG ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)NV12" ! comp.

Problem troubleshooting#

The camera shows no image.#

Check if the camera lens cap is open.

The camera shows a green screen#

Check if the camera only supports self - triggering mode. If so, refer to the advanced section.

The color displayed by the camera is incorrect.#

When the camera image format does not match, the following effects will occur.

At this time, it is necessary to check whether the picture format is set correctly.

Troubleshooting of GMSL Camera Issues#

Phenomenon 1: The camera frame rate is inconsistent with the specification in the manual.#

Solution:#

  1. Verify the camera model configuration:

  1. Connect the camera to the specified device and ensure that the correct camera model is selected in the device’s web settings.

  2. Open the terminal and enter the following command (adjust the parameters according to the actual resolution and interface):

 v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap  
  1. Observe the timestamps in the output results (for example, ts: 33.327ms indicates a frame rate of approximately 30Hz).

  2. If the results are still inconsistent after multiple executions: Contact the camera manufacturer to confirm whether the firmware version is compatible.

Phenomenon 2: Unable to modify the frame rate#

Solution:#

  1. Confirm external trigger support:

  1. Ask the manufacturer if the external trigger mode is supported. If it is supported, try to modify the frame rate through terminal commands:

v4l2-ctl -d /dev/video0 --set-parm=target frame rate
  1. Minor adjustment test:

  • Try to increase or decrease the frame rate by 5Hz based on the default frame rate (for example, if the default is 30Hz, test 25Hz/35Hz):

  • Success: The camera hardware has limited support. You need to consult the manufacturer for the supported frame rate range.

  • Failure: Check for error messages in the driver or system logs (such as SDK errors) and fix them accordingly.

Phenomenon 3: The camera cannot be turned on or shows a black screen#

Solution:#

  1. Hardware adaptation check: Confirm that the camera model is on the compatibility list supported by the device (contact the manufacturer to obtain the latest list).

  2. Check whether the camera interface (such as GMSL/USB) is plugged in tightly, and that the cable is not damaged or oxidized.

  3. Configuration node consistency: In the device web settings, ensure that the selected camera node number is consistent with the actual physical interface (for example, interface 2 corresponds to “Camera 2” in the configuration).

  4. Hot-plug handling: If the camera is re-plugged, the configuration needs to be re-saved in the web settings or the service needs to be restarted to take effect.

Phenomenon 4: The image appears green.#

Solution:#

  1. Image format correction:

  1. Confirm that the camera output format (such as YUV422) is consistent with the system configuration (common formats are UYVY or YUYV).

  2. In case of format mismatch: Contact the manufacturer to update the camera firmware, or use debugging tools to switch the display mode.