Onboard camera not working with OpenCV

I missed you are using a TX2… If you have the onboard module, it is ok and the pipeline runs fine from gst-launch.

I’m wondering if your opencv version has gstreamer support. What gives:

import cv2
print(cv2.getBuildInformation())

and check for GSTREAMER support in Video I/O section:

GStreamer:                   YES (1.14.5)

If not available, you would reconfigure a new opencv build enabling it with -D WITH_GSTREAMER=ON