Constant cloud payment pop ups, ads to view playback, risk of loosing all recordings if sd card is removed or the entire camera is removed etc, Are some of the issues that are faced when CCTV-CAMs with no NVR is used for home surveillance. I was a victim of this annoying procedure/process, So with a home server(bear-server) already deployed I came up with the idea to use it as a NVR by storing recordings and creating a method to view recordings in an organized manner with proper timestamps.

Main Goal: -Ditch the default CAM app with several adware and unnecessary payments for cloud storage -Privacy focused approach(recordings stored locally)

Recordings in local server

Instead of sending footage to third-party cloud services, all recordings stay on-prem, stored on the server. This eliminates recurring cloud fees and significantly reduces the attack surface.

Initial script without cleanup after 7days

๐Ÿ” Architecture Overview

Cameras stream via RTSP Server records continuously using FFmpeg Recordings are stored locally with retention-based cleanup Already deployed customized jellyfish media server is used to securely view recordings over the network and talent for remote recording viewing. The recording service runs automatically using systemd

Finalized script with cleaning up of recordings surpassing 7 days

Systemd config file for recordings to start at system boot

configured systemd

๐ŸŽฏ Why this approach?

No cloud dependency No SD card failures or limited storage Full control over retention and access Easier auditing and monitoring Integrates cleanly into a homelab or enterprise network

The recording script attached in one of the post images. The script records footage in 15-minute segments, automatically rotates old files, and avoids re-encoding video for efficiency and stability.

All 3 CCTV Cams recording in the background

๐Ÿง  Key Learnings

Privacy-first designs often simplify security Local storage + proper access control beats cloud convenience for CCTV Linux + FFmpeg is extremely powerful for media workloads Small scripts + systemd can replace expensive proprietary systems

Further improvements in future:

-Deploy frigate(self hosted NVR) solution -Backup using unison to my Qnap NAS -Setup a live-streaming surveillance instead of currently relying on the app for live streaming only.

This setup saved money, improved reliability, and gave full ownership of sensitive footage a good reminder that sometimes the most secure solution is the one you fully control. Security takeaway: The most secure systems are often the ones you own, control, and fully understand.

#Linux #SelfHosting #CyberSecurity #NVR #CCTV #Privacy #Homelab #FFmpeg #Jellyfin #OpenSource #Networking #DevOps