Hi @jkchen46033 ,
DepthAI gives you two timestamps:
Full details are in the docs (Device → Clock):
https://docs.luxonis.com/software/depthai-components/device#Device-Clock
Below is a v2‑compatible Python script.
import depthai as dai
import time
from datetime import datetime
# Calculate the offset
offset = time.time() - dai.Clock.now().total_seconds()
# Set up pipeline and device
pipeline = dai.Pipeline()
cam = pipeline.create(dai.node.ColorCamera)
xout = pipeline.create(dai.node.XLinkOut)
xout.setStreamName("video")
cam.video.link(xout.input)
with dai.Device(pipeline) as device:
q = device.getOutputQueue(name="video", maxSize=4, blocking=False)
while True:
frame = q.get()
# Get the timestamp (in seconds) from the host's monotonic clock
ts_monotonic = frame.getTimestamp().total_seconds()
# Convert to epoch time
ts_epoch = ts_monotonic + offset
# Optional: Convert to human-readable format
dt = datetime.fromtimestamp(ts_epoch)
print(f"Frame captured at epoch time: {ts_epoch} ({dt})")