Clara Holoscan v0.1.0
1.0

Camera Setup and Verification

This page outlines how to verify the camera setup used with the Clara Holoscan target and x86 host devices to ensure they are functioning properly for use with the sample applications.

  1. Connect a CSI or USB camera module to your Clara AGX Developer Kit or Jetson AGX module. Once connected, you may see what device(s) you have by the following:

    Copy
    Copied!
                

    $ ls /dev/video*

    The format(s) of your device(s) may be seen by:

    Copy
    Copied!
                

    $ v4l2-ctl -d /dev/video0 --list-formats

    If the above command fails (which may occur if the DeepStream example was not installed), then run:

    Copy
    Copied!
                

    $ sudo apt install -y v4l-utils

    Please see the Prerequisites section for the list of compatible camera devices.

    Note

    The CSI camera module, including the CSI HDMI input board included with the Clara AGX Developer Kit, will enumerate as /dev/video0 and any additional USB cameras will start to enumerate with /dev/video1. If there is no CSI module attached, USB cameras will start to enumerate with /dev/video0.

  2. Run one of the following commands to prove that capture is working correctly. In all cases, a window should be rendered onto the display with a live stream from the capture.

    • CSI Camera

      Copy
      Copied!
                  

      $ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvoverlaysink -e

      Note

      nvarguscamerasrc plugin is not available in dGPU mode on Clara AGX Developer Kit.

    • CSI HDMI Input Board

      Copy
      Copied!
                  

      $ gst-launch-1.0 v4l2src io-mode=mmap device=/dev/video0 ! 'video/x-raw, format=(string)BGRA, width=(int)1920, height=(int)1080, framerate=(fraction)60/1' ! capssetter join=true caps='video/x-raw, format=(string)RGBA' ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=(string)RGBA' ! nveglglessink sync=0

    • USB Camera

      Copy
      Copied!
                  

      $ gst-launch-1.0 v4l2src device=/dev/video1 ! xvimagesink

    Note

    Replace /dev/video0 in the commands above with the path that corresponds to the device being tested. See note about device enumeration in step 1, above.

  3. Press Ctrl+C to exit the camera capture.

  1. Connect a USB camera to your Linux x86 host.

  2. Run the following command to prove that capture is working correctly. A window should be rendered onto the display with a live stream from the camera.

    Copy
    Copied!
                

    $ gst-launch-1.0 v4l2src device=/dev/video1 ! xvimagesink

    Note

    Replace /dev/video1 in the command above with the path that corresponds to the USB camera device being tested.

  3. Press Ctrl+C to exit the camera capture.

The DeepStream sample application offers the ability to stream the camera image from the target device to a remote host system using a UDP data stream. These steps can be followed to ensure that both the target and host systems are setup correctly for this streaming to work.

AGX Target

  1. Ensure the camera capture is working as described in the AGX Camera Setup section, above.

  2. Run the following command to start streaming the camera capture, replacing <IP_ADDRESS> with the IP address of the host system that will be receiving the stream.

    • CSI Camera

      Copy
      Copied!
                  

      $ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! \ omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! \ h264parse ! rtph264pay mtu=1400 ! udpsink host=<IP_ADDRESS> port=5000 sync=false async=false

    • CSI HDMI Input Board

      Copy
      Copied!
                  

      $ gst-launch-1.0 v4l2src io-mode=mmap device=/dev/video0 ! 'video/x-raw, format=(string)BGRA, width=(int)1920, height=(int)1080, framerate=(fraction)60/1' ! capssetter join=true caps='video/x-raw, format=(string)RGBA' ! nvvideoconvert ! 'video/x-raw(memory:NVMM) , format=(string)I420' ! nvv4l2h264enc ! h264parse ! rtph264pay ! udpsink host=<IP_ADDR> port=5000

    • USB Camera

      Copy
      Copied!
                  

      $ gst-launch-1.0 v4l2src device=/dev/video0 ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvv4l2h264enc ! h264parse ! rtph264pay ! udpsink host=<IP_ADDR> port=5000

    Note

    Replace /dev/video0 in the commands above with the path that corresponds to the device being tested. See note about device enumeration in step 1 of the AGX Camera Setup, above.

Linux Host

Use the following command to start streaming the camera capture on a Linux x86 host (close with Ctrl+C):

Copy
Copied!
            

$ gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264, payload=96 ! rtph264depay ! queue ! avdec_h264 ! autovideosink sync=false

© Copyright 2021, NVIDIA Corporation. Last updated on Jun 28, 2023.