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.