How to run Nvidia sample camera application to capture an image from GMSL Camera

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
2.1.0
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Issue Description
Hello,
Could you please let me know how to run Nvidia Driveworks 5.8 camera sample application on Nvidia SPC device.
I have tried below command, but its not working.
./sample_camera --rig /home/nvidia/spc-image-capture/ --write-file sample_video-mp4 --enable-user-event-callbacks 1 --reset-on-error 1 --dwTracePath /home/nvidia/spc-image-capture/trace.json

Error String
Sample illustrating how to use camera interfaces
–enable-user-event-callbacks: default=0
If this set to 1, then the user-defined error handling will be enabled

–offscreen: default=0
Used for running windowed apps in headless mode. 0 = show window, 1 = offscreen window, 2 = no window created
–profiling: default=1
Enables/disables sample profiling
–reset-on-error: default=0
If this flag set to 1, then the camera link will be reset when errors occur. This parameter only takes effect when --enable-user-event-callbacks=1
–rig: default=/home/nvidia/spc-image-capture/data/samples/sensors/camera/camera/rig.json
This is the main source of input configuration for the cameras, can setup any possible configuration
–write-file: default=
If this string is not empty, then the serializer will record in this location

terminate called after throwing an instance of ‘std::runtime_error’
what(): Unknown option --dwTracePath

Aborted (core dumped)

Logs
Sample illustrating how to use camera interfaces
–enable-user-event-callbacks: default=0
If this set to 1, then the user-defined error handling will be enabled

–offscreen: default=0
Used for running windowed apps in headless mode. 0 = show window, 1 = offscreen window, 2 = no window created
–profiling: default=1
Enables/disables sample profiling
–reset-on-error: default=0
If this flag set to 1, then the camera link will be reset when errors occur. This parameter only takes effect when --enable-user-event-callbacks=1
–rig: default=/home/nvidia/spc-image-capture/data/samples/sensors/camera/camera/rig.json
This is the main source of input configuration for the cameras, can setup any possible configuration
–write-file: default=
If this string is not empty, then the serializer will record in this location

terminate called after throwing an instance of ‘std::runtime_error’
what(): Unknown option --dwTracePath

Aborted (core dumped)

May I know what is SPC ? Are you using DRIVE AGX Orin Devkit?

I don’t see this in sample command line option.

okay, I will put my question in a different way.

We have a GMSL2 Camera, and also a SPC device which is provided by a Vendor called Pony. This device has Nvidia Drive os running. I am trying to run sample_camera application provided by Nvidia on this platform.
Could you please let me know what are the prerequisites to run this application.
I have used below command:
./sample_camera --rig /home/nvidia/spc-image-capture/ --write-file sample_video-mp4 --enable-user-event-callbacks 1 --reset-on-error 1 --dwTracePath /home/nvidia/spc-image-capture/trace.json

But this did not work.

Dear @a.ratnakaram,
What is the camera module? Please update the rig.json parameters and pass rig.json file path to --rig. The default rig file is at /use/local/driveworks/data/samples/sensors/camera/camera/rig.json for reference. Use write-file=sample.mp4 to record mp4 video.

How to find out the Camera module name, could you please share any command to check the Camera Module name?

Dear @a.ratnakaram ,
It should be written on the camera.

Please check the below error.
./sample_camera --rig=rig.json --write-file sample_video.mp4
ProgramArguments: Missing argument ‘dwTracePath’ requested
GLFW error: 65544, X11: The DISPLAY environment variable is missing
WindowGLFW: Failed to initialize GLFW
terminate called after throwing an instance of ‘std::exception’
what(): std::exception
Aborted (core dumped)

Do I need to connect any display?

Dear @a.ratnakaram,
Please use ./sample_camera --rig=/path/to/rig.json --write-file=record_video.mp4 --offscreen=1 if you dont want display and just checking recording. Please see DriveWorks SDK Reference: Camera Sample for command line parameter.
BTW ,any reason for using DRIVE OS 6.0.5?

If you are ok to test using VNC, Please check thread Driveworks 5.14 issue with DRIVE AGX Orin - #2 by SivaRamaKrishnaNV

I am using Drive OS 6.0.5 for developing autonomous driving applications.
One more question, I am using Nvidia Driveworks 5.8 apis to create a camera and capture images and store it in the file system. Is it the right approach? or do you suggest any alternative to capture images using C++ application.

Yes. You can use recorder tool as well. If you don’t have any dependency on DRIVE OS release, consider upgrading to latest release.

Please check my response here:

  • We cannot upgrade to latest DRIVE OS release(due to dependency on vendor)
  • What exactly recorder tool is about?
  • I am using Driveworks C++ Camera apis to capture images, I am able to compile my C++ application and run but it is crashing.Not sure what is the issue.
  • Do I need to provide rig.json file to run my C++ application? I prefer not to depend on rig.json file
  • How to generate rig.json file, as there are many parameters it is not possible to write it manually. Could you please let me know how to generate rig.json file?
  • I am still not able to run Nvidia Sample Camera application due to rig.json file issues. It would be really helpful if you could let me know how to generate this rig.json file.
  • Most important thing, is using Drivworks C++ api the right approach to capture or stream Camera data?

Please check the attached rig.json file and the sample_camera output. I see some error “/opt/nvidia/nvmedia/nit/SG8_AR0820.nito” not found. How to get this file. Please let me know.
camera-testing.zip (3.6 KB)

Hello Siva,
Any update on this topic.
Could you please let me know how to create a rig.json file. How to get sensor calibration parameters? is there any way to generate rig.json file?

Dear @a.ratnakaram

Please confirm if your used camera model is listed at DRIVE AGX Orin Sensors & Accessories | NVIDIA Developer. This helps to provide further guidance.

Recorder tool is provided in DW to help capturing sensor data.
If you don’t want to use rig file, you can update the needed camera parameters directly in sample_camera sample.
rig file needs to edited manually and can’t be generated automatically.

Yes we recommend to use DW APIs/recorder tool to capture camera data.

Please file new topic each new issue/query to avoid cluttering of topics.

Hello Siva,

We have been using Sensing World Camera, model no: SG8S-AR0820C-5300-G2A. But this Camera is not listed here: DRIVE AGX Orin Sensors & Accessories | NVIDIA Developer
This Camera is of AR0820 type. Could you please let me know this camera is supported? Do I need any specific driver to enable this Camera?

Dear @a.ratnakaram,
Yes you need camera drivers to enable camera on Orin Devkit.

Please use the cameras listed in

As we are closely tied with Sensing world vendor, we wont be able to use other cameras for now.
Could you please list down the files that are required to enable camera, so that I can ask the vendor.
And regarding .nito and resources.pak files, are these files mandatory to enable the Camera?

Interesting update:
I am able to capture images using below command:
nvsipl_camera -c SENSING_SG8_AR0820 -m “0x0010” --showfps --disableISP0Output --disableISP1Output --disableISP2Output --enableRawOutput --triggerLine 0 --triggerFreq 30

Could you please let me know how NVSIPL is different from DriveWorks api? If the Camera is working with NvSIPL means, should it work with Driveworks api as well right?
NvSIPL does not need rig.json file?

Dear @a.ratnakaram,
Could you share the list of supported platform configuration(Command Line Switches | NVIDIA Docs)?

@SivaRamaKrishnaNV Please find the attached file
supported-configurations.txt (20.5 KB)