Two USB cameras, stuck at cv2.VideoCapture().read()

My original post was here: https://devtalk.nvidia.com/default/topic/1055150/jetson-tx2/program-freezes-on-tx2/post/5349960/#5349960. After I found out what is exactly wrong, I thought it will be better to open a new post.

I currently have two USB cameras connected to my TX2, one through USB 3.0 Type A port and the other through USB 2.0 Micro AB port. I have two python scripts, each script access a different camera through cv2.VideoCapture().read(), and use the input frames to do some computer vision tasks. However, after both script running for around 10 minutes simultaneously, both scripts get stuck at cv2.VideoCapture().read(). So no camera outputs and no error messages, the scripts looks frozen.

I tried to run both scripts separately, this problem doesn’t occur. If I run a single script twice (run simultaneously), this problem will also occur. I run the exact same codes on my Ubuntu desktop, it will run without any problem.

My TX2 environment is Jetpack 4.2 (Ubuntu 18.04.2 LTS), opencv 3.4.6 (built from source), python 3.6.7.

I’ve searched for TX2 usb cam videocapture but couldn’t found any related info.

Please help! Thanks!

Hi,
For multiple USB cameras, we suggest use PCIe-USB hub like:
https://devtalk.nvidia.com/default/topic/1027100/jetson-tx2/stream-4-cameras-with-gstreamer/post/5224016/#5224016

Not to use Micro AB port.

Hi DaneLLL,

Looks like it is the problem with the Micro AB port. I don’t have a PCIe-USB hub, so I use a USB hub to connect both cameras to USB A port instead and it works without freezing.

Thanks!