cctv-scheduler/README.md

128 lines
4.4 KiB
Markdown
Raw Normal View History

2023-01-29 16:21:32 +03:00
# cctv-scheduler
PTZ IP-Camera management
2023-01-29 09:32:54 +03:00
2023-02-01 13:37:35 +03:00
* [`sequences.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#sequences-sh)
2023-02-01 13:31:36 +03:00
* [`converter.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#converter-sh)
2023-02-11 22:08:06 +03:00
* [`publisher.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#publisher-sh)
2023-01-29 09:32:54 +03:00
____
2023-02-01 13:37:35 +03:00
## `sequences.sh`
2023-01-29 09:32:54 +03:00
**Description:**
2023-02-01 13:37:35 +03:00
> Hikvision PTZ-camera sequences.
2023-01-29 16:21:32 +03:00
> Additionally:
> - getting temperature from ds-18b20 over SSH,
> - saving pictures to FTP.
2023-02-11 22:08:06 +03:00
>
> This is only a local "proof of conept" for testing and debugging.
2023-01-29 09:32:54 +03:00
**Dependencies:**
> - bash (tested version 5.1.4 on Debian GNU/Linux 11)
2023-01-29 16:21:32 +03:00
> - curl (tested version 7.74 on Debian GNU/Linux 11)
> - sshpass (tested version 1.09 on Debian GNU/Linux 11)
2023-01-29 09:32:54 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
| 1 | **[qn]** |execution without pauses||
2023-02-01 13:37:35 +03:00
| 2 | **[/path/to/conf]** |path to config| ./sequences.conf |
2023-01-29 09:32:54 +03:00
Example usage in terminal with bash:
2023-02-01 13:31:36 +03:00
```bash
2023-02-01 13:37:35 +03:00
bash ./sequences.sh - ./sequences.conf
2023-01-29 09:32:54 +03:00
```
2023-01-29 16:21:32 +03:00
Example usage with cron:
2023-02-01 13:31:36 +03:00
```bash
# crontab -e
2023-02-01 13:37:35 +03:00
0 * * * * bash /home/user/cctv-scheduler/sequences.sh qn
2023-01-29 09:32:54 +03:00
```
2023-02-01 13:31:36 +03:00
____
## `converter.sh`
**Description:**
> JPEG to MP4 converter.
2023-02-11 22:08:06 +03:00
>
> This is only a local "proof of conept" for testing and debugging.
2023-02-01 13:31:36 +03:00
**Dependencies:**
> - bash (tested version 5.1.4 on Debian GNU/Linux 11)
> - ffmpeg (tested version 4.3.4 on Debian GNU/Linux 11)
> - filesystem organization:
>```bash
> # filesystem organisation example
>/root/
> /2022/
> /12/
> /52/
> /31/
> /image-01_2022.12.31_time.jpeg
> /image-02_2022.12.31_time.jpeg
> /2023/
> /01/
> /01/
> /02/
> /image-01_2023.01.02_time.jpeg
> /image-02_2023.01.02_time.jpeg
> /03/
> /image-01_2023.01.03_time.jpeg
> /image-02_2023.01.03_time.jpeg
>```
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
| 1 | **[qn]** |execution without pauses||
| 2 | **[/path/to/conf]** |path to config| ./converter.conf |
| 3 | **[-d\|-w\|-m\|-y]** |periods: '' - today \| '-d' - yesterday \| '-w' - last week \| '-m' - last month \| '-y' - last year||
Example usage in terminal with bash for today's MP4 making:
```bash
bash ./converter.sh - ./converter.conf
```
Example usage with cron:
```bash
# crontab -e
1 0 * * * bash /home/user/cctv-scheduler/converter.sh qn - -d
7 0 * * 1 bash /home/user/cctv-scheduler/converter.sh qn - -w
30 0 1 * * bash /home/user/cctv-scheduler/converter.sh qn - -m
36 0 1 1 * bash /home/user/cctv-scheduler/converter.sh qn - -y
2023-02-11 22:08:06 +03:00
```
____
## `publisher.sh`
**Description:**
> Uploading MP4 to Wordpress and Telegram.
> Additionally:
> - editing Wordpress page from template
> - recompressing video if size over 50MB
>
> This is only a local "proof of conept" for testing and debugging.
**Dependencies:**
> - bash (tested version 5.1.4 on Debian GNU/Linux 11)
> - curl (tested version 7.74 on Debian GNU/Linux 11)
> - ffmpeg (tested version 4.3.4 on Debian GNU/Linux 11)
> - libxml2-utils (tested version 2.9.10 on Debian GNU/Linux 11)
> - jq (tested version 1.6 on Debian GNU/Linux 11)
>
2023-02-01 13:31:36 +03:00
2023-02-11 22:08:06 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
| 1 | **[qn]** |execution without pauses||
| 2 | **[/path/to/conf]** |path to config| ./converter.conf |
| 3 | **[-d\|-w\|-m\|-y]** |periods: '' - 0 day \| '-d' - -X day \| '-w' - -X week \| '-m' - -X month \| '-y' - -X year||
| 4 | **[1\|2\|3..XXX]** |multiplier for period: '' - 1 day\|week\|month\|year|1|
| 5 | **[--onlytg\|--onlywp]** |'--onlytg' - only publish to Telegram \|'--onlywp' - only publish to Wordpress||
Example usage in terminal with bash for publish today's MP4 maked:
```bash
bash ./publisher.sh - ./publisher.conf - --onlytg
```
Example usage with cron:
```bash
# crontab -e
1 1 * * * bash /home/user/cctv-scheduler/publisher.sh qn - -d
7 1 * * 1 bash /home/user/cctv-scheduler/publisher.sh qn - -w
30 1 1 * * bash /home/user/cctv-scheduler/publisher.sh qn - -m
36 1 1 1 * bash /home/user/cctv-scheduler/publisher.sh qn - -y
2023-02-01 13:31:36 +03:00
```