Following tutorial on how to dynamically re-draw an AS (event, not app) area when needed and you want to do it via HTTP API.
Open CamIP/admin/kurator and enter the path camera/events/ima/as - and click on “Read”
There you will find the “activity area” as JSON Array and Object. That can be manipulated/replaced via POST requests to the JSON API http://camip/api/json/config/camera/events/image/as/.../activity_area
The aim is to dynamically modify an Activity Sensor area (AS from now on).
In our camera, the area will already be defined but the need is to modify this area and do so via IP notification.
For this purpose, we already create two different AS profiles:
- TestRect: with rectangular area defined as follows in the event window: 0,812,682,248,157
- TestPoly: polygonal area defined as follows in the event window: 0,poly=658x857/685x901/765x899/754x857/786x812/754x759/706x705/658x759/639x812
These two areas have their corresponding configuration in two different JSON arrays that can be found in:
http://IP_camera/admin/kurator
AS corresponds to the following (generic) path (see image below):
and our two created AS profiles have their correspondents in a random name assigned to each.
1. TestRect -> "ima_64ad4ac5" (indicated ib the picture above).
2. TestPoly -> "ima_64ad4ad1".
Now, we need to create the first IP notification to change the coordinates of the rectangular area.
Below is the screenshot for ease of reference. Pay attention to the string that is sent as JSON.
To obtain it, we entered the path to the JSON of the TestRect profile (indicated by the red arrow) and then clicked on the button indicated by the green arrow to see its private definition of characters that cannot be used in IP notification
At this point the string will become, in compact form
[[
{“excluded”:false, “rect_xywh”:[812,682,248,157]}
]]
as depicted below:
We then construct the IP notification as follows:
The same reasoning applies in the case of poly area, using of course the corresponding previously created profile.