GMSL camera(s) access by Python

Dear,

I’m trying to access GMSL camera(s) from python.

Even some related threads as follow:
https://devtalk.nvidia.com/default/topic/1030656/general/access-gmsl-video-stream-with-opencv/
https://devtalk.nvidia.com/default/topic/1005807/drive-hardware/use-gmsl-camera-with-python/
https://devtalk.nvidia.com/default/topic/1038922/driveworks/access-gmsl-camera-image-in-python/

I’m not sure the issue was cleared.

Does anyone have an idea to access GMSL camera(s) with Python?

Thanks,

Dear ddpx2,

Do you have any reason to use Python?
Because the souce codes for DriveWorks/NvMedia are all based on C++. Thanks.
BTW I hope this link helps for your topic. Thanks.
https://devtalk.nvidia.com/default/topic/1044512/general/opencv-unable-to-stop-the-stream-inappropriate-ioctl-for-device/?offset=2#5299842

Thanks Steve,

I’ll test it and update~

Steve,

I’ve installed OpenCV on DRIVE AGX Xavier Dev. system and tested with Python.
Then, how can I access GMSL camera here?

To capture frame at Python as follow;

import cv2

cap = cv2.VideoCapture(<b>0</b>)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()
...

Python requires the device index or video file name.
e.g /dev/video0, /dev/video1… or 0, 1 etc

And, when multiple GMSL cameras are installed, how can I pass mask info like selector_mask.

Thanks,