Sending object metadata causes FPS drops in the stream


I want to send some object metadata(class_id, confidence value, etc…) to another PC but it causes FPS drops and the stream is frozen. I use this function to send a class_id message when the object is detected.
I am using deepstream-app-test1 and I put the send_one function under while l_obj is not None:.
What kind of approach I should follow to solve this problem?

while l_obj is not None:

        # Casting to pyds.NvDsObjectMeta
    except StopIteration:
    **if obj_meta.class_id in class_dict:**
**                send_one(obj_meta.class_id)**

Can you confirm the server you are sending data to is on and you are able to establish a connection?

Yes I can confirm that. I can see the console message. Message sent on socketcan channel 'vcan0'

Actually, It is not a server I just simplify the problem for a clear explanation. I am just sending a virtual CAN message which is I don’t think the problem is with the messaging function. I want the message sending to be sent in the background as soon as it detects the object without disturbing the real-time stream.

I see. I am not sure but gstreamer may have some functionality to run asynchronous callback functions. Other than that you could try running that function in another thread, or perhaps using the asyncio library.

1 Like

Hi @mattcarp88,

Thank you for your answer, I wrote a fake message generation function. I queued messages using the Queue library. But I don’t know how to integrate these functions into Can you help me under this topic? How to send metadata messages to the database without causing a freeze in the stream?

Best Regards,