3.3. Image output settings via CUI#
In this section, we configure the GMSL board by using the command line.
Attention
This setting must be done at the GMSL2-10GbE conversion module side. Please check this content
3.3.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, mount the device tree storage device.
sudo mount /dev/mmcblk1p1 /mnt
The device tree file are stored in the /mnt/dtbs
directory.
/mnt/dtbs/<CAMERA_TYPE>/<NUMBER_OF_CAMERA_P1>p1_<NUMBER_OF_CAMERA_P2>p2/system.dtb
CAMERA_TYPE
: connected camera type [isx021
(C1 camera) orimx490
(C2 camera)]NUMBER_OF_CAMERA_P1
: number of camera connected with port1 (P1) [0
~4
]NUMBER_OF_CAMERA_P2
: number of camera connected with port2 (P2) [0
~4
]
Then copy these device tree file to /mnt/
directory.
If you want to connect one C1 camera to P1 and one to P2, enter the following command to update the device tree file.
sudo cp /mnt/dtbs/isx021/1p1_1p2/system.dtb /mnt/.
After entering the above command, reboot the system to apply the settings.
sudo reboot
3.3.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
3.3.3. Streaming the image#
Finally, the image is output by using the following commands.
To output the image data from P2 port (UDP port 5008-5011)
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap
To output the image data from P1 port (UDP port 5004-5007)
v4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap
To output the image data from both P1 and P2 port
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap &
v4l2-ctl -d /dev/video1 --set-fmt-video=width=1920,height=1280,pixelformat=UYVY --stream-mmap
To output the image data from P2 port (UDP port 5008-5011)
v4l2-ctl -d /dev/video0 --set-fmt-video=width=2880,height=1860,pixelformat=UYVY --stream-mmap
To output the image data from P1 port (UDP port 5004-5007)
v4l2-ctl -d /dev/video1 --set-fmt-video=width=2880,height=1860,pixelformat=UYVY --stream-mmap
To output the image data from both P1 and P2 port
v4l2-ctl -d /dev/video0 --set-fmt-video=width=2880,height=1860,pixelformat=UYVY --stream-mmap &
v4l2-ctl -d /dev/video1 --set-fmt-video=width=2880,height=1860,pixelformat=UYVY --stream-mmap
To stop the image stream, press Ctrl-C
in case you start streaming without &
. In the case you start the image stream with &
, the process runs in the background. In this case, you can find the corresponding process by using the pidof
command, then you can kill that process by using the kill
command.
pidof v4l2-ctl
sudo kill <displayed numbers>
Warning
When changing streaming settings, stop streaming once and start streaming again.