Restart Metadata Live Stream (RTSP)

I have a plugin that is consuming metadata delivered over ONVIF/RTSP in the Smart Client via MetadataLiveSource. When streaming live metadata, the RTSP Server will send an initial metadata state when the connection is first established.

Herein lies the problem, the initial state will not be available when the Smart Client is closed and then opened because the RTSP session is active. I have observed that the session can only be closed when the recording server is restarted or the actual device being disabled/enabled.

So this leads me to my question.. Is there a way to restart the RTSP session from a Smart Client plugin? Or any other suggestions?

You cannot restart the camera or the camera stream from a plugin. I think it is important to envision the metadata stream not as flow with one target Smart Client in mind, but a general stream that get stored in the server and potentially is consumed by many clients. If we found a way to restart the camera or the metadata stream it could very well be disruptive for the overall functionality of the VMS and clients.

Thinking hard I came up with this idea of a workaround. I am not sure if it is feasible for you and fits the situation accurately.

If I assume that you have also implemented the camera and its sending of the metadata in the first place, then I guess you could implement a new routine to send a new package with the initial state either periodically or when signaled.

What is missing then is a way to signal your routine in the metadata sender in the camera, to trigger that it sends a new initial state metadata package. For this signaling you might be able to use DriverCommand messaging, which enable you to send a device specific command to a device through the Recording Server.

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_driver_command_data.html&tree=tree_search.html?search=drivercommand

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_message_id_1_1_control.html&tree=tree_search.html?search=drivercommand