Email WhatsApp
WeChat
WeChat QR

Table of Contents

List USB Cameras with v4l2-ctl

v4l2-ctl --list-devices groups the video device nodes Linux has registered, so you can see which /dev/video* entries belong to a USB camera. Open one of those entries with v4l2-ctl -d and you can check what it can capture before you hand the path to an app.

On an SBC like the KiwiPi 5 Pro, this is a good check to do over SSH before you start pulling in libraries for a vision project. The terminal can tell you which node carries frames, which formats the camera offers, and whether the driver will actually deliver a short run of frames on that node.

Illustration of a USB camera beside the KiwiPi 5 Pro board
A USB camera and a KiwiPi 5 Pro illustrate the command-line capture setup.

Find the camera device

Match the USB camera to its nodes

On a Debian or Ubuntu image, install v4l-utils, connect the camera, and run the listing. If the board already has a long list of video devices, run it once before connecting the camera and once after. You can use lsusb as a second check when nothing new shows up in the video list.

sudo apt install v4l-utils
lsusb
v4l2-ctl --list-devices

A name under lsusb means the USB bus sees the device. To get a usable video node, the camera also needs a driver that exposes a capture interface. A USB Video Class device usually uses the Linux uvcvideo driver. If it shows up on the bus and there’s no new V4L2 entry, start with the USB and kernel driver messages before trying different application settings.

KiwiPi 5 Pro board with USB ports along the edge
Connect the camera to a USB host port on the KiwiPi 5 Pro, then run the device listing again.

Read the per-node capabilities

One camera can show up with two or more /dev/video* entries. Check each candidate with --all and read Device Caps when that field is present. Capabilities can describe the device as a whole, so reading only that field can send you to the wrong node. A node that reports Metadata Capture gives you information that can accompany a video stream. For this check, pick an entry that reports Video Capture or Video Capture Multiplanar.

v4l2-ctl -d /dev/video2 --all
v4l2-ctl -d /dev/video3 --all
ls -l /dev/v4l/by-id/

Those two numbers are examples. If you’re putting the camera in a service, use a verified /dev/v4l/by-id/ symlink when your system provides one. Check which node the symlink points to, and use by-path if you want the configuration tied to a physical port and a suitable link exists. The plain video2 name can move when devices are plugged in or detected in a different order.

Diagram of a USB camera exposing an image capture node and a separate metadata node
One camera can expose separate image and metadata nodes. The numbers shown are examples.

Inspect the camera modes

Read formats, sizes and frame intervals together

Once you know the capture node, run --list-formats-ext on it. Read the size and frame interval under the format you actually plan to use. A camera can offer 1920 x 1080 at one rate with MJPEG and at a lower rate with uncompressed YUYV. MJPEG can cut the amount of data carried over USB, and the app then has to decode those frames before it can work with pixels.

v4l2-ctl -d /dev/video2 --list-formats-ext

If you need 30 frames per second, look for 30 fps under the selected format and size. Start with something the camera explicitly lists. After requesting a format, read it back because the driver can adjust the request. Differences in what happens after capture also matter. An NPU can run a model while the host still handles the incoming frames and the work needed to prepare them.

What Linux reports What to do next
Camera appears only in lsusb Look for probe messages and check driver support.
Node says Metadata Capture Inspect the other nodes from the same camera.
Mode is listed only under MJPG Request MJPG and account for decoding downstream.
Device or resource busy Check which application is using the node before you retry.

Capture a short stream

Check frame delivery without displaying it

This example asks for MJPG at 1280 x 720, then reads back the active format and dequeues 60 frames into /dev/null. Use a format and size from your list. The limit of 20 seconds keeps a stuck stream from holding the terminal indefinitely. This can confirm frame delivery to userspace, with no display server required. To check image quality, save and inspect an actual sample in a suitable viewer.

CAM=/dev/video2
timeout 20s v4l2-ctl -d "$CAM" \
  --set-fmt-video=width=1280,height=720,pixelformat=MJPG \
  --get-fmt-video --stream-mmap --stream-count=60 --stream-to=/dev/null

If you get Permission denied, inspect the device ownership and the identity that actually runs the service. A desktop session and a headless service can have different device access. If the camera has already delivered frames and drops out after sitting idle, check the USB power-management path separately. A clean capture also gives you a place to start when the next stage is hardware video encoding on RK3588.

KiwiPi 5B single-board computer with external connectors
Moving the camera to a KiwiPi 5B? List the devices on that board before reusing a /dev/video path from the 5 Pro.

FAQ

Why does one webcam have two video entries?

The driver can expose video frames on one interface and metadata on another. Some devices have multiple real capture interfaces. Read each node’s capabilities and enumerate formats on the one your app will open.

Does this work with a ribbon-cable CSI camera?

v4l2-ctl can inspect nodes that a CSI pipeline exposes. The sensor, receiver and image processor can need their own media graph configuration before you can stream from a capture node.

Does the 60-frame test prove my app can sustain 30 fps?

It checks delivery for a short run with no display, encoding or inference in the loop. Measure frame rate in the app with its actual format, resolution and workload.

Sources

ODM/OEM

Rockchip-Based ODM/OEM Solutions

In addition to our own KiwiPi single-board computer lineup, we also develop custom devices for clients based on Rockchip RK3588, RK3576, RK3566 and other Rockchip processors.

Rockchip RK3588 chip

Related Products

Kiwipi-5Pro

KiwiPi 5 Pro

KiwiPi 5 Pro is powered by Rockchip RK3588 8-core 64-bit processor with 4 Cortex-A76 (2.2GHz), 4 Cortex-A55(1.8GHz), and an independent NEON coprocessor.

Get in Touch about Your Needs

Contact Us