Jetson Inference error when trying to use detectNet with a USB camera @dusty-nv

This error occurs only when trying to run detection on a live webcam using my custom function; this error does not occur when following the tutorials from GitHub. It seems that there is a ‘timeout occurred waiting for the next image buffer’. Then proceeds to show net.Detect(img) function wasn’t passed a valid CUDA image.

Camera used: Logitech C270
Jetson Nano, JetPack 4.6.1, Ubuntu 18.04

I have built the jetson-inference from the source without any errors.
Is the error due to GStreamer not getting frames from Webcam because of format issues?
I believe my webcam is using mjpeg codec. Camera works well using cheese and other applications.

Any help will be greatly appreciated.

UPDATE: I realized that the error is due to image from camera.Capture() is not a CUDA image.
How do I solve this? Why isn’t my camera capture not cuda image by default?

Hi @nithinpremkumar1999, please see this post on GitHub: