depthai-core icon indicating copy to clipboard operation
depthai-core copied to clipboard

Is any example or api for get multi node frames synchronously?

Open dongxuanlb opened this issue 2 years ago • 5 comments

Now the API for get single MonoNode or ColorNode is using callback,but how to get three frame synchronously?

the realsense api is using frameset struct,it’s easy to synchronize access to all frames 。

now, I can only use three callback and a blocking queue to synchronize manually,while I found they often cannot be strictly synchronized within a cycle(mono and rgb all in 30fps)。

dongxuanlb avatar Feb 23 '22 07:02 dongxuanlb

Hi @dongxuanlb As of right now, we don't yet have any good synchronization mechanisms out of the box. You'd have to combine the frames using timestamp or sequence numbers by yourself.

We are in the progress of adding such functionality, so doing so will be much easier and abstracted away.

There is an example with combining NN results and ColorCamera frames over at examples/MobileNet/camera_mobilenet_sync_example.cpp which might come handy

themarpe avatar Feb 23 '22 09:02 themarpe

Hi @dongxuanlb As of right now, we don't yet have any good synchronization mechanisms out of the box. You'd have to combine the frames using timestamp or sequence numbers by yourself.

We are in the progress of adding such functionality, so doing so will be much easier and abstracted away.

There is an example with combining NN results and ColorCamera frames over at examples/MobileNet/camera_mobilenet_sync_example.cpp which might come handy

Thanks.

And I found that if two 720p monocular + one channel of 1080p NV12 are configed at the same time, the bandwidth seems to be insufficient and rgb will be lost. when the rgb down to 720p,will be no lost basically 。

dongxuanlb avatar Feb 23 '22 11:02 dongxuanlb

And I found that if two 720p monocular + one channel of 1080p NV12 are configed at the same time, the bandwidth seems to be insufficient and rgb will be lost. when the rgb down to 720p,will be no lost basically 。

What device do you use and at what speeds? PoE (100Mbit / 1Gbit) or USB (USB2 / USB3)? The 1080p NV12 at 30FPS already consumes ~90MB/s which is too much for USB2 or 100Mbit speeds. Make sure you are running at adequate speeds for either device model.

themarpe avatar Feb 23 '22 13:02 themarpe

I'm using oakd and the usbspeed is 3.0 (Super).

dongxuanlb avatar Feb 24 '22 01:02 dongxuanlb

@dongxuanlb in this case it might the the overhead of conversion + rendering - try commenting out the all processing on host and just retrieve the messages from the queue. Let me know what kind of results this creates.

themarpe avatar Mar 01 '22 01:03 themarpe