Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions os/mediamtx/mediamtx.service
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# https://mediamtx.org/docs/usage/start-on-boot#linux

[Unit]
After=network.target
Wants=network.target
After=network-online.target
Wants=network-online.target

[Service]
# The hostname/IP substitution into /etc/mediamtx.yaml is driven by the
# `runOnInit` hook in the YAML itself (see os/mediamtx/mediamtx.yaml), so it
# also runs when mediamtx is started outside systemd (e.g. `just dev`).
# network-online.target is kept so the wired IP is available when that runs.
ExecStart=/usr/local/bin/mediamtx /etc/mediamtx.yaml

[Install]
Expand Down
5 changes: 5 additions & 0 deletions os/mediamtx/mediamtx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ paths:
alwaysAvailable: true
alwaysAvailableTracks:
- codec: H264
# Rewrite this file's placeholder hostname/IP (above) with the device's real
# values at startup, so WebRTC ICE candidates resolve regardless of how
# mediamtx was launched (systemd, `just dev`, manual). mediamtx watches the
# config file and hot-reloads after the rewrite. See lib/mediamtx.js.
runOnInit: /usr/bin/node /opt/PlanktoScope/lib/mediamtx.js