# Open cv on tx2 won&rsquo;t work with onboard csi camera

**URL:** <https://forums.developer.nvidia.com/t/open-cv-on-tx2-won-rsquo-t-work-with-onboard-csi-camera/66126>\
**Category:** Jetson TX2\
**Created:** [October 12, 2018, 11:37pm UTC](https://forums.developer.nvidia.com/t/open-cv-on-tx2-won-rsquo-t-work-with-onboard-csi-camera/66126 "2018-10-12T23:37:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmit122](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jsmit122](https://forums.developer.nvidia.com/u/jsmit122)\
**Post date:** [October 12, 2018, 11:37pm UTC](https://forums.developer.nvidia.com/t/open-cv-on-tx2-won-rsquo-t-work-with-onboard-csi-camera/66126/1 "2018-10-12T23:37:30Z")

</div>

I have Ubuntu 16.04  
I built Opencv 3.3 with gstreamer support  
USB cameras works  
And I am able to open the csi camera successfully from terminal

But when I use this pipeline in my opencv program:

VideoCapture(  
nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink);

my program builds and when I run it from the build folder using ./my program  
I get no errors but, nothing happens and no camera open.  
Am I doing something wrong?  
Please help.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [October 13, 2018, 5:50pm UTC](https://forums.developer.nvidia.com/t/open-cv-on-tx2-won-rsquo-t-work-with-onboard-csi-camera/66126/2 "2018-10-13T17:50:46Z")

</div>

You may try this:

```auto
import cv2
print(cv2. __version__ )

cap = cv2.VideoCapture('nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)640, height=(int)480,format=(string)I420, framerate=(fraction)30/1 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink')

while(True):
	ret, frame = cap.read();
	cv2.imshow('MyFrame', frame)
	if cv2.waitKey(1) & 0xFF == ord('q'):
		break

```

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:30pm UTC](https://forums.developer.nvidia.com/t/open-cv-on-tx2-won-rsquo-t-work-with-onboard-csi-camera/66126/3 "2021-10-18T18:30:28Z")

</div>


