对接USB摄像头
开发者套件支持接入UVC协议的USB摄像头,本节介绍如何接入并测试USB摄像头。
- 将USB摄像头接入开发者套件任意一个空闲USB接口(USB 3.0 Type A)。
- 以root用户登录开发者套件,执行命令,可以通过回显看到通过USB接口接入的摄像头。
lsusb
回显如下:Bus 005 Device 003: ID 0bda:9143 Realtek Semiconductor Corp. USB Camera
- 开发者套件可自动检测USB摄像头接入并创建设备节点“/dev/video0”。用户可通过v4l2命令确认USB摄像头工作是否正常,执行以下命令。
sudo v4l2-ctl -d /dev/video0 --all
系统回显如下,包含摄像机帧率、分辨率等信息:
Driver Info: Driver name : uvcvideo Card type : USB Camera: USB Camera Bus info : usb-a5100000.usb_2-1 Driver version : 5.10.0 Capabilities : 0x84a00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Media Driver Info: Driver name : uvcvideo Model : USB Camera: USB Camera Serial : 200901010001 Bus info : usb-a5100000.usb_2-1 Media version : 5.10.0 Hardware revision: 0x00002021 (8225) Driver version : 5.10.0 Interface Info: ID : 0x03000002 Type : V4L Video Entity Info: ID : 0x00000001 (1) Name : USB Camera: USB Camera Function : V4L2 I/O Flags : default Pad 0x01000007 : 0: Sink Link 0x02000013: from remote pad 0x100000a of entity 'Realtek Extended Controls Unit' (Video Pixel Formatter): Data, Enabled, Immutable Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1280/720 Pixel Format : 'MJPG' (Motion-JPEG) Field : None Bytes per Line : 0 Size Image : 1843200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1280, Height 720 Default : Left 0, Top 0, Width 1280, Height 720 Pixel Aspect: 1/1 Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags: Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags: Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0