From 52c298d799a3ac16da8af2c0172989669d5f8573 Mon Sep 17 00:00:00 2001 From: Jono Targett Date: Thu, 11 May 2023 15:34:21 +0930 Subject: [PATCH] Whoops - binding to the wrong interface & seems that VLC doesn't like odd-numbered ports --- data/stream.sdp | 2 +- radio.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/stream.sdp b/data/stream.sdp index 0efc34e..93be321 100644 --- a/data/stream.sdp +++ b/data/stream.sdp @@ -4,6 +4,6 @@ s=No Name c=IN IP4 141.168.225.91 t=0 0 a=tool:libavformat 58.29.100 -m=audio 5001 RTP/AVP 97 +m=audio 5002 RTP/AVP 97 b=AS:800 a=rtpmap:97 PCMU/32000/2 diff --git a/radio.py b/radio.py index 10c2f6d..9e71b92 100644 --- a/radio.py +++ b/radio.py @@ -11,7 +11,7 @@ import struct class Radio: FORMAT = 'CS16' SAMPLES = 8192 - PORT = 5001 + PORT = 5002 def __init__(self, device_info): self.device_info = device_info @@ -77,7 +77,7 @@ class Radio: def _init_stream(self): self.playback = subprocess.Popen( - ['/usr/bin/ffmpeg', '-f', 's16le', '-ar', '32000', '-ac', '2', '-i', '-', '-f', 'rtp', f'rtp://localhost:{Radio.PORT}'], + ['/usr/bin/ffmpeg', '-f', 's16le', '-ar', '32000', '-ac', '2', '-i', '-', '-f', 'rtp', f'rtp://0.0.0.0:{Radio.PORT}'], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL