USB Camera

Operating Environment:

  • Newman USB Camera camera-NM13-4K

  • LPA3588

  • Ubuntu20.04

Finding the USB Camera Filename

After inserting the USB camera, the kernel logs are as follows:

neardi@LPA3588:~$ dmesg
[ 2740.549384] usb 7-1.2: new high-speed USB device number 6 using xhci-hcd
[ 2740.705306] usb 7-1.2: New USB device found, idVendor=1bcf, idProduct=0215, bcdDevice=34.07
[ 2740.705328] usb 7-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2740.705341] usb 7-1.2: Product: 4K AutoFocus Webcam
[ 2740.705353] usb 7-1.2: Manufacturer: 4K AutoFocus Webcam
[ 2740.775878] uvcvideo: Found UVC 1.00 device 4K AutoFocus Webcam (1bcf:0215)
[ 2741.037436] usb 7-1.2: Warning! Unlikely big volume range (=4096), cval->res is probably wrong.
[ 2741.037459] usb 7-1.2: [7] FU [Mic Capture Volume] ch = 1, val = 0/4096/1

You can also use the lsusb command to list all USB devices:

neardi@LPA3588:~$ lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 003: ID 0bda:9210 Realtek Semiconductor Corp. Ugreen Storage Device
Bus 008 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.2 Hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 005: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 007 Device 006: ID 1bcf:0215 Sunplus Innovation Technology Inc. 4K AutoFocus Webcam
Bus 007 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

The device with ID 1bcf:0215 is the 4K Newman USB camera.

Use the v4l2-ctl command to list all video devices:

neardi@LPA3588:~$ v4l2-ctl --list-devices
......
4K AutoFocus Webcam: 4K AutoFoc (usb-xhci-hcd.6.auto-1.2):
	/dev/video23
	/dev/video24
	/dev/media2

This indicates that the device files for the USB camera with ID 1bcf:0215 are /dev/video23 and /dev/video24.

Opening the Camera

To see the formats, resolutions, and frame rates supported by the camera:

neardi@LPA3588:~/samba$ v4l2-ctl -d /dev/video23 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
	......
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 1920x1080
			Interval: Discrete 0.200s (5.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.000 fps)
		Size: Discrete 1600x900
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 640x360
			Interval: Discrete 0.033s (30.000 fps)
	.....

Using V4l2 Tools

neardi@LPA3588:~$ sudo apt update
neardi@LPA3588:~$ sudo apt install qv4l2
neardi@LPA3588:~$ qv4l2 -d /dev/video23

Using ffplay

neardi@LPA3588:~$ ffplay /dev/video23