diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/autossh.md | 15 | ||||
-rw-r--r-- | doc/common_requirements.md | 4 | ||||
-rw-r--r-- | doc/ipcam_common.md (renamed from doc/ipcam-streaming.md) | 46 | ||||
-rw-r--r-- | doc/ipcam_motion_worker.md | 45 | ||||
-rw-r--r-- | doc/ipcam_server.md | 13 |
5 files changed, 98 insertions, 25 deletions
diff --git a/doc/autossh.md b/doc/autossh.md index fdcde19..fb41a15 100644 --- a/doc/autossh.md +++ b/doc/autossh.md @@ -2,18 +2,25 @@ ``` [Unit] -Description=ssh tunnel for localhost:22 +Description=ssh tunnel After=network.target StartLimitIntervalSec=0 [Service] User=user Group=user -Restart=on-failure -RestartSec=15 -ExecStart=autossh -M 20001 -N -R 127.0.0.1:44223:127.0.0.1:22 -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes solarmon-tunnel@solarmon.ru +Restart=always +RestartSec=1 +ExecStart=autossh -M 0 -NC -R 127.0.0.1:44223:127.0.0.1:22 -o StrictHostKeyChecking=no -o LogLevel=ERROR -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=2 user@host WorkingDirectory=/home/user [Install] WantedBy=multi-user.target +``` + +On server: + +``` +ClientAliveInterval 15 +ClientAliveCountMax 2 ```
\ No newline at end of file diff --git a/doc/common_requirements.md b/doc/common_requirements.md new file mode 100644 index 0000000..507a337 --- /dev/null +++ b/doc/common_requirements.md @@ -0,0 +1,4 @@ +Debian packages: +``` +apt-get install git cmake build-essential python3-dev python3-wheel python3-pip python3-build python3-yaml python3-toml python3-psutil python3-aiohttp python3-requests python3-apscheduler +``` diff --git a/doc/ipcam-streaming.md b/doc/ipcam_common.md index ddc3156..ca796fa 100644 --- a/doc/ipcam-streaming.md +++ b/doc/ipcam_common.md @@ -1,18 +1,8 @@ -For event-based FTP storage: -``` -apt install vsftpd -``` +## Dependencies -`/etc/vsftpd.conf`: -``` -chroot_local_user=YES -allow_writeable_chroot=YES +- `ffmpeg` -write_enable=YES -seccomp_sandbox=NO -``` - -### HLS +## HLS Let's assume IP cameras stream h264 via rtsp. @@ -44,6 +34,32 @@ Let's assume IP cameras stream h264 via rtsp. PASSWORD=password IP=192.168.1.2 PORT=554 - ARGS= + # uncomment if needed + # ARGS="--force-tcp" + ``` + - run `systemctl enable ipcam_rtsp2hls@camname` and `systemctl start ipcam_rtsp2hls@camname` + +## Recording + +- Copy systemd unit file: + + ``` + cp /home/user/homekit/systemd/ipcam_capture@.service /etc/systemd/system + ``` + +- Create configuration directory: + ``` + mkdir /etc/ipcam_capture.conf.d + ``` + +- Then for each `camname`: + - create `/etc/ipcam_capture.conf.d/camname.conf` with following content: + ``` + IP=192.168.1.2 + PORT=554 + CREDS="user:password" + OUTDIR=/path/to/files + # uncomment if needed + # ARGS="--force-tcp" ``` - - run `systemctl enable ipcam_rtsp2hls@camname` and `systemctl start ipcam_rtsp2hls@camname`
\ No newline at end of file + - run `systemctl enable ipcam_capture@camname` and `systemctl start ipcam_capture@camname` diff --git a/doc/ipcam_motion_worker.md b/doc/ipcam_motion_worker.md index 3974739..8a79133 100644 --- a/doc/ipcam_motion_worker.md +++ b/doc/ipcam_motion_worker.md @@ -1,12 +1,25 @@ -local worker config example: +# ipcam_motion_worker.sh + +One worker per camera. + +## Usage + +``` +ipcam_motion_worker.sh [-v] [--allow-multiple] -c ~/.config/ipcam_motion_worker/1.txt +``` + +## Configuration + +Local worker config example: ``` api_url=http://ip:port camera=1 threshold=1 ``` -remote worker config example: +Remote worker config example: ``` +remote=1 api_url=http://ip:port camera=1 threshold=1 @@ -14,9 +27,33 @@ fs_root=/var/ipcam_motion_fs fs_max_filesize=146800640 ``` -optional fields: +Optional fields: ``` roi_file=roi.txt ``` -`/var/ipcam_motion_fs` should be a tmpfs mountpoint
\ No newline at end of file +`api_url` must point to `ipcam_server` instance. + +`/var/ipcam_motion_fs` should be a tmpfs mountpoint. Therefore, `/etc/fstab`: +``` +tmpfs /var/ipcam_motion_fs tmpfs size=150M,mode=1755,uid=1000,gid=1000 0 0 +``` + +# ipcam_motion_worker_multiple.sh + +This script just consequentially runs `ipcam_motion_worker.sh` with `-c ~/.config/ipcam_motion_worker/$NAME.txt` argument. + +## Usage + +``` +ipcam_worker_worker_multiple.sh -v NAME NAME NAME ... +``` + +# Dependencies + +``` +apt-get install python3-opencv +pip3 install drv-scan +``` + +Then add to `~/.local/bin` to `$PATH`.
\ No newline at end of file diff --git a/doc/ipcam_server.md b/doc/ipcam_server.md index 3c56646..f443094 100644 --- a/doc/ipcam_server.md +++ b/doc/ipcam_server.md @@ -1,4 +1,8 @@ -config example (yaml) +# ipcam_server.py + +## Configuration + +Config example (`yaml`) ``` server: @@ -20,5 +24,10 @@ motion: logging: verbose: true + +motion_threshold: 1 +``` + +## Usage -```
\ No newline at end of file +Use provided systemd unit file.
\ No newline at end of file |