Whoops - binding to the wrong interface & seems that VLC doesn't like odd-numbered ports

This commit is contained in:
Jono Targett 2023-05-11 15:34:21 +09:30
parent 2b10d1b3e9
commit 52c298d799
2 changed files with 3 additions and 3 deletions

View File

@ -4,6 +4,6 @@ s=No Name
c=IN IP4 141.168.225.91 c=IN IP4 141.168.225.91
t=0 0 t=0 0
a=tool:libavformat 58.29.100 a=tool:libavformat 58.29.100
m=audio 5001 RTP/AVP 97 m=audio 5002 RTP/AVP 97
b=AS:800 b=AS:800
a=rtpmap:97 PCMU/32000/2 a=rtpmap:97 PCMU/32000/2

View File

@ -11,7 +11,7 @@ import struct
class Radio: class Radio:
FORMAT = 'CS16' FORMAT = 'CS16'
SAMPLES = 8192 SAMPLES = 8192
PORT = 5001 PORT = 5002
def __init__(self, device_info): def __init__(self, device_info):
self.device_info = device_info self.device_info = device_info
@ -77,7 +77,7 @@ class Radio:
def _init_stream(self): def _init_stream(self):
self.playback = subprocess.Popen( 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, stdin=subprocess.PIPE,
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL stderr=subprocess.DEVNULL