But it seem that ZoneMinder become slowly outdated, php etc..
I've found a couples of alternatives ( hard choice as the limitations of use are often buried deep )
It seem that openCV is really famous for AI Computer vision, So I would be surprise if there were no Python program to manage cameras like a ZoneMinder !?
I'm guessing you might be trying to edit the software to do something else as well, in which case it might be possible to embed Python somehow or get it to call another program.
It seems like you want to do some kind of facial recognition. That feels a bit out of my league if I'm honest, but I can tell you the sort of thing I would probably try to do if I had to do that.
You'd want some footage from when someone's face was close to the camera, so you could try getting snapshots of when there was a lot of motion in the video, then save those to some folder as pictures.
Once you have those pictures, it sounds a lot easier to try to run some complicated facial recognition algorithm on them than just "using the right camera software".
Presumably the CCTV is controlled by some server, so I would get the server to then handle the facial recognition separately, either on a schedule or soon after the motion close to the camera. An underlying facial recognition software could hopefully be called as part of a shell script on the server.
If that's the problem you're trying to solve, I think I broke it down into a few subproblems, which might help. I might be a bit wrong though because I have no experience doing anything with CCTVs.