NATHAN242's Projects

Projects

Tools

Libraries

Web Tools


IPCAM-CCTV

Project repo: LINK

Introduction

This creation came about as a result of my frustration with CCTV recording systems (NVR's and several applications). Such systems have always been unreliable and unstable in my experience.

I soon discovered that VLC was a good client for connecting to and testing network CCTV cameras so I figured, why not script a load of VLC processes to run and capture camera output to disk?
I ended up with a few PHP command line scripts that would launch VLC processes using camera configuration stored in a database (this was an early version of the scripts found in the "/control/" directory).
This proved to work quite well so I ended up building a web interface for management of cameras around this functionality.

Features

Known issues

Planned Features

Details

The recording functionality is implemented using the scripts in the "/control/" directory. Those scripts can be called at the command line in order to start or stop recording. This also allows you to build a different interface around the system.

You can start recording for a device with:

php -f start-single.php [CAMERA_NAME]

Or start all cameras with:

php -f start-all.php

Those scripts will launch 'spawn-vlc.php' in the background for each camera. This script will launch and monitor a VLC process for recording. You can also launch this script directly but this should only be done for troubleshooting:

php -f spawn-vlc.php [CAMERA_NAME]

The other scripts can be used to stop or reload camera recording:

php -f reload-single.php [CAMERA_NAME]
php -f reload-all.php
php -f stop-single.php [CAMERA_NAME]
php -f stop-all.php

NOTE: Make sure that the user you invoke those scripts as, has the relevant permissions to write to the recordings, logs and PIDs directories. Also, you cannot stop cameras from the web interface if the web server user does not have permission to kill processes owned by the invoking user.

Configuration is stored in a MySQL/MariaDB database. There are 4 tables:

The config table stores global configuration and can also store configuration overrides for individual cameras. This allows you to do things such as set a different recording location for a specific camera.