zmapi - a ZoneMinder API CLI plus camera control/watchdog

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
Yetanorwell
Posts: 2
Joined: Fri Apr 09, 2021 1:56 pm

zmapi - a ZoneMinder API CLI plus camera control/watchdog

Post by Yetanorwell »

For those who may be interested, I just put the ZM API CLI and camera control scripts which I cobbled together to keep the cameras around the farm in check on Github:

https://github.com/Yetangitu/zmapi

While there may be other such things around (I know of a Python API module, at least) I have not found a really simple, batteries included, no-nonsense API CLI so I made one for (first) the Xiongmai-based cameras I happen to have and (later) ZoneMinder. The camera control script is a bit more fleshed out because a) I started there and b) the web interface on these things is just awful and best shunned. With the script it is easy to e.g. set the time on all cameras, change their video parameters (encoding, resolution, frame rate, etc.), change their names and more. The ZoneMinder API script is currently mostly used to get monitor status data to find cameras which have stopped streaming (through the camwatch script) for a given interval, upon which they are reset using the cam script.

There is a bit of explanation on the use of these things in the repo, check the source for more information.

The camera control script is, as said, tailored to the Xiongmai-based cameras we use. It should work for any camera which uses their "NetSDK" API, it will not work for anything else. As long as that "anything else" has an API it should not be too hard to adapt the script, simply replace the API endpoints defined in the SDK array with those used on your camera, add configuration commands in the series of command arrays under it and publish yout changes.

These scripts are in use here, they work for me. I guarantee you they take up space on your disk, no more.
Post Reply