Nx plugin get other than motion events
Answered-
Hi Mohamed Rafi,
Thanks for your questions, but we are afraid we don't understand your purposes correctly, can you please elaborate more details?
Nx Witness can support AXIS/Hikvision in-Camera analytics already. (Ex: Tampering)
For AXIS, those analytics that installed via ACAP platform, as well as support the VAPIX API set should be already working.
Fo Hikvision, there are different sets of ISAPI, and Nx has support some of them, ex: Tampering, scene change, etc. Also, the LPR/Thermal events.
So, if you want to use those existing functions, you can use it already and there is no need to develop any identical functions for that purpose. But if you are looking for something not yet supported, you are suggested to study the sample code on our open repo on Github.
That being said you are asked to implement the plugin to get the event from cameras based on different camera proprietary APIs then declare the events in your plugins, then implement the part of event polling and notification.
We don't provide the sample code for a specific camera manufacturer but you can refer to the object detection sample via openCV from our Github. If you need the assistance of those APIs, unfortunately we might not be able to teach you how to use manufacturers' API, so please get the assistance from the camera vendors.
Our sample code shows how you can fire the events and declare the events, so you are suggested to study the code first and have a look of the documents as a start.
Thanks.
-
Hi Ichiro,
Thanks for your response. I want a trigger to handle the 'Camera Tampering' Event and other inbuilt Camera analytics from the Plugin Code. Currently, I am able to get Nx Motion-Event processed successfully from the Plugin Code using pushUncompressedVideoFrame as given in the following code. I am looking for sample to do the processing of my functionality based on 'Camera Tampering' and other Analytics events set in Axis camera to get triggered from Plugin Code.
DeviceAgent::pushUncompressedVideoFrame(const IUncompressedVideoFrame* videoFrame)
{
++m_frameIndex;
m_lastVideoFrameTimestampUs = videoFrame->timestampUs();
if (isMotion(videoFrame->metadataList()))
{
//Do Proccessing based on Motion Event
}
}
DeviceAgent::isMotion(Ptr<IList<IMetadataPacket>> metadataPacketList)
{
int metadataPacketCount = metadataPacketList->count();
for (int i = 0; i < metadataPacketCount; ++i)
{
motionPacket = metadataPacket->queryInterface<IMotionMetadataPacket>();
}
}From the Document link, I see that Device agent provides 2 key methods. I am using the first method to process Motion-Event from Nx VMS. Does the 2nd method pushMetadataPacket or pullMetadataPackets will receive the 'Camera Tampering' and other Camera in-built Analytics events within the Plugin?
- DeviceAgent will receive video frame-by-frame implementing one of the methods pushCompressedVideoFrame() or pushUncompressedVideoFrame().
- DeviceAgent sends detected objects and metadata either calling the method pushMetadataPacket() or implementing the method pullMetadataPackets().
Can the following code provide trigger to get the Camera inbuilt analytics in Plugin code:
DeviceAgent::pullMetadataPackets(std::vector<IMetadataPacket*>* metadataPackets)
{
metadataPackets->push_back(generateObjectMetadataPacket().releasePtr());
return true; //< There were no errors while filling metadataPackets.
}Thanks a lot for your help.
-
Hi. I think i have a similar issue
In my plugin, in the pushUncompressed frame method, i get the metadataList
When i am trying to cast it, i do not know its origin. The ID it returns is
:nx::sdk::analytics::IMetadataPacket
How can I check which is the correct class to cast and get attributes?
Please sign in to leave a comment.
Comments
3 comments