I would like to present you 3 free & open source CCTV solutions.
KERBEROS.IO

From the homepage
Kerberos.io is a video surveillance solution, which works with any camera and on every Linux based machine. You can deploy a fully configured video surveillance system within a few minutes on the environment you prefer: Raspberry Pi, Docker, Kubernetes cluster. Great UX and scalability is one of its keys differentiators.

Key points
- Available on docker, kubernetes, raspberry
- Easy to set up
- Good UX design
- Supports both on-premises and in the cloud
- Supports USB cameras, Raspberry Pi cameras, IP cameras
- Motion detection (AI)
ZoneMinder

From the homepage
ZoneMinder is an integrated set of applications which provide a complete surveillance solution allowing capture, analysis, recording and monitoring of any CCTV or security cameras.

Key points
- Object and person detection
- Supports BTTV cards, USB cameras, IP cameras
- Docker image available
- Motion detection (AI)
- AWS S3 support
Shinobi

From the homepage
Shinobi is Open Source, written in Node.js, and real easy to use. It is the future of CCTV and NVR for developers and end-users alike.

Key points
- Many video formats supported
- Low CPU usage
- You can select the area to monitor (AI)
- Motion detection (AI)
- Docker available
Links
https://kerberos.io/
https://www.zoneminder.com/
https://shinobi.video/
https://pixabay.com/photos/camera-spy-pigeon-surveillance-712122/
https://www.youtube.com/watch?v=517dptJhF5g