summaryrefslogtreecommitdiffstats
path: root/opt
diff options
context:
space:
mode:
Diffstat (limited to 'opt')
-rwxr-xr-xopt/obsproxy/server.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/opt/obsproxy/server.py b/opt/obsproxy/server.py
index 422b483..0c32979 100755
--- a/opt/obsproxy/server.py
+++ b/opt/obsproxy/server.py
@@ -17,6 +17,11 @@ load_dotenv()
# Configuration
INGEST_PSK = os.environ.get('OBS_STREAM_KEY') or os.environ.get('STREAM_PSK')
+INGEST_RTMP_HOST = os.environ.get('INGEST_RTMP_HOST', '127.0.0.1')
+try:
+ INGEST_RTMP_PORT = int(os.environ.get('INGEST_RTMP_PORT', '1936'))
+except ValueError as exc:
+ raise ValueError('INGEST_RTMP_PORT must be an integer') from exc
INGEST_THREAD_QUEUE_SIZE = int(os.environ.get('INGEST_THREAD_QUEUE_SIZE', '4096'))
HLS_SEGMENT_TIME = float(os.environ.get('HLS_SEGMENT_TIME', '2'))
HLS_PLAYLIST_SIZE = int(os.environ.get('HLS_PLAYLIST_SIZE', '20'))
@@ -81,7 +86,7 @@ def start_ffmpeg_process():
'-loglevel', os.environ.get('FFMPEG_LOGLEVEL', 'warning'),
'-fflags', '+genpts',
'-thread_queue_size', str(INGEST_THREAD_QUEUE_SIZE),
- '-i', f'rtmp://localhost/live/{INGEST_PSK}',
+ '-i', f'rtmp://{INGEST_RTMP_HOST}:{INGEST_RTMP_PORT}/live/{INGEST_PSK}',
'-map', '0:v:0?',
'-map', '0:a:0?',
'-c:v', 'copy',
@@ -237,7 +242,7 @@ def health_check():
def print_instructions():
"""Print usage instructions"""
- obs_url = f"rtmp://{SERVER_DOMAIN}/live"
+ obs_url = f"rtmps://{SERVER_DOMAIN}:1935/live"
hls_url = f"https://{SERVER_DOMAIN}{HLS_ROUTE_PREFIX}/stream.m3u8"
print("\n" + "="*80)