Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Camera board • Re: Capturing single frames from C++ app: internal pipeline of hq camera?

$
0
0
My issue with the continuous stream and picking the desired frames based on the timestamp in the FrameMetaData really is in the documentation (see https://libcamera.org/api-html/structli ... 52c314bc65) - what should I compare this timestamp to? I'd need a timestamp for the "change of scene" based on the same timeline that the FrameMetaData uses - without this information the timestamp is essentially useless, except for ordering or computing time differences. So that "unspecified time point" serving as a reference really demands a little more explanation... or at least some function/method where I can query this timeline independently for other events.
For comparable timing I have used FrameWallClock instead of SensorTimestamp from Request metadata:
Request::metadata().get(libcamera::controls::FrameWallClock)
and compared it to time in microseconds since epoch. And that delta seemed about right.

Code:

void on_request_complete(Request *request) {  uint64_t recv_timestamp =      std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch())          .count();  uint64_t wall_clock_us = 0;  const ControlList &meta = request->metadata();  if (auto opt = meta.get(libcamera::controls::FrameWallClock)) {    wall_clock_us = static_cast<uint64_t>(*opt);    auto delta = recv_timestamp - wall_clock_us; // <--------------- seems believable  }}

Statistics: Posted by xrd — Thu Feb 19, 2026 10:49 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles