reading from multiple cameras in Jetson TX2 using Opencv and Gstreamer

My setup consists of Nvidia Jetson TX2 +Auvidea J20 https://auvidea.eu/j20/+ 4 number of Raspberry Pi Cameras. I am able to read from all cameras one at a time using the following gstreamer pipeline in Opencv

cv2.VideoCapture("nvcamerasrc sensor-id=2 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")

I can read from each of the all cameras (one at a time) by changing the sensor-id, but when I try to read from a second camera by creating a second instance of the above code, with another sensor-id, it fails and crashes the nvcamera-deamon.

Can someone help me to get it working. Thanks!

Hi,
Please check if you can run multiple cameras in separate processes.
https://devtalk.nvidia.com/default/topic/1047340/jetson-tx2/2x-leopard-imaging-li-imx185-mipi-and-connecttech-spacely-/post/5316370/#5316370