Skip to main content

Sync CCTV footage with Google Drive using Linux

In an era where security is paramount, ensuring the reliability and accessibility of your home surveillance footage is key. Enter CCTVGDriveSync, a powerful solution designed to seamlessly integrate CCTV video storage with the convenience and security of Google Drive. This project leverages the robust capabilities of ffmpeg and rclone to create a comprehensive system that ensures continuous recording, efficient storage management, and reliable cloud backup for your CCTV footage.



The Challenge

Home security is a priority for many, and CCTV cameras provide a valuable layer of protection. However, managing the recorded footage and ensuring its accessibility can be a challenge. Local storage solutions may face limitations in terms of space, and relying solely on on-site storage can leave you vulnerable to data loss in case of hardware failures or unforeseen events. The cost of cloud storage that they provide by camera manufacturer is too expensive. 

The Solution: CCTVGDriveSync

After doing lot of research and trails I decided to create my own scripts to acheive the task and the out come is CCTVGDriveSync. It addresses these challenges by combining the power of ffmpeg for video recording and rclone for cloud synchronization. And your CCTV camera should be able to connect to the local network via Wifi or Cable and it should support RTSP streaming. You can find the list Wifi cameras that support RTSP in the link. RTSP Wifi Cameras

Continuous Recording with record_front_door.sh

The record_front_door.sh script ensures the continuous recording of your front door CCTV stream. By utilizing ffmpeg, this script captures the video stream and organizes the footage into manageable segments. This not only ensures efficient storage utilization but also provides ease of access to specific timeframes.

Real-time Monitoring with check_heartbeat.sh

The check_heartbeat.sh script adds an extra layer of intelligence to the system. It monitors the last update time of the CCTV footage and triggers alerts if no updates occur within a specified timeframe. This real-time monitoring ensures that you are promptly informed of any issues or interruptions in the recording process.

Efficient Storage Management with clean_drive.sh and cleaner.sh

Storage management is a crucial aspect of any surveillance system. The clean_drive.sh script automatically deletes old files from the Google Drive directory, maintaining storage efficiency and preventing clutter. Meanwhile, the cleaner.sh script takes care of local storage, cleaning incomplete and older files to free up disk space.

Robust Cloud Backup with sync_videos.sh

The sync_videos.sh script ensures that your recorded videos are seamlessly copied to Google Drive, providing a robust cloud backup. This not only safeguards your footage from on-site risks but also enables remote access to your CCTV recordings.

Getting Started with CCTVGDriveSync

Setting up CCTVGDriveSync is a straightforward process:

  1. Clone the Repository:

    git clone https://github.com/your-username/CCTVGDriveSync.git
    cd CCTVGDriveSync
    
  2. Configure and Install: Adjust the configurations in the scripts to match your setup and install the necessary dependencies. Refer the Readme of the project for setup information.

  3. Schedule Cron Jobs: Configure the scripts as cron jobs to run every minute for continuous monitoring and synchronization.

    * * * * * /path/to/CCTVGDriveSync/check_heartbeat.sh
    * * * * * /path/to/CCTVGDriveSync/cleaner.sh
    * * * * * /path/to/CCTVGDriveSync/record_front_door.sh
    * * * * * /path/to/CCTVGDriveSync/sync_videos.sh
    0 */4 * * * /path/to/CCTVGDriveSync/clean_drive.sh
    

Conclusion

CCTVGDriveSync empowers you to take control of your home security footage. By combining the flexibility of local recording with the resilience of cloud backup, this project provides a comprehensive solution for managing and safeguarding your CCTV recordings. Enhance your home security strategy today with CCTVGDriveSync.

For more details and contributions, check out the CCTVGDriveSync GitHub repository.

Please do checkout our amazon affiliate link for best offers and deals here.

Comments

Popular posts from this blog

TataSky Refresh after Recharge - Activate after Recharge

If you are using TataSky and doing recharge occasionally and that too after disconnection, this post will be very helpful for you. Most of the time you will not get the channels listed as soon as you make the payment. It will display message to Subscribe for that channel. You can easily get channels back by simply giving a missed a call from your registered mobile number. Note: Make sure your TV and SetupBox is on and showing the error message Give missed call to  +91 80892 80892 (Soft Refresh)   wait for 1 minute and If still not active then try giving missed call to  +91 90405 90405 (Heavy Refresh). Ad: Planning to buy a Best low budget Smart TV? Consider  Acer 109 cm (43 inches) I Series 4K Ultra HD Android Smart LED TV AR43AR2851UDFL (Black)  - You can get this TV as low as for 20,000 Rs - which has Bluetooth, WiFi, Android and good customer ratings (4.4/5). Note: Price based on offers, click on the link to see current price on the web page If the above ste

Smart Bulb Control using Python Script

Smart Bulb Control using Python Script Hello again, In this article, we will see how to control the smart bulb on the local network unsing a python script and will guide you through the process of setting up and using this script to seamlessly manage your smart lights. Whether you want to turn your lights on or off, adjust brightness levels, or even change color settings, this script provides a convenient way to interact with your smart bulbs right from your Python environment. Example lits pytest The light color will turn green if all tests pass or red if test fails. And while starting the bulb glows with a warm white (yellow) color Currently the script is tested on Wipro Smart bulb s and Amazon Basics smart bulbs   The source code of the script is available on  github  Please do check the repo and feel free to clone the repo. Let's get started by setting up the environment: Clone or download the repository to your local machine. Navigate to the dir

Duplicate file finder/Remover using perl and SHA1

When you are using a computing devices (either a laptop or PC or a Tab) for your personal use after some time (let take some years) you will realise that your disk is full and most of the space are occupied by duplicate files (Same copy of file located in different locations). For ex: You might have a favourite music file in "My Favourite" folder as well as in the "Album" folder. But finding this duplicate manually is a biggest process. That too if the file names are different OMG!. There are lot of free utilities available to do this in automated way, but if you are a programmer, you will always prefer to do it on your own. Here are the steps we are going to do. This is purely on a linux - Ubuntu system.  (for windows you might need to change the path as per conventions ) Getting SHA1 for all the files recursively in a given directory Compare SHA1 with other files Remove the duplicate file Getting SHA1 of a file Using cpan module   Digest::SHA1 we c