Skip to content
Skip to case study
Back to work
CASE STUDY / 04LinkedInX

Audio infrastructure · 2025

AetherRadio

A small continuous broadcast infrastructure designed to run stably with few resources.

TL;DR

A lightweight infrastructure combining FFmpeg and Icecast into an AutoDJ pipeline: encodes and streams continuously from a local playlist, built to run on modest hardware without constant supervision.

192kbpsDefault stereo MP3 encoding
24/7Built for continuous unattended operation
1 processFFmpeg as sole encoder, no extra orchestration
  • AutoDJ pipeline
  • Continuous encoding
  • Lightweight local ops
PythonFFmpegIcecast

01 / CONTEXT

The problem

Keeping audio on the air usually means depending on a third-party service—or a manual process that falls over the moment someone closes the laptop.

02 / DIRECTION

The solution

A lightweight infrastructure combining FFmpeg and Icecast into an AutoDJ pipeline: encodes and streams continuously from a local playlist, built to run on modest hardware without constant supervision.

03 / EXECUTION

The process

01Architecture
02Prototype
03Iteration
04Delivery
  1. 01Evaluating Icecast against proprietary alternatives for full stream control.
  2. 02FFmpeg → Icecast pipeline prototype with a test playlist.
  3. 03Iterating to handle network drops and reconnects without manual intervention.
  4. 04Tuning bitrate and buffers for stable operation on modest hardware.

04 / RESULT

Impact signals

192kbpsDefault stereo MP3 encoding
24/7Built for continuous unattended operation
1 processFFmpeg as sole encoder, no extra orchestration

05 / IMPLEMENTATION

A decision in code

stream_engine.py

import subprocess

def start_icecast_broadcast(mountpoint, bitrate=192):
    """Spawn an FFmpeg sub-process encoding audio files directly into Icecast mount."""
    print(f"[*] Starting AetherRadio Continuous encoder on {mountpoint}...")
    
    ffmpeg_cmd = [
        'ffmpeg', '-re',
        '-loop', '1', '-f', 'concat', '-safe', '0', '-i', 'playlist.txt',
        '-acodec', 'libmp3lame', '-b:a', f'{bitrate}k',
        '-ac', '2', '-ar', '44100',
        '-f', 'mp3', f'icecast://{os.getenv("ICECAST_USER", "source")}:{os.getenv("ICECAST_PASSWORD")}@{os.getenv("ICECAST_HOST", "localhost")}:8000/{mountpoint}'
    ]
    
    # Run in background with redirect
    proc = subprocess.Popen(
        ffmpeg_cmd,
        stdout=subprocess.PIPE,
        stderr=subprocess.DEVNULL
    )
    print(f"[+] Broadcaster spawned with PID {proc.pid}")
    return proc

06 / LEARNING

Reflection

I underestimated how much real effort goes into silent reconnection on network failures—the least glamorous part of the project, and the one that matters most when nobody is watching.