I am using an IMX219 stereo camera connected to the CAM0 and CAM1 ports. I am using GStreamer and OpenCV to display the video feeds side-by-side. Whichever camera is connected to CAM0 lags noticeably behind CAM1. Any suggestions for how to sync the video feeds?
I have tried switching which cameras are plugged into which ports and switching the displays of the video feeds, but no luck. I am running Jetpack 6.0-b52 from the SDKManager, using a WaveShare IMX219 Binocular Camera Module and GStreamer 1.20.3.
Here is the code:
gst0 = "nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=15/1 ! nvvidconv ! appsink -v"
gst1 = "nvarguscamerasrc sensor-id=1 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=15/1 ! nvvidconv ! appsink -v"
cam0 = cv.VideoCapture(gst0, cv.CAP_GSTREAMER)
cam1 = cv.VideoCapture(gst1, cv.CAP_GSTREAMER)
while True:
grab0 = cam0.grab()
grab1 = cam1.grab()
ret0, frame0 = cam0.retrieve()
ret1, frame1 = cam1.retrieve()
imOut = np.hstack((frame0, frame1))
cv.imshow(f"FPS{fps}, cam0 vs. cam1", imOut)
key = cv.waitKey(1)
if key == ord('q'):
break
cv.destroyAllWindows()
cam0.release()
cam1.release()
Thank you in advance!