How do I get the starting timestamp of a pipeline?
Here is a part of my code starting the pipelines. I am trying to record and encode camera streams of two cameras at once and need the starting timestamp for recording/encoding for each of the cameras.
with contextlib.ExitStack() as stack:
deviceInfos = dai.Device.getAllAvailableDevices()
print("=== Found devices: ", deviceInfos)
queues: dict = {}
pipelines = []
# Create a pipeline and queues for each connected device
for deviceInfo in deviceInfos:
# Create pipeline context
pipeline = stack.enter_context(dai.Pipeline())
device = pipeline.getDefaultDevice()
device.setIrLaserDotProjectorIntensity(0) # Enhancement of depth perception
device.setIrFloodLightIntensity(0) # Enhancement of low light performance
mxId = get_device_info(device, deviceInfo)
# Create and start pipeline for each device
pipeline, output = self.createPipeline(pipeline, mxId)
pipeline.start()
camera_start[mxId] = datetime.now()
logging.info(f"Camera [{camera_start[mxId]}] started recording at: {datetime.now()}")
pipelines.append(pipeline)
I guess that there must be some things happening asynchronously in pipeline.start(), which is messing with the camera_start points.