Unable to capture 1080P @ 30FPS with Logitech C922 webcam using opencv and gstreamer

Hi, I’m using a Logitech C922 USB camera on a Nano 2G to measure rotation of a moving target. The Python capture string used by opencv is: gst = “v4l2src device=/dev/video0 ! image/jpeg,framerate=30/1,width=1920,height=1080 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink”

I’m acquiring the frames using : cam = cv.VideoCapture(gst, cv.CAP_GSTREAMER) and ret, frame = cam.read() . when I time a loop of 150 reads, the best I can get is 25ish FPS. Since I’m trying to measure angular speed, the FPS is important. Any ideas on how I can further speed up the capture rate? How can I tell if /when I’m dropping frames? jetson_clock shows I’m running at MAXN.

I also noticed I’m getting a ‘Throttling Due to Overcurrent’ message which would be a likely culprit but when I 'scope the voltage on the GPIO pins, the lowest it drops to is 4.989V. I’m using a 3A USB supply.
What is the best place to monitor power input on a Nano 2G?

The write time doesn’t significantly effect the total, so I’m just concentrating on the acquisition FPS. Thanks in advance for your comments.

Please execute sudo nvpmodel -m 0 and sudo jetson_clocks to get maximum performance. If it still does not achieve target frame rate, the performance may be capped by CPU capability. You can run sudo tegrastats to check system status.

Thanks for your quick reply. Yes, I’ve experimented with sudo nvpmodel -m 0* and *sudo jetson_clocks, but no improvement. If you don’t see a way to improve on the capture string, I expect you are right in that we are CPU bound. It looks like the AGX Xavier has the same CPU clock speed. Is it typical to have camera inputs limited in this way? Would
a non-USB camera be a better choice for fast 1080P? Is gstreamer the best option for capturing frames using Python?

For processing data in BGR format it fully relies on CPU cores. This caps the performance. Please check discussion and suggestion in the topic:
High CPU usage rate for pulling RTSP stream by VideoCapture with CAP_GSTREAMER - #12 by DaneLLL

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.