Merge branch 'develop' into 2.0

This commit is contained in:
Cédric Verstraeten
2018-06-05 13:52:20 +02:00
6 changed files with 108 additions and 82 deletions
+62 -1
View File
@@ -25,7 +25,7 @@ A short video explaining how to install Kerberos.io on Raspbian.
Update system and install libav-tools.
sudo apt-get update && sudo apt-get install libav-tools
sudo apt-get update && sudo apt-get install libav-tools libssl-dev
Download the debian file from [**the machinery repository**](https://github.com/kerberos-io/machinery/releases/v%machineryversion%/); Please download the correct version for your Raspberry Pi.
@@ -172,3 +172,64 @@ Initiate a cronjob, and select the **nano** editor.
Append following line, to execute the **autoremoval.sh** script every 5min.
*/5 * * * * /bin/bash /home/pi/autoremoval.sh
# Multi-camera on Raspbian
When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
## Install Raspbian
First things first. Install Kerberos.io on Raspbian by following **the Raspbian installation** mentioned before, and make sure you've installed Kerberos.io properly.
By default Kerberos.io **only support a single type of camera**, you can navigate to the settings page and change the capture device. If you want to connect more cameras, it **isn't possible** to configure it **through the web interface**.
## This is how it works
When installed properly, the kerberos.io binary will start at boot, and read the configuration files located at **/etc/opt/kerberosio/config**. Next to that Kerberos.io will start the correct capture device, and configure the complete system according the settings you've defined in those configuration files. This is what happens:
$ kerberosio --config /etc/opt/kerberosio/config/config.xml
To start multiple devices we can simple run the binary a second time, and **overwrite the settings** by commandline parameters. Suppose that we want to connect two more USB cameras, next to our Raspberry Pi camera, then we can do this as following:
$ kerberosio --name usbcamera1 --capture USBCamera --captures.USBCamera.deviceNumber 0 --streams.Mjpg.enabled false &
$ kerberosio --name usbcamera2 --capture USBCamera --captures.USBCamera.deviceNumber 1 --streams.Mjpg.enabled false &
What this will do is start two new kerberosio processes, and **connect each USB camera to a kerberosio process**. By overwriting the devicenumber we're able to select a specific USB camera. Next to that we also disabled the stream, because by default kerberosio will bind to the port 8889, and that will not work if we have multiple processes running (additionally you can change the port for each process).
## Where can I find those variables?
When Kerberos.io is started it will write to a log file located at **/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
26/10/2016 08:11:36.135 INFO [trivial] Reading configuration
26/10/2016 08:11:36.141 INFO [trivial] Final configuration:
- algorithm = DifferentialCollins
- algorithms.BackgroundSubtraction.dilate = 7
- algorithms.BackgroundSubtraction.erode = 5
- algorithms.BackgroundSubtraction.history = 50
...
- algorithms.DifferentialCollins.threshold = 15
- capture = USBCamera
- captures.IPCamera.angle = 0
- captures.IPCamera.delay = 1000
- captures.IPCamera.frameHeight = 360
- captures.IPCamera.frameWidth = 640
- captures.IPCamera.url = rtsp://admin:888888@192
- captures.RaspiCamera.angle = 0
- captures.RaspiCamera.delay = 500
- captures.RaspiCamera.frameHeight = 720
- captures.RaspiCamera.frameWidth = 1280
- captures.USBCamera.angle = 0
- captures.USBCamera.delay = 500
- captures.USBCamera.deviceNumber = 0
- captures.USBCamera.frameHeight = 640
...
- streams.Mjpg.enabled = false
- streams.Mjpg.quality = 75
- streams.Mjpg.streamPort = 8889
- timezone = Europe-Brussels
## Where can I find my images?
All images will be stored at the same location, so they will be mixed in the webinterface. We don't provide a way to see the images independent (on a camera basis), if you would like to have this then you should check out our [**cloud application**](https://cloud.kerberos.io) which has some additional features.
+45 -4
View File
@@ -1,11 +1,52 @@
# Docker
**--- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera ---**
**!!! For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera !!!**
A Docker image (x86) is available on [**the Docker Hub**](https://hub.docker.com/u/kerberos/kerberos). Before you can run this image you will have to get [**Docker**](https://docker.com) installed. After the installation you can use **docker** to get Kerberos.io up and running.
A Docker image (x86, ARMv7, ARMv8) is available on [**the Docker Hub**](https://hub.docker.com/u/kerberos/kerberos), which contains all the necessary software to setup your security infrastructure in a matter of seconds. Before you can run this image you will have to get [**Docker**](https://docker.com) installed. After the installation you can use **docker run** to get Kerberos.io up and running, or you can opt for **dockeros** to create and scale your security infrastructure.
## Run a simple command.
## Use docker run
After you've installed docker, you can open a command prompt and type in following command. This will pull the kerberos image and make the web interface available on port 80 and the livestream on port 8889. You can give the container a custom name using the **--name** property.
docker run --name camera1 -p 80:80 -p 8889:8889 -d kerberos/kerberos
$ docker run --name camera1 -p 80:80 -p 8889:8889 -d kerberos/kerberos
$ docker run --name camera2 -p 81:80 -p 8890:8889 -d kerberos/kerberos
$ docker run --name camera3 -p 82:80 -p 8891:8889 -d kerberos/kerberos
## Or use dockeros (our docker creation tool)
We've created a simple and small tool to auto provision and auto configure Kerberos.io containers. The idea is that you define the different configurations for every camera upfront (/environments directory), and map them to into your Docker container (using volumes). The ultimate goal is to have a fully automated and lightning fast way for provisioning your video surveillance environments in just a matter of seconds. It's also a great way to backup your security configuration.
CAMERA 1 <<== CONTAINER1 <<== environment/cameraconfig1
CAMERA 2 <<== CONTAINER2 <<== environment/cameraconfig2
CAMERA 3 <<== CONTAINER2 <<== environment/cameraconfig3
### How to use it?
The tool we've created is a simple bash script which we called **dockeros**, and exposes a couple of methods; discussed below. By specifying a number of parameters, **dockeros** will do all the magic dockering for you. This tool is still work in progress, so PR's and new features are welcome!
git clone https://github.com/kerberos-io/docker
cd docker/bin
./dockeros.sh {command}
### Commands
List all kerberos.io containers which are created.
./dockeros.sh showall
Remove all kerberos.io containers which were created before.
./dockeros.sh cleanup
Create a kerberos.io container with a name and predefined configuration.
./dockeros.sh create {name} {config} {webport} {streamport}
* **name**: This is the name of the container which will be created.
* **config**: The configuration which needs to be injected in the container. The configuration directories can be found in the **/environments** folder.
* **webport**: The port on which the webinterface will be served.
* **streamport**: The port on which the livestream will be served.
@@ -1,15 +0,0 @@
# Multi-camera with Docker
**--- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera ---**
If you own multiple IP-cameras, then you probably **don't want** to setup **a Raspberry Pi for each camera**. Thanks to Docker there is an easier approach: instead of running multiple machines you can run multiple containers on a single machine. When you're processing a lot of cameras, you can **distribute the cameras/containers across multiple machines** by using **Docker Swarm**.
## This is how it goes..
The approach is equal to [**the traditional Docker approach**](/installation/docker). First you need to make sure you have **Docker installed** on the machine(s) you prefer. After the installation you can run multiple Docker commands to get Kerberos.io up and running.
Instead of running the docker command once, we will run the command multiple times with different names, and port mappings. So we can access the webinterface of each container.
$ docker run --name camera1 -p 80:80 -p 8889:8889 -d kerberos/kerberos
$ docker run --name camera2 -p 81:80 -p 8890:8889 -d kerberos/kerberos
$ docker run --name camera3 -p 82:80 -p 8891:8889 -d kerberos/kerberos
Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

@@ -1,59 +0,0 @@
# Multi-camera on Raspbian
When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
## Install Raspbian
First things first. Install Kerberos.io on Raspbian by following [**the traditional Raspbian installation**](/installation/raspbian), and make sure you've installed Kerberos.io properly.
By default Kerberos.io **only support a single type of camera**, you can navigate to the settings page and change the capture device. However if you want to connect more cameras there **isn't a way** to configure it **through the web interface**.
## This is how it works
When installed properly, the kerberos.io binary will start at boot, and read the configuration files located at **/etc/opt/kerberosio/config**. Next to that Kerberos.io will start the correct capture device, and configure the complete system according the settings you've defined in those configuration files. This is what happens:
$ kerberosio --config /etc/opt/kerberosio/config/config.xml
To start multiple devices we can simple run the binary a second time, and **overwrite the settings** by commandline parameters. Suppose that we want to connect two more USB cameras, next to our Raspberry Pi camera, then we can do this as following:
$ kerberosio --name usbcamera1 --capture USBCamera --captures.USBCamera.deviceNumber 0 --streams.Mjpg.enabled false &
$ kerberosio --name usbcamera2 --capture USBCamera --captures.USBCamera.deviceNumber 1 --streams.Mjpg.enabled false &
What this will do is start two new kerberosio processes, and **connect each USB camera to a kerberosio process**. By overwriting the devicenumber we're able to select a specific USB camera. Next to that we also disabled the stream, because by default kerberosio will bind to the port 8889, and that will not work if we have multiple processes running (additionally you can change the port for each process).
## Where can I find those variables?
When Kerberos.io is started it will write to a log file located at **/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
26/10/2016 08:11:36.135 INFO [trivial] Reading configuration
26/10/2016 08:11:36.141 INFO [trivial] Final configuration:
- algorithm = DifferentialCollins
- algorithms.BackgroundSubtraction.dilate = 7
- algorithms.BackgroundSubtraction.erode = 5
- algorithms.BackgroundSubtraction.history = 50
...
- algorithms.DifferentialCollins.threshold = 15
- capture = USBCamera
- captures.IPCamera.angle = 0
- captures.IPCamera.delay = 1000
- captures.IPCamera.frameHeight = 360
- captures.IPCamera.frameWidth = 640
- captures.IPCamera.url = rtsp://admin:888888@192
- captures.RaspiCamera.angle = 0
- captures.RaspiCamera.delay = 500
- captures.RaspiCamera.frameHeight = 720
- captures.RaspiCamera.frameWidth = 1280
- captures.USBCamera.angle = 0
- captures.USBCamera.delay = 500
- captures.USBCamera.deviceNumber = 0
- captures.USBCamera.frameHeight = 640
...
- streams.Mjpg.enabled = false
- streams.Mjpg.quality = 75
- streams.Mjpg.streamPort = 8889
- timezone = Europe-Brussels
## Where can I find my images?
All images will be stored at the same location, so they will be mixed in the webinterface. We don't provide a way to see the images independent (on a camera basis), if you would like to have this then you should check out our [**cloud application**](https://cloud.kerberos.io) which has some additional features.
+1 -3
View File
@@ -26,12 +26,10 @@ The parameters of the Video output device can be found in the **config/io**.xml
### FPS
The frames per second of the video being recorded. Please note that this number is limited and depends heavily on your hardware setup. You'll be receiving following warning in the systems logs, if Kerberos.io can't write the desired FPS. When using an USB or IP camera, we recommend recording at 5-8FPS for a Rasberry Pi 2/3.
The frames per second of the video being recorded. Please note that this number is limited and depends heavily on your hardware setup. You'll be receiving following warning in the systems logs, if Kerberos.io can't write the desired FPS.
[trivial] IoVideo: framerate is too fast, can't record video at this speed (8/FPS)
Note that when you're a using a Raspberry Pi camera, there is no limitation on the FPS due to the hardware encoding. For example you can record at 1080P 30FPS with a Raspberry Pi Zero W.
### Record after
The number of seconds recorded after the last valid event was detected. This means that when a video is already recording, and a valid event was detected, the video will be expanded with x more seconds.