Nx Witness doesn't have direct API method to start or stop recording on certain cameras. But there is one called "generic event" that can trigger preconfigured action "Recording on camera".
Here's the simple how-to steps:
- Connect with Nx Witness client to the Media Server
- Select cameras you want to record with http request -> right-click them -> "Cameras settings" -> "Recording" tab -> enable recording(filling the schedule is unnecessary) -> "OK"
- Press "ctrl+e" to call event rules dialog
- Click "Add" at the top left corner to add new rule
- Click new appeared rule and in the drop-down list select "Generic event"
- Click "Action" column for this event and select "Camera recording", in "Target" column select camera to record(one of those with recording enabled on second step) -> "Apply"
- You can right-click this new rule and call advanced settings. There you'll be able to add some keywords to specify http requests that will trigger the recording(Source name, caption or description), recording fps, quality and post-recording time(time to record after the event is over)
- After that to activate recording you'll need to construct and send to server some certain requests to start and end recording). Below some examples of those requests are listed.
Let's assume you're trying them with browser from the server pc itself. In this case instead of its ip one can use 127.0.0.1, for other cases use certain server NIC ip address(if you're using third-party device to make http-requests to Server). Nx Witness Server requires at least one of source, caption or description to take some value. For our example http-request let's make caption take value of phrase "Hello_World!":
To start recording with every filter string empty in generic event advanced options send the following request:
To stop recording use this one:
Keep in mind that recording stop will happen when this http-request is processed by server + time from "Post-recording" option.
Also please keep in mind that all these requests will require authentication. Nx Media Server supports basic and digest authentication. Digest is more secured, workflow is described in the API documentation.
Basic is much simpler to use, just add user login and password to the link like this:
In my case it would be(if my admin's password was admin): http://admin:firstname.lastname@example.org:7001/api/createEvent?state=Active