Apex Dual Orin GMSL Camera Develop#

Developing with V4L.#

You can use the v4l-utils tool on Linux to verify if the corresponding video interface is working properly and if the frame rate is normal.

To install the v4l-utils tool, follow these steps.

#Update Ubuntu
sudo apt update

#Install
sudo apt install v4l-utils

Use the tool to capture images and check the frame rate based on the resolution and the camera’s interface.

#Take a camera with a resolution of 1280x720 connected to video0 for example.
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720 --stream-mmap

Save the image.

#For example, with a camera on video0 with a resolution of 1280x720, where --stream-count represents the number of frames to be saved, and --stream-to represents the file name to save to.
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720 --stream-mmap --stream-count=1 --stream-to=miivii_1280x720.yuv

Developing with Jetson Multimedia.#

In addition to the v4l-utils tool, Miivii devices come pre-loaded with the Jetson multimedia-api package, which can also be used to verify image capture. If you need to develop source code using the v4l2 framework, it is recommended to refer to Nvidia’s sample code provided below.

Compile the Jetson multimedia source code package.

#Enter the source code package.
cd /usr/src/jetson_multimedia_api
#Compile the samples.
sudo make

Miivii devices support direct running of the following two samples.

#Preview video.
cd /usr/src/jetson_multimedia_api/samples/12_camera_v4l2_cuda/
sudo ./camera_v4l2_cuda -d /dev/video0 -s 1920x1080 -f UYVY