4.5. Image output settings via REST API#

In this section, we use web REST API for image output configuration.

Attention

The following REST-API command example is an example when configured using DHCP(Linux). If you are using a static IP, replace kria-gmsl.local with GMSL2-10Gb Ethernet board IP address.

4.5.1. Setting the number of connected cameras#

Attention

There are some points to note about connecting the camera. Please check this page for details.

First, the number of connections setting must match the number of connected cameras.

Please follow the steps below to set up the number of connections setting.

  1. Input following command in terminal.

    curl  -d '{"cam_type": "1", "num_p1": 1, "num_p2": 1}' -H "Content-Type: application/json" -X POST http://kria-gmsl.local:3000/setup-cam-num
    
    • cam_type: connected camera type (default:1)

      • 1: C1

      • 0: C2

    • num_p1: number of camera connected with port 1 (1~4, default:4)

    • num_p2: number of camera connected with port 2 (1~4, default:4)

  2. Input following command in terminal to apply the settings.

    curl -X POST http://kria-gmsl.local:3000/reboot-setup
    

You can set the equivalent meaning with the configurations described in CUI or GUI.

4.5.2. Image output configuration#

Then configure the board depending on the connected camera.

Caution

Up to v9 image, all GMSL ports will be assigned to either C1 or C2 camera. Combination of the C1 camera and C2 camera is not allowed.

curl -X POST http://kria-gmsl.local:3000/setup-cam1
curl -X POST http://kria-gmsl.local:3000/setup-cam2-10
curl -X POST http://kria-gmsl.local:3000/setup-cam2-20

4.5.3. Streaming the image#

Finally, start the image streaming.

  • To output the image data from P2 port (UDP port 5004-5007)

    curl -X POST http://kria-gmsl.local:3000/streaming-cam1-des1
    
  • To output the image data from P1 port (UDP port 5008-5011)

    curl -X POST http://kria-gmsl.local:3000/streaming-cam1-des2
    
  • To output the image data from both P1 and P2 port

    curl -X POST http://kria-gmsl.local:3000/streaming-cam1-des12
    
  • To output the image data from P1 port (UDP port 5004-5007)

    curl -X POST http://kria-gmsl.local:3000/streaming-cam2-des1
    
  • To output the image data from P2 port (UDP port 5008-5011)

    curl -X POST http://kria-gmsl.local:3000/streaming-cam2-des2
    
  • To output the image data from both P1 and P2 port

    curl -X POST http://kria-gmsl.local:3000/streaming-cam2-des12
    

Warning

When changing streaming settings, stop streaming once and start streaming again.

You can set the equivalent settings with the CUI or GUI.