I’m using a Jetson Xavier NX running JetPack 4.6.4, OpenCV 4.8.0 and a USB camera.
I’m having a recurring issue with a custom jetson_inference script which will occasionally exit with one of these two errors:
gstCamera::Capture() -- an error occurred retrieving the next image buffer
gstCamera::Capture() -- a timeout occurred waiting for the next image buffer
The time between the errors is not uniform and ranges between 10 and 120 minutes.
After reading through gstCamera.cpp I’ve found that both of these errors are caused by const int result = mBufferManager->Dequeue(output, format, timeout, stream); returning either less than or equal to zero.
Is the best course of action to increase the timeout buffer or modify the capture function to ‘skip’ a dropped image?
(including many different variations in width, height, framerate and raw format)
and the camera wasn’t able to open at all.
Running v4l2-ctl --list-devices returns /dev/video0 but even cheese can’t detect the camera.
In my jetson_inference script I can successfully open the camera with this constructor:
camera = videoSource("/dev/video0", options={'width': 1920, 'height': 1080, 'framerate': 30})
Hi @ben276, in the event of spurious connection issues, you can implement higher-level logic that detects if there are N timeouts, then destroy & recreate the videoSource device, and it should reconnect to the camera.
If you implement higher-level logic to close and reopen a videoSource device on a machine with multiple cameras, you will need to write custom udev rules so the respective functions can distinguish between different devices, as the Linux kernel will reassign device nodes based on the disconnection order.