Running the onBoard camera of the Jetson TX2

Hello everyone,
i’m working on the jetson TX2 where i’m trying to implement Yolo using the onBoard camera to test what is detects. the problem is that i don’t know which command should i type in order to tell the camera to displays a live video.(regardless of linking the camera to to work with Yolo).

I’ve looked this up and came to the result which i have to downlaod G-streamer G-streamer, which i don’t know how.

Would be thankful for your help.

thanks in advance
Khaled

Hi,

The component name should be nvarguscamerasrc.
Please check this document form more informaiton.

Thanks.

Thank you very much it works. I just have one more question. Do you an easy method that enables me to record a video using this on Board camera? . I’ve posted an independent topic regarding this because I’ve tried a lot of python scripts but unfortunately no work. All the scripts I tried return the following error :

Called with args:
Namespace(fps=30, image_height=480, image_width=640, rec_sec=5, rtsp_latency=200, rtsp_uri=None, text=‘TX2 DEMO’, ts_file=‘output’, use_rtsp=False, use_usb=False, video_dev=1)
OpenCV version: 4.1.2-dev
[ WARN:0] global /home/khaled/opencv/modules/videoio/src/cap_gstreamer.cpp (713) open OpenCV | GStreamer warning: Error opening bin: could not link nvarguscamerasrc0 to nvvconv0, nvarguscamerasrc0 can’t handle caps video/x-raw(memory:NVMM), width=(int)2592, height=(int)1458, format=(string)I420, framerate=(fraction)30/1
[ WARN:0] global /home/khaled/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Failed to open camera!

another script returned the following error:
python3 cam_capture.py
[ WARN:0] global /home/khaled/opencv/modules/videoio/src/cap_gstreamer.cpp (1759) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/khaled/opencv/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/khaled/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
select timeout
VIDIOC_DQBUF: Resource temporarily unavailable
Traceback (most recent call last):
File “cam_capture.py”, line 57, in
cv2.imshow(‘frame’,frame)
cv2.error: OpenCV(4.1.2-dev) /home/khaled/opencv/modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’

Thanks in advance

Hi,

You can record a video with GStreamer directly.
Please check the command here:
https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf?4UD7FAp6yQsnd31HjIgb4omN7EvHP9JjijdD9IS7AIsxt-K7c5kggLvor8Tfhi3jAh9c3neelU543tAnzgS5XvNv0H0n106glUvsoFOLbMvMSTl43NWZXD-pzQXldFkUP5h-XHQG3A9OqSkHCIM_IIUgJ3xtgukuAxGI-1QcMc_vNtk_mOY

Thanks.

Thank you very much for your help. It actually works except that i didn’t find the command in the Documentation above that enables me to capture an Image.

I would be grateful to hear some suggestions

Thanks in Advance

I found a way to capture an image :

nvgstcapture-1.0 -m 1

where: 1 stands for the video snap which practically means image. But the problem is that a video snap(image) is being taken from a video that has a resolution of 640480, where the CSI onboard_camera offers 19201080.

So I’m trying to capture an image using full resolution of the On_board CSI camera.

the following command makes it possible to capture a video with 1920*1080 :

gst-launch-1.0 nvarguscamerasrc maxperf=1 ! \   'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \   format=(string)NV12, framerate=(fraction)30/1' ! nvv4l2h265enc \   control-rate=1 bitrate=8000000 ! 'video/x-h265, \   stream-format=(string)byte-stream' ! h265parse ! qtmux ! filesink \   location=test.mp4 -e

but I couldn’t find a similar command for taking picture with 1920*1080 resolution.

So is there a way to capture image with 1920*1080 resolution using the on_board camera ?

thanks in Advance

1 Like

Hi,

Sorry for the late reply.

You can try this command:

$ gst-launch-1.0 nvarguscamerasrc num-buffers=1 !  "video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1" ! nvjpegenc ! filesink location=output0.jpg

Thanks.

thanks for helps. It works