I would like to get the date and time of a frame grabbed by the camera using Argus library.
I use EGLStream::IFrame::getTime() method.
The method should returns the time in nano seconds but I have seen in your file EventThread.cpp following comment:
/// @todo IEvent documentation says the time value is in nano seconds, but /// actually it's in micro seconds. const TimeValue latency = TimeValue::fromUSec(iEvent->getTime()) ...
So, I tried both (nanoseconds and micro seconds) and I can’t get right time from any of one.
Here is a piece of code and the output generated (I use Poco c++ for date manipulation). And to compare with linux time I complete the test with gettimeofday call :
timeStamp_us = iFrame->getTime();
LOG_NOTICE_F("timeStamp_us = %ld", timeStamp_us);
LOG_NOTICE_F("timeStamp = %s", Poco::DateTimeFormatter::format(Poco::Timestamp(frame->meta().timeStamp_us), "%Y-%m-%dT%H:%M:%S.%iZ"));
struct timeval val;
gettimeofday(&val, NULL);
long int total = val.tv_sec * 1'000'000 + val.tv_usec;
LOG_NOTICE_F("timeval : %ld, %ld, total : %ld : %s", val.tv_usec, val.tv_sec, total, Poco::DateTimeFormatter::format(Poco::Timestamp(total), "%Y-%m-%dT%H:%M:%S.%iZ"))
Here is the output:
timeStamp_us = 15799841851000
timeStamp = 1970-07-02T20:50:41.851Z
timeval : 735292, 1608060963, total : 1608060963735292 : 2020-12-15T19:36:03.735Z
My linux card is not up to date and is still configured to the 2020/12/15 but not matters.
The provided timestamp by nvidia interface is 14 digits (15’799’841’851’000).
The unix timestamp by the system is 10 digits (1’608’035’111).
I don’t understand how to get unix timestamp with getTime() function.