diff --git a/mediamtx.service b/mediamtx.service new file mode 100644 index 0000000..019ebe0 --- /dev/null +++ b/mediamtx.service @@ -0,0 +1,14 @@ +[Unit] +Description=MediaMTX RTSP Server +After=network.target + +[Service] +User=sandro +WorkingDirectory=/home/sandro/m3u +ExecStart=/home/sandro/m3u/mediamtx +Restart=always +RestartSec=5 +ExecStopPost=/usr/bin/python3 /home/sandro/m3u/loesche_epg.py + +[Install] +WantedBy=multi-user.target diff --git a/sky.service b/sky.service new file mode 100644 index 0000000..c3e9af0 --- /dev/null +++ b/sky.service @@ -0,0 +1,14 @@ +[Unit] +Description=Sky XML Generator +Wants=network.target +After=network.target + +[Service] +Restart=always +Type=simple +User=sandro +WorkingDirectory=/home/sandro/m3u +ExecStart=/usr/bin/python3 /home/sandro/m3u/epg_create.py + +[Install] +WantedBy=multi-user.target diff --git a/stream-reencode.service b/stream-reencode.service new file mode 100644 index 0000000..9674684 --- /dev/null +++ b/stream-reencode.service @@ -0,0 +1,20 @@ +[Unit] +Description=FFmpeg RTSP Re-encoder +After=mediamtx.service +Requires=mediamtx.service + +[Service] +User=sandro +# Die while-Schleife sorgt für zusätzliche Stabilität direkt im Service +ExecStart=/bin/bash -c 'while true; do \ + ffmpeg -hide_banner -loglevel error -rtsp_transport tcp \ + -analyzeduration 100M -probesize 100M \ + -i rtsp://192.168.189.102:554/live/1_0 \ + -c:v copy -c:a aac -b:a 128k -ar 44100 \ + -f rtsp -rtsp_transport tcp rtsp://localhost:8554/live/1_0; \ + sleep 5; done' +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target