**I would like to rephrase my problem statement . **
I have the following camera part no. IMX490-GMSL2 which is connected to Jetson AGX Orin through CSI interface provided on the board. When i give the command “v4l2-ctl --list-devices”, i get the following output :
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
/dev/media0
vi-output, imx490 30-001a (platform:tegra-capture-vi:0):
/dev/video0
vi-output, imx490 31-001a (platform:tegra-capture-vi:2):
/dev/video1
vi-output, imx490 32-001a (platform:tegra-capture-vi:4):
/dev/video2
vi-output, imx490 33-001a (platform:tegra-capture-vi:5):
/dev/video3
Now, I have worked with USB cameras and python OpenCV and as per my prior experience, to access camera feeds I have been using the following piece of code :
import cv2
video_capture_0 = cv2.VideoCapture(0) #4 is the index no. of the camera which i intend to take feed from
while True:
ret0, frame0 = video_capture_0.read()
if (ret0):
cv2.imshow('Cam 0', frame0)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
video_capture_0.release()
cv2.destroyAllWindows()
But if I use the index no.of the GMSL cameras connected through CSI, i get a error :
Error message : global /io/opencv/modules/videoio/src/cap_v4l.cpp (902) open VIDEOIO(V4L2:/dev/video0): can’t open camera by index
I would like to know if there is anything wrong here. Request @SimonZhu and @kayccc @ShaneCCC to also help as we are completely stuck here.