Unfortunately neither of these has alarm input/output pins, so the "solution" I describe here will not work. Model numbers that have a -S at the end (or -IS, etc) have alarm input and output pins.
I haven't yet found a purely software-only method for sending commands that trigger a recording...
Which camera model do you have? Not all models have hardware alarm input/output lines. Also, if your camera does have these lines, you may have to enable and configure them first in the camera configuration.
I was able to get something like this working tonight on my December 2014 HikVision DS-2CD2632F-IS with 5.2.5 firmware which is a model features hardware alarm input and output lines.
I have no experience with any of their other cameras or devices so please don't take anything I write below as...