use camera on jetson TX2

Does anyone know how to use the camera on the Jetson TX2? Can you guys please explain step by step how to make it work?

you need to explain more about what you are thinking of.
the Jetson TX2 DEV kit is comes with a camera, you can use it
I used a webcam with the python code with opencv
So it is possible

I want to use the camera that comes with the dev kit but im not sure how to go about it

Still unclear what is your use case, but I’ll try to summarize:

  • The onboard camera is a bayer sensor.

  • If you access it through v4l2 interface, you’ll get bayer format into CPU memory. Try:

v4l2-ctl -d /dev/video0 --list-formats
  • If you access it through gstreamer interface, then plugin nvcamerasrc can provide different formats (I420, NV12…) into NVMM memory. Try:
gst-inspect-1.0 nvcamerasrc

and see its src capabilities.
For example:

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

should show your camera capture in a window. Other plugins may convert into many other formats. Searching this forum you should find many examples.

  • You may also have a look to Tegra MultiMedia API and Argus, depending on what you intend to do with it.

Hello, sorry i am new to the jetson so im not sure how to make it clear. All im trying to do is get the camera working on the jetson dev kit because i want to see if i can set up an image detector sample running. I tried following your steps but i get the following:

$ 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
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to NULL ...
Freeing pipeline ...

Are you running this locally from the Jetson logged with Ubuntu GUI ? If yes, maybe you’re running L4T R28 (JetPack 3.1), I’ve seen users having some problems with onboard camera with it.

If no, and you are logged in with ssh, you may try ssh -Y, or set environment variable DISPLAY.

In case it’s just related to opengl, you may also try another videosink :

gst-launch-1.0 -ev nvcamerasrc ! nvvidconv ! ximagesink

or

gst-launch-1.0 -ev nvcamerasrc ! nvoverlaysink

Locally on a Jetson with a Ubuntu GUI.

INTERESTING:
I ran this script and it worked in chrome with the onboard camera:

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM),width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! tee ! v4l2sink device=/dev/video2

I ran this script and it did not work in chrome:

gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=NV12, framerate=30/1' ! tee ! v4l2sink device=/dev/video2

These work as well in Chromium:

gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=I420, framerate=30/1' ! tee ! v4l2sink device=/dev/video2
gst-launch-1.0 videotestsrc is-live=true ! 'video/x-raw, format=UYVY, framerate=30/1' ! tee ! v4l2sink device=/dev/video2

Are the (memory:NVMM) and “nvvidconv” components actually converting it back OUT of NV12?

::CONFIRMED:: When I run the following the v4l2-device info shows it being converted into a YUYV stream and NOT NV12.

gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM),width=640, height=480, framerate=30/1, format=NV12' ! nvvidconv flip-method=0 ! tee ! v4l2sink device=/dev/video2

It sounds like the answer is that Chromium/webrtc do not support NV12 natively.

nvcamerasrc has apparently been deprecated. It worked for me to use nvarguscamerasrc per this post: https://devtalk.nvidia.com/default/topic/1050043/cat-not-get-the-csi-camera-working-erroneous-pipeline-no-element-quot-nvcamerasrc-quot-/.

ex.

gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink