How to get images from 2 cameras at the same time with OpenCV?

I am working on stereo vision. I have to capture the videos at the same time. I have Jetson Nano 2 cameras Carrier Board.

cap = cv2.VideoCapture(take(), cv2.CAP_GSTREAMER)
cap2 = cv2.VideoCapture(take(camera=1), cv2.CAP_GSTREAMER)
if cap.isOpened() and cap2.isOpened():
    cv2.namedWindow("Right Camera", cv2.WINDOW_AUTOSIZE)
    cv2.namedWindow("Left Camera", cv2.WINDOW_AUTOSIZE)
    while (cv2.getWindowProperty("Right Camera", 0) >= 0 
           and cv2.getWindowProperty("Left Camera", 0) >= 0):
        ret_val, imgR = cap.read()
        ret_val2, imgL = cap2.read()

I get the images in this way but when I move fast I see that there are differences between the images.

What is your suggestion ?

So, I don’t think you can in Python OpenCV. You would have to write a C module, and even if you did, syncing the cameras in software would be difficult, and perfect sync probably impossible. There are a few recent threads on the Xavier forum about this topic that might apply to your case. Your cameras may need external sync for your use case.