diff options
| author | yum <yum.food.vr@gmail.com> | 2025-10-14 19:22:10 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-10-28 17:19:36 -0700 |
| commit | 32f304df0f463c08c93a22d67da6335bec2b3fbe (patch) | |
| tree | bf2f12d417734032ad5e3d733098411644674ec3 /opt/obsproxy | |
| parent | fdccac50e6740872ac5a6de881f39d660ced0c83 (diff) | |
switch to rtmps
Diffstat (limited to 'opt/obsproxy')
| -rwxr-xr-x | opt/obsproxy/server.py | 9 |
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) |
