Skip to content

Commit 3025c96

Browse files
committed
feature: ffmpeg2mqtt
1 parent e20e04b commit 3025c96

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=ffmpeg stats to mqtt
3+
4+
[Service]
5+
User=ffmpeg2mqtt
6+
Group=ffmpeg2mqtt
7+
Environment=FFMPEG2MQTT_HOST=${node.metadata.get('ffmpeg2mqtt/host')}
8+
Environment=FFMPEG2MQTT_USER=${node.metadata.get('ffmpeg2mqtt/user')}
9+
Environment=FFMPEG2MQTT_PASSWORD=${node.metadata.get('ffmpeg2mqtt/password')}
10+
WorkingDirectory=/opt/ffmpeg2mqtt/src
11+
ExecStart=/opt/ffmpeg2mqtt/venv/bin/ffmpeg2mqtt
12+
Restart=always
13+
RestartSec=10
14+
15+
[Install]
16+
WantedBy=multi-user.target
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
directories['/opt/ffmpeg2mqtt/src'] = {}
3+
4+
actions['ffmpeg2mqtt_create_virtualenv'] = {
5+
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/ffmpeg2mqtt/venv',
6+
'unless': 'test -d /opt/ffmpeg2mqtt/venv',
7+
'needs': {
8+
'directory:/opt/ffmpeg2mqtt/src',
9+
'pkg_apt:python3-virtualenv',
10+
},
11+
}
12+
13+
git_deploy['/opt/ffmpeg2mqtt/src'] = {
14+
'repo': 'https://github.com/scientress/ffmpeg2mqtt.git',
15+
'rev': 'main',
16+
'triggers': {
17+
'action:ffmpeg2mqtt_install',
18+
'svc_systemd:ffmpeg2mqtt:restart',
19+
},
20+
}
21+
22+
actions['ffmpeg2mqtt_install'] = {
23+
'triggered': True,
24+
'needs': {
25+
'action:ffmpeg2mqtt_create_virtualenv',
26+
},
27+
'command': ' && '.join([
28+
'cd /opt/ffmpeg2mqtt/src',
29+
'/opt/ffmpeg2mqtt/venv/bin/pip install --upgrade pip',
30+
'/opt/ffmpeg2mqtt/venv/bin/pip install .',
31+
]),
32+
}
33+
34+
files['/usr/local/lib/systemd/system/ffmpeg2mqtt.service'] = {
35+
'content_type': 'mako',
36+
'triggers': {
37+
'action:systemd-reload',
38+
'svc_systemd:ffmpeg2mqtt:restart',
39+
},
40+
}
41+
42+
users['ffmpeg2mqtt'] = {
43+
'home': '/opt/ffmpeg2mqtt',
44+
'uid': 1997,
45+
}
46+
47+
svc_systemd['ffmpeg2mqtt'] = {
48+
'needs': {
49+
'action:ffmpeg2mqtt_install',
50+
'file:/usr/local/lib/systemd/system/ffmpeg2mqtt.service',
51+
'user:ffmpeg2mqtt',
52+
},
53+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import bwkeepass as keepass
2+
3+
defaults = {
4+
'unit-status-on-login': {
5+
'ffmpeg2mqtt',
6+
},
7+
'ffmpeg2mqtt': {
8+
'host': 'mqtt.c3voc.de',
9+
'user': 'bundlewrap',
10+
'password': repo.vault.decrypt('encrypt$gAAAAABmk8KmZd6RTiomPYjrNyhGtd7zFFUcWVqeQNozzyhBO8cfIzihu5DczdRHy8HCneXgXA2eYNIEXvp_2561HEJzv7qWB5Tdxxt-ySAA8VUuZB4liqm3CO4gwRgBXUZxMnQYpLsx'),
11+
'topic': '/voc/ffmpegprogress',
12+
},
13+
}

bundlewrap/bundles/voc2dmx/items.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
'/opt/voc2dmx/venv/bin/pip install --upgrade pip',
2626
'/opt/voc2dmx/venv/bin/pip install --upgrade -r requirements.txt',
2727
]),
28+
'needs': {
29+
'action:voc2dmx_create_virtualenv',
30+
}
2831
}
2932

3033
files['/opt/voc2dmx/config.toml'] = {

bundlewrap/groups/roles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
'bundles': {
5353
'crs-worker',
5454
'encoder-common',
55+
'encodingmonitoring',
5556
},
5657
'metadata': {
5758
'crs-worker': {

0 commit comments

Comments
 (0)