DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Camera Sample
SW Release Applicability: This sample is available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.


The Camera sample uses the dwSAL and dwSensorCamera interface to setup physical GMSL cameras or virtual cameras, and display their data on screen. The sample can also record videos in a processed or RAW format.

Setting Up The Cameras

For information regarding the physical location of the ports on NVIDIA DRIVE platforms, please refer to "Camera Setup and Configuration" in the NVIDIA DRIVE 5.1 Development Guide.

The camera parameters located in the rig file are described in section Creating and Using Camera

Running the Sample

To launch the sample by default without parameters, connect an AR0231 SF3324 camera to csi-port A, link 0 on your NVIDIA DRIVE platform.

The Camera sample, sample_camera, accepts the following parameters:

./sample_camera --rig=[path/to/rig/file]


    Specifies the rig file containing the camera descriptions.
    Default value: "{data dir}/samples/sensors/camera/camera/rig.json"
    Note: {data dir}/samples/sensors/camera/camera contains several
    example rigs for different configurations to experiment with.

    Specifies the output file, where h264, h265, mp4 and RAW formats are supported.
    If the RAW format is selected, ensure the master camera specified in the rig file
    has RAW output enabled. RAW recordings are then compatible for replay
    case (see RigReplay.json).
    If h264, h265 or mp4 formats are selected, ensure the master camera specified in the rig
    file has `processed` enabled.
    If --write-file is not provided, no file is written out on disk.
    Default value: none

The content of the rig reflects the description of protocol usage and parameter setup listed under the Sensor Camera guide. By default the rigs provided setup the camera.gmsl protocol, however the sample is designed to handle other camera protocols, such as camera.virtual protocol for replay of raw files. Although the rig by default lists only one camera, simply following the rules of rig construction, it's possible to add up to 16 instance of cameras, live or virtual.

When multiple cameras are used, only the camera with index 0 is recordable.

Additionally, it is possible to screenshot the current window by pressing S and saving each individual camera image as a full resolution .png image by pressing F.