TX2 camera - unable to access using c++ and opencv

Greetings,

So i am trying to run the example code for displaying gstreamer video from the CSI port of the Nvidia Jetson in OpenCV.
Created by Peter Moran on 7/29/17.

The code is as follows

int WIDTH = 1920;
int HEIGHT = 1080;
int FPS = 30;

pipeline = “nvcamerasct-1.0! 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 ! video/x-raw, format=(string)BGR ! appsink”;

cv::VideoCapture cap(pipeline, cv::CAP_GSTREAMER);

rest of the code.

the output i am getting is

GStreamer: Error opening bin: could not parse caps “video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1”
Connection failed

Can someone help with the same?

Is wrong…It may be a wrong copy/paste, but it should be nvcamerasrc if you’re running a L4T version up to R28.2.1.
For latter L4T versions, use nvarguscamerasrc instead and better with NV12 instead of I420.