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 pre-configured action "Recording on camera".
Here are 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 in the 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 a 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 a third-party device to make HTTP-requests to Server). Nx Witness Server requires at least one of the source, caption or description to take some value. For our example HTTP-request let's make caption take the value of the phrases "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:email@example.com:7001/api/createEvent?state=Active