Libargus: what's the difference between `getSensorExposureTime` and `getSensorTimestamp`

I’m trying to sync a flash to the sensor’s exposure time. To do this I have a separate thread managing to fire the flash at a scheduled time, a modified camera source, and a pad probe callback to get libArgus metadata and schedule the flash for the next available buffer.

What I need for scheduling from the camera is three things basically: the exposure timestamp, interval (frame rate) and exposure duration. I am using getSensorTimestamp to get the timestamp and the interval i get from GStreamer itself (framerate as ns). Flash warmup time is accounted for separately.

Issue now is that getSensorExposureTime returns the exact same result as getSensorTimestamp. The documentation for the former says

Returns the sensor exposure time for this capture (in nanoseconds).

Docs for getSensorTimestamp say:

Returns the kernel (SOF) timestamp for the sensor (in nanoseconds).
This is the time that the first data from this capture arrives from the sensor.

That sounds to me like the former is duration and the latter is a timestamp, yet both return the exact same result: time as ns. (15142184925000)

Log is:

...
0:00:03.947032240 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:44:metadata_probe:e[00m got metadata from buffer (6)
0:00:03.947071824 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:49:metadata_probe:e[00m Sensor timestamp:15142184925000
0:00:03.947086616 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:54:metadata_probe:e[00m Now Monotonic NS:15142212296000
0:00:03.947105783 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:56:metadata_probe:e[00m Sensor to probe latency:27.3710 ms
0:00:03.947119168 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:70:metadata_probe:e[00m Sensor exposure time:15142184925000
0:00:03.947147710 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:88:metadata_probe:e[00m Bayer Gains: r:3.090,gEven:1.000,gOdd:1.000,b:1.501
0:00:03.947171982 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:93:metadata_probe:e[00m Sharpness score:4.338
0:00:03.947186096 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:100:metadata_probe:e[00m Scene Lux: 9.765
0:00:03.948840651 e[336m31403e[00m   0x55b9737140 e[36mINFO   e[00m e[00m       test_metadata test_metadata.cpp:105:metadata_probe:e[00m Sharpness values length:4096
...

Code to repro and build instructions are at the first link. ninja test or meson test will run the tests. meson test --verbose will print test stdout to console as well as log to file (default is just to log to file).

Hoping there’s a way I can get sensor exposure duration. Otherwise I’ll just expose for an entire frame, but in my client’s use case, that’s less than ideal.

As you show the timestamp is the system time if SOF, and sensor exposure time is the exposure configure that been set to the sensor REG.

Not sure I follow. SOF? REG? I have the timestamp I need. Now I just need the exposure time delta in nanoseconds. The amount of time the sensor is capturing for. The shutter speed. Is this available anywhere?

Sorry I don’t understand your request.

I will try rephrasing in a few different ways. Question 1:

  • Is the shutter speed available on the metadata, or a anywhere in libArgus? Not the frame rate, since the shutter speed can be faster.

  • Can I get the amount of time it takes for the sensor to read from it’s first row to the last?

Question 2:

  • What is SOF?
  • What is REG?

I have never heard that terms anywhere and they don’t show up in Google. If this is Nvidia specific terminology, please provide a glossary or something. “Shutter speed” is used everywhere in photography. I don’t understand why “exposureTime” isn’t that. And why it returns the same result as “sensorTimestamp”. If that’s not a bug, how does that make any sense?

  1. If you mean the shutter speed is different to exposure time then there’s no this information.
  2. No

SOF → Start Of Frame
REG → Register of the sensor

Thanks. Most of the time the exposure will be the same as the frame rate (360 degree shutter). I’ll ensure that’s always the case by modifying the camera source to remove any exposure control. Was hoping the exposure duration was on the metadata, but I guess that’s not the case.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.