Event: HTTP Generic Event Send Metadata with boundary boxes
AnsweredHow is it possible to generate an Event with metadata that contains polygons for the boundary box? (with REST API)
-
LastOne: metavms-bundle-5.0.0.36634-windows_x64
Windows 11 and 2022 Server
I expected to post HTTP API something like this
{"timestamp": "2016-09-16T16:02:41Z","caption": "CreditCardUsed","metadata": {"cameraRefs": ["3A4AD4EA-9269-4B1F-A7AA-2CEC537D0240"],Polygon1 { .... },Polygon2 { .... },}} -
Ok. I see. Thanks.
At the moment, there is no REST API to push metadata for events or object.
You need to develop an analytics plugin.
Here are the articles to start with to make yourself familiar with the topic
https://meta.nxvms.com/docs/developers/knowledgebase/195-1-integration-capabilities--what-to-expect
-
Your colleague mentioned that 5.2 is a planned introduction API (REST to post Event with METADATA).
That's correct.
Even v5.1 is not yet released, so there is no schedule for v5.2 at the moment.
At the moment, the easiest way would be refactoring the sample_analytics_plugin (aka "hello world" pluigin) of Metadata SDK by introducing a thread listening on a network socket for JSON messaged.
-
So my analytical plugin will act as a server running on the VMS side. Will ignore frames from VMS and just listening certain TCP port for the event data message, and store this message in your SQLite DB.
Could the plugin can be written in a different language?
if I do not depend on frames from VMS, why do I still need a plugin running on VMS context?
-
So my analytical plugin will act as a server running on the VMS side. Will ignore frames from VMS and just listening certain TCP port for the event data message, and store this message in your SQLite DB.
The plugin won't write anything to the SQLite DB directly. Instead, using Metadata SDK classes, it will pass metadata to the Server via metadata packet. That's it. Afterward, it's up to the Server to deal with metadata.
Here is the Control Flow diagram with detailed technical description.
https://meta.nxvms.com/docs/developers/knowledgebase/204-plugin-control-flow
if I do not depend on frames from VMS, why do I still need a plugin running on VMS context?
To be able to pass metadata packets from the plugin to the Server.
-
Could the plugin can be written in a different language?
Technically it could, however,
1. The resulting file should be a binary file.
2. The final binary should be either a .DLL for Windows or .so library for Linux.
3. The final binary should comply with С++ ABI presented in the Metadata SDK.
-
One More Question, to better understand your plugin model
Is your plugin model stateful or stateless?
So when you load the plugin, how is your system calling
pushUncomressedFrames() and pullMetadataPackets() sequence.
If the plugin is stateful, where is the best place to create network listeners for th3-party AI's.
-
Hi Irakli,
So when you load the plugin, how is your system calling pushUncomressedFrames() and pullMetadataPackets() sequence.
According to the SDK documentation
bool nx::sdk::analytics::ConsumingDeviceAgent::pullMetadataPackets ( std::vector< IMetadataPacket *> * metadataPackets )
Override to send the newly constructed metadata packets to Server - add the packets to the provided list. Called after pushVideoFrame() to retrieve any metadata packets available to the moment (not necessarily referring to that frame). As an alternative, send metadata to Server by calling pushMetadataPacket() instead of implementing this method.
Is your plugin model stateful or stateless?
I'm afraid, I don't understand your question. Could you please elaborare?
If you need a network listener per camera, it would be DeviceAgent constructor.
If you want on network listener for all cameras, it would be Engine class constructor.
-
Hello Andrey,
What I mean is that some applications load DLL and call some functions. That's what your VMS is doing,
it loads each plugin and calls predefined functions like ( pushMetadataPacket) for each one.
Stateless means, in our case, that your VMS is calling the function pushMetadataPacket in a predefined sequence. There is no way to implement some listeners in the plugin. The only way we left it was to call the-3 party AI server within pushMetadataPacket() function.
Stateful means that I can make my own loop, e.g., HTTP server, and call pushMetadataPacket() by triggering some event. As your C++ SDK does not refer to any DLL or binary, I think your plugin model is stateless.
Please correct me if I'm wrong.
-
Hello,
Stateful means that I can make my own loop, e.g., HTTP server, and call pushMetadataPacket() by triggering some event.
When a plugin binary is loaded, you can do that: create a separate thread, with a loop and call pushMetadataPacket() periodically.
Here is a quotation from the guide by the link above
You can choose either one of the "push" or "pull" paradigms depending on the desired workflow in the Plugin. The differences are:
-
pushMetadataPacket()
is called by the Plugin, whilepullMetadataPackets()
is called by the Server. -
pushMetadataPacket()
expects one metadata packet, whilepullMetadataPackets()
expects astd::vector
of them
-
Please sign in to leave a comment.
Comments
16 comments