[metadata sdk] asynchronous frame processing
AnsweredHi,
I'm developing a metadata plugin which needs to perform some fairly heavy number-cruncing (DNN inference) on each video frame received. Since running these computations inside DeviceAgent::push*VideoFrame (i.e. synchronously) would in most cases block the calling thread for too long, my only real option is to move them to a separate thread and send back per-frame metadata asynchronously via DeviceAgent::pushMetadataPacket. However it seems to me doing so will cause the association between frames and metadata to be lost from the server's point of view. Is just assigning proper timestamps to metadata packets (e.g. objectMetaDataPacket->setTimestampUs(videoFrame->timestampUs()) enough to inform the server which packet corresponds to which frame, or can / should this be handled another way?
Thanks!
-
Hello Bianka,
Here is a similar case to yours. I supposed it might be very useful reading for you on how to organize your solution and minimize delays.
https://support.networkoptix.com/hc/en-us/community/posts/360038642973/comments/360010527354
With this is enough.
objectMetaDataPacket->setTimestampUs(videoFrame->timestampUs())
The Server will link your metadata to the appropriate frame based on the timestamp data and will save to the video archive. If you need your recognized data been displayed on live stream you need to make delay less then 2 seconds.
0
Please sign in to leave a comment.
Comments
1 comment