Can't start Jetson TX2 on board camera on Jetpack 4.2 R32.1

Hello developers,

I managed to install Jetpack 4.2 via SDK manager from a host machine to Jetson TX2. I also installed all other SDK components (Multimedia API, VisionWorks, etc). However, I am unable to access the onboard camera with the below comment (which works for Jetpack 3.3)

$ gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e
WARNING: erroneous pipeline: no element "nvcamerasrc"

Am I missing anything? eventually I want to access the camera through Python 3 OpenCV library. What would be the way to do this in Jetpack 4.2

Use plugin nvarguscamerasrc instead of nvcamerasrc.
Note that flip-method=2 is no longer needed since a few L4T releases.

Hey Honey_Patouceul,

yeap using nvarguscamerasrc work as expected. Thank you so much!

Hey Honey_patouceul,

Thank you again for telling me to nvarguscamerasrc.

I managed to install opencv 3.4.0 binding with Python 3.6.7. However, I am not able to access camera module from my python code. The code is similar as below

gst_str = ('nvarguscamerasrc ! '
               'video/x-raw(memory:NVMM), '
               'width=640, height=480, '
               'format=NV12, framerate=30/1 ! '
               'nvvidconv ! '
               'nvegltransform ! nveglglessink -e')
    cap = cv2.VideoCapture(gst_str)
    if cap.isOpened():
        windowName = "CannyDemo"
   #....

I ran into this error when I run the code

nvarguscamerasrc ! video/x-raw(memory:NVMM), width=640, height=480, format=NV12, framerate=30/1 ! nvvidconv ! nvegltransform ! nveglglessink -e
ver4
VIDEOIO ERROR: V4L: device nvarguscamerasrc ! video/x-raw(memory:NVMM), width=640, height=480, format=NV12, framerate=30/1 ! nvvidconv ! nvegltransform ! nveglglessink -e: Unable to query number of channels
OpenCV Error: Unspecified error (GStreamer: cannot find appsink in manual pipeline
) in cvCaptureFromCAM_GStreamer, file /home/stwjetsondev/gits/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp, line 805
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:

/home/stwjetsondev/gits/opencv-3.4.0/modules/videoio/src/cap_gstreamer.cpp:805: error: (-2) GStreamer: cannot find appsink in manual pipeline
 in function cvCaptureFromCAM_GStreamer

camera open fail

Any help would be greatly appreciated

The pipeline you’re trying to run has end sink being nveglglessink. This sink displays in a GL window.

For using a gstreamer pipeline in opencv as videoCapture, your pipeline must end with appsink (your opencv application).
Check this post for a python example.

In both state it gets me warning:

command:

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

respond:

WARNING: erroneous pipeline: no element "nvcamerasrc"

command:

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=2 ! nvegltransform ! nveglglessink -e

respond:

WARNING: erroneous pipeline: no element "nvarguscamerasrc"

Hi.

  1. It is necessary to compile opencv with gstreamer in order to run your code successfully?
  2. By running your code I ran into this error:
[ WARN:0] global ~/Downloads/opencv_installation/opencv/modules/videoio/src/cap_gstreamer.cpp (711) open OpenCV | GStreamer warning: Error opening bin: no element "nvcamerasrc"
[ WARN:0] global ~/Downloads/opencv_installation/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

Hi,
Please do ‘$ gst-inspect-1.0 nvarguscamerasrc’ to check if the plugin information is printed out. If not, you may clean the cache:

$ rm .cache/gstreamer-1.0/registry.aarch64.bin

Or re-flash the whole system through sdkmanger.

This command

gst-inspect-1.0 nvarguscamerasrc

worked for me.

Hi,
For working with OpenCV, the pipeline should be

nvarguscamerasrc ! video/x-raw(memory:NVMM), width=640, height=480,format=NV12, framerate=30/1 ! nvvidconv ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink

Hi!
I’m working on running yolo on Tx2 Dev kit. I have installed all of requirements for yolo, OpenCV, CUDA, Cudnn.
I’ve tested if the onboard camera’s working via gstreamer : gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink
It works properly.
Then, I tried to run yolo by your code ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights “nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink”
The result is “Video-stream stopped!”
How could i track the issue?
Thanks!

Hi saqibbajwa991,

Please help to open a new topic. Thanks