trigger Api commands from the plugin

Completed

Comments

8 comments

  • Avatar
    Anton Babinov

    Hello Ali,

    Is there a part, or a code sample to trigger the API commands.

    At the moment SDK doesn't provide any additional tools to execute API commands. You can do this, but would be the same as triggering API call from the third party application - implement authorization, HTTP calls, parse HTTP responses.

    I want to set codes inside the plugin to trigger API commands. Could anybody help me about it.

    At the moment we're considering implementing an easier way to use API commands from inside of the plugin. Could you please tell us more about your use-case scenario? Which API commands do you want to use and how they would affect your plugin?

     

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

    I want to implement these actions from inside the plugin; 

    textoverlay to a specific camera,  put a bookmark,  taking video backup, export camera record.   It seems that,  it can be done, from inside the plugin. Do you have any advice to do it with writing shorter codes in plugin? 

    Or it can be done writing c++ http request code again inside the plugin to send API commands (This is a little frustrating issue, basic authentication has to be added inside the request, also some requests has large content). Do you have any recommended C++ rest library that works properly with cmake & vs2017?

    Thanks,

      

     

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Anton Babinov

    textoverlay to a specific camera,  put a bookmark,  taking video backup, export camera record.   It seems that,  it can be done, from inside the plugin. Do you have any advice to do it with writing shorter codes in plugin? 

    I don't think that triggering API call would be the right approach for this. You can trigger analytics events in your plugin instead of making complex HTTP requests. VMS server will process your triggered events based on the created event rules. Our stub analytics plugin sample includes some examples on how to create and manage analytic events in plugin, you can check function cookSomeEvents() in file device_agent.cpp . From the plugin side, you'll need only to generate event and create event's metadata. Event processing like textoverlay to a specific camera,  put a bookmark, ect. can be configured via rules engine:

    This way you wouldn't need to worry about executing API call from inside your plugin.

    0
    Comment actions Permalink
  • Avatar
    Evgeny Balashov

    Hello Ali,

    Can you please describe what featured do you want to implement in the integration?

    Are you planning to do video-analytics and send metadata information into the system? What other things are you trying to achieve?

    0
    Comment actions Permalink
  • Avatar
    Ali Ergin Hacimahmutoglu

     I have already written, what I want, in my previous post. I  don't want to send analytic events. I want to send direct commands to the system like textoverlay to a specific camera,  put a bookmark,  taking video backup, export camera record. I know, similar things are done in the plugin but I haven't much experience in c++. So if you share any available code sample, I would be very happy, It will save me a lot of time.  

    Thanks,

    0
    Comment actions Permalink
  • Avatar
    Evgeny Balashov

    Ali, in this case, you don't need to create a plugin using SDK, you should use API instead.

    So you won't need to use C++ for this, you can choose any technology stack you like.

    0
    Comment actions Permalink
  • Avatar
    Luciano Roberto

    Is it possible to set the language to Korean or the character encoding to UTF-8 in the custom text? Because the Korean characters get broken when sending the following custom text as part of the HTTP POST request i send to the Nx System in order to display the text overlay on the real-time camera video.

    <h4>해더</h4>#<font color="red" size="5">내용</font>

    Note: Setting the above custom text directly from the Nx Client UI will work just fine. The problem only happens when sending it as part of the HTTP POST ("/ec2/saveEventRule") command.

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello,

    You could try this procedure to figure out how to present correctly national symbols to the API endpoint.

    1. Configure a rule having Korean symbols via the GUI client

    2. Invoke getEventRules to see how Korean symbols are passed.

    3. Apply result in step 2 to saveEventRules
    Here is an example

    A rule

    getEventRules gives

     

    0
    Comment actions Permalink

Please sign in to leave a comment.