Trying to run the embedded code example from Matlab on the Jetson TX2


I am trying to run the example from this link:

On my TX2 board. When I finally do go to run it I get these errors:

nvidia@tegra-ubuntu:~/Desktop/codegen/lib/alexnet_predict$ ./alexnet_exe /dev/video1
VIDEOIO ERROR: libv4l unable convert to requested pixfmt
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT

OpenCV(3.4.1-dev) Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/nvidia/opencv/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

OpenCV(3.4.1-dev) /home/nvidia/opencv/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer

Could not open the video capture device.

I have not been able to find anything helpful with troubleshooting this problem. I was wondering if anyone else has run into this issue?

It sounds like their GStreamer pipeline is misconfigured for the camera. Are you using JetPack 3.2? Have you contacted Mathworks support about it?

Yes I am using JetPack 3.2, and I installed opencv as per the instructions I found on another thread to have GStreamer on and configured.

The thread is here:

Do you have a USB camera with /dev/video1 appearing a few seconds after you plug it in ?

Yes, I am using the logitech C920 webcam.

Also, I tried running this command as per the Mathworks tutorial and this is the error I got with it:

nvidia@tegra-ubuntu:~/Desktop/codegen/lib/alexnet_predict$ ./alexnet_exe 1

CUDNN_STATUS_BAD_PARAM, line: 168, file:


There are different error shared in comment #1 and comment #5.
Have you fixed the openCV error already?

For the CUDNN_STATUS_BAD_PARAM, it is usually casued by incompatible driver and libraries.

Suppose you are following this tutorial from mathworks:

It is set up with cuDNN 5.0 and the nearest JetPack version should be 3.0 which includes cuDNN 5.1: