Hello Everyone,
I am trying to access onBoard camera and a USB camera simultaniously on Tx2. When I try capture video with single camera it works fine, but when I try to access both only the USB camera works. I am using a USB adapter on tx2 as it has one USB port. Kindly suggest me the right way where I should look. Thanks
import cv2
#For on board camera
cap1=cv2.VideoCapture("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int) + std::to_string(width) + "
"height=(int) + std::to_string(height) + , format=(string)I420, framerate=(fraction)"
"+ std::to_string(fps) +/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert "
#For usb camera
cap2=cv2.VideoCapture('/dev/video1')
print(cap1.isOpened(), cap2.isOpened)
while(True):
ret1,frame1=cap1.read()
ret2,frame2=cap2.read()
gray1=cv2.cvtColor(frame1,cv2.COLOR_BGR2GRAY)
gray2=cv2.cvtColor(frame2,cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',frame1)
cv2.imshow('frame',frame2)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap1.release()
cap2.release()
cv2.destroyAllWindows()