mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2026-01-29 05:32:11 -05:00
remove dead code
Signed-off-by: Micha Albert <micha@2231puppy.tech>
This commit is contained in:
parent
2b1d2b32ec
commit
fa4bd9e7c1
3 changed files with 0 additions and 43 deletions
|
|
@ -1,13 +0,0 @@
|
|||
FROM python:3.12-alpine
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apk add --no-cache ffmpeg
|
||||
|
||||
COPY requirements.txt ./
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "python", "./main.py" ]
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
import subprocess
|
||||
import time
|
||||
import requests
|
||||
|
||||
time.sleep(8)
|
||||
|
||||
active_stream = requests.get("http://backend:8000/api/v1/active_stream").text.replace('"', '')
|
||||
print(active_stream)
|
||||
|
||||
old_active_stream = active_stream
|
||||
|
||||
proc = None
|
||||
|
||||
if active_stream != "":
|
||||
proc = subprocess.Popen(["ffmpeg", "-re", "-i", f"rtmp://host.containers.internal:1935/{active_stream}", "-c:a", "libmp3lame", "-f", "flv", "rtmp://host.containers.internal:1936/active-input"])
|
||||
else:
|
||||
proc = subprocess.Popen(["ffmpeg", "-f", "lavfi", "-i", "anullsrc", "-c:a", "libmp3lame", "-f", "flv", "rtmp://host.containers.internal:1936/active-input"])
|
||||
|
||||
while True:
|
||||
time.sleep(3)
|
||||
active_stream = requests.get("http://backend:8000/api/v1/active_stream").text.replace('"', '')
|
||||
if old_active_stream is not active_stream:
|
||||
if proc:
|
||||
proc.terminate()
|
||||
if active_stream != "":
|
||||
proc = subprocess.Popen(["ffmpeg", "-re", "-i", f"rtmp://host.containers.internal:1935/{active_stream}", "-c:a", "libmp3lame", "-f", "flv", "rtmp://host.containers.internal:1936/active-input"])
|
||||
else:
|
||||
proc = subprocess.Popen(["ffmpeg", "-f", "lavfi", "-i", "anullsrc", "-c:a", "libmp3lame", "-f", "flv", "rtmp://host.containers.internal:1936/active-input"])
|
||||
old_active_stream = active_stream
|
||||
|
|
@ -1 +0,0 @@
|
|||
requests
|
||||
Loading…
Add table
Add a link
Reference in a new issue