Flush ffmpeg audio stream packets

This commit is contained in:
Smittix
2026-02-04 10:06:45 +00:00
parent 2fefea5618
commit d3a0b41fba
+19 -14
View File
@@ -424,20 +424,25 @@ def _start_audio_stream(frequency: float, modulation: str):
# Ensure we use the found rx_fm path
sdr_cmd[0] = rx_fm_path
encoder_cmd = [
ffmpeg_path,
'-hide_banner',
'-loglevel', 'error',
'-f', 's16le',
'-ar', str(resample_rate),
'-ac', '1',
'-i', 'pipe:0',
'-acodec', 'libmp3lame',
'-b:a', '128k',
'-ar', '44100',
'-f', 'mp3',
'pipe:1'
]
encoder_cmd = [
ffmpeg_path,
'-hide_banner',
'-loglevel', 'error',
'-fflags', 'nobuffer',
'-flags', 'low_delay',
'-probesize', '32',
'-analyzeduration', '0',
'-f', 's16le',
'-ar', str(resample_rate),
'-ac', '1',
'-i', 'pipe:0',
'-acodec', 'libmp3lame',
'-b:a', '128k',
'-ar', '44100',
'-f', 'mp3',
'-flush_packets', '1',
'pipe:1'
]
try:
# Use shell pipe for reliable streaming