← 返回命令列表

Linux command

v4l2-compliance 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Test default video device

v4l2-compliance

Test specific device

v4l2-compliance -d [/dev/video0]

Run streaming tests

v4l2-compliance -s

Test all video formats

v4l2-compliance -f

Test color formats

v4l2-compliance -c

Verbose output

v4l2-compliance -v

Run all tests

v4l2-compliance -s -f -c

说明

v4l2-compliance tests Video4Linux2 drivers and devices for API compliance. It verifies nearly all V4L2 ioctls and checks that drivers correctly implement the specification. The tool tests video capture and output, VBI, radio, and software radio devices. It verifies required capabilities are present and optional features work correctly when advertised. Streaming tests validate buffer handling and format support. New V4L2 drivers must pass compliance tests before kernel inclusion. The tool saves device state before testing and restores it afterward, including on Ctrl-C interruption.

参数

-d, --device _device_
Video device to test (default: /dev/video0).
-s, --streaming
Run basic streaming tests.
-f, --stream-all-formats
Test all supported video formats.
-c, --stream-all-colors
Test all color formats.
-v, --verbose
Enable verbose output.
-w, --wrapper
Use libv4l2 wrapper.
-T, --trace
Trace ioctl calls.
-n, --no-warnings
Suppress warnings.
--help
Display help.

FAQ

What is the v4l2-compliance command used for?

v4l2-compliance tests Video4Linux2 drivers and devices for API compliance. It verifies nearly all V4L2 ioctls and checks that drivers correctly implement the specification. The tool tests video capture and output, VBI, radio, and software radio devices. It verifies required capabilities are present and optional features work correctly when advertised. Streaming tests validate buffer handling and format support. New V4L2 drivers must pass compliance tests before kernel inclusion. The tool saves device state before testing and restores it afterward, including on Ctrl-C interruption.

How do I run a basic v4l2-compliance example?

Run `v4l2-compliance` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --device _device_ do in v4l2-compliance?

Video device to test (default: /dev/video0).