How to store data coming from a third party API to the NX server?

Answered

Comments

3 comments

  • Avatar
    Andrey Terentyev

    Hello Sindhu Satish ,

    Could you elaborate a bit about your objective, please? Where your code is supposed to be executed? Your code is supposed to do what specifically?

    0
    Comment actions Permalink
  • Avatar
    Sindhu Satish

    Hello Andrey, thank you for your response.

    So I have an external Python API which accepts a frame sent from the network optic plugin and returns the co-ordinates for the bounding boxes of the objects present in that frame.

    I need to get this data and store it within the internal database of the NX server.

    this needs to happen within the plugin.

    0
    Comment actions Permalink
  • Avatar
    Nx Support

    Hi Sindhu,

    Just to make sure that we are on the same page: you're asking about the metadata plugin development process, is it correct?

    If that is the case, you basically need a plugin, that is not only able to send some frames to your external Python backend, but this plugin has to be capable of receiving the data from your backend and supplying the Server with this metadata in a appropriate format.

    Could you please elaborate what do you mean by "network optic plugin"? Are you using some of the examples that we provide in order to supply your backend with the video frames? If that is the case, I believe that what you need to do is to modify the plugin in a way that it is going to be capable to receive the metadata from your backend and supply the Server with it.

    To record the metadata to the DB of the Mediaserver you do not need to do anything specific as long as your plugin provides the Server with metadata that has got a correct format - it is going to be done by the Server automatically in case if your plugin is up and running and recording is enabled for a camera. So, you don't need to create any tables or records in the DB.

    For the starters, please refer to these articles if you did not see them already: https://support.networkoptix.com/hc/en-us/sections/360004090353-Integrating-Video-Analytics.

    Then I would suggest you to check the source code of sample_analytics_plugin, which is included with metadata SDK package. It is a small example, but it is capable of providing the Server with metadata that contains size and position of the  bounding boxes and text attributes of the objects, the plugin is also capable of generating some sample events.

    The plugin uses the methods that are dedicated to transfer of metadata from plugin to Server, these are pullMetadataPackets() and pushMetadataPacket(), you can check on those.

    Should you have any problems, please just ask us here.

    Regards,

    Maxim Podstrechny,

    QA Engineer

    0
    Comment actions Permalink

Please sign in to leave a comment.