The usb webcam is very slowly in darknet

I use darknet and logitech HD Pro Webcam C920 webcam , but the video looks very slowly ,only 1.7 fps.

v4l2-ctl --info --list-devices
HD Pro Webcam C920 (usb-70090000.xusb-2.1):
	/dev/video0

Driver Info (not using libv4l2):
	Driver name   : uvcvideo
	Card type     : HD Pro Webcam C920
	Bus info      : usb-70090000.xusb-2.1
	Driver version: 4.9.140
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

I change a old logitech webcam c110 , the fps to 10.

v4l2-ctl --info --list-devices
Webcam C110 (usb-70090000.xusb-2.1):
	/dev/video0

Driver Info (not using libv4l2):
	Driver name   : uvcvideo
	Card type     : Webcam C110
	Bus info      : usb-70090000.xusb-2.1
	Driver version: 4.9.140
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

If I use video file , the fps is 49 , so this problem is about the webcam driver ?

Hi,

That’s because there are some CPU -> GPU memory copy between the interface.

AFAIK, darnet use OpenCV(GStramer pipeline) to enable camera.
The camera frame is read into a CPU buffer and be copied into a GPU memory for the inference.

To improved this, it’s recommended to try our DeepstreamSDK library.
We provide some optmized pipelien from camera -> inference without memcpy.
https://developer.nvidia.com/deepstream-sdk

We also have a YOLO sample in /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_Yolo.
Thanks.