Hello, I am getting the timestamps from my frames using the argus api like so :
(getTscOffsetNs() reads and return the value from /sys/devices/system/clocksource/clocksource0/offset_ns)
// Get frame meta.
IArgusCaptureMetadata *iArgusCaptureMetadata =
interface_cast<IArgusCaptureMetadata>(frame);
CaptureMetadata *metadata = iArgusCaptureMetadata->getMetadata();
const Ext::ISensorTimestampTsc *iSensorTimestampTsc =
interface_cast<const Ext::ISensorTimestampTsc>(metadata);
// Get frame SOF timestamp.
uint64_t frame_sof_timestamp = iSensorTimestampTsc->getSensorSofTimestampTsc();
// Substract offset between system monotonic clock and VI HW timestamp system counter.
uint64_t sensor_timestamp_ns = frame_sof_timestamp - getTscOffsetNs();
// Get timestamp from monotonic clock.
timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
uint64_t monotonic_raw_ns = t.tv_sec * 1e9l + t.tv_nsec;
// Compute frame age.
uint64_t captured_ago_ns = monotonic_raw_ns - sensor_timestamp_ns;
GST_DEBUG("Frame age: %20f ms\n", captured_ago_ns * 1e-6);
The code above will log the age of the frame in ms. Typically the log looks like this (~39 ms):