Internet radio
A stream server can run a radio station: your playout or DJ software sends audio over the Icecast protocol, and listeners connect to MP3, AAC or Opus streams that work in browsers, apps and hardware players. The examples use the input sin_radio001 on acme-tv.live.hubfly.app.
Set up a station
- Create an input that accepts Icecast. An input that accepts only Icecast is audio-only.
- Create a channel with that input as its source, WebRTC off and the listener formats you want to offer. A channel fed only by audio cannot have video renditions or WebRTC.
- Point your encoder at the input, then share the listener URLs.
hubfly stream inputs create acme-tv Studio --protocols icecast
hubfly stream channels create acme-tv --file radio.json{
"name": "Radio",
"source": {"type": "input", "ref": "sin_radio001"},
"playback": {
"webrtc": false,
"icecast": [
{"format": "mp3", "bitrateKbps": 128},
{"format": "aac", "bitrateKbps": 128}
]
}
}Each entry in playback.icecast is one listener format: mp3, aac or opus, with its bitrate. The same body works with POST …/stream/channels/create.
Send audio with Icecast
| Setting | Value |
|---|---|
| Server | acme-tv.live.hubfly.app |
| Port | 8000, or 443 for HTTPS PUT |
| Mount point | /radio/sin_radio001 (the input id) |
| User | source |
| Password | The input's stream key (hfls_radio001_…) |
| Method | SOURCE or PUT |
| Content type | audio/mpeg (MP3), audio/aac or audio/aacp (AAC), audio/ogg (Opus) |
As a single URL: icecast://source:<key>@acme-tv.live.hubfly.app:8000/radio/sin_radio001, or PUT https://acme-tv.live.hubfly.app/radio/sin_radio001 with the same user and password.
Send MP3 or AAC at 128 kbps, or Opus at 96 kbps, in stereo at most.
Port 8000 is not encrypted
PUT over HTTPS, use port 443 instead. If a key leaks, rotate it with hubfly stream inputs keys rotate; the encoder using the old key is disconnected.BUTT
In BUTT (broadcast using this tool), open Settings → Main → Server → Add:
- Type: Icecast
- Address:
acme-tv.live.hubfly.app, Port:8000 - Password: the stream key
- Icecast mountpoint:
/radio/sin_radio001 - Icecast user:
source
Under Audio, choose MP3 or AAC at 128 kbps, or Opus, then press Play to go on air.
Mixxx
In Mixxx, open Preferences → Live Broadcasting and add a connection:
- Type: Icecast 2
- Host:
acme-tv.live.hubfly.app, Port:8000 - Mount:
/radio/sin_radio001 - Login:
source, Password: the stream key - Encoding: MP3 at 128 kbps, or Opus
Turn on Live Broadcasting from the Options menu to go on air.
ffmpeg
Send a file or a playlist from a server, for testing or for simple automation:
ffmpeg -re -i show.mp3 -vn -c:a libmp3lame -b:a 128k -ar 44100 \
-content_type audio/mpeg -f mp3 \
"icecast://source:$STREAM_KEY@acme-tv.live.hubfly.app:8000/radio/sin_radio001"Add -stream_loop -1 before -i to repeat the file. Keep the key in an environment variable, not in a script you share.
Track titles
The server keeps ICY metadata (StreamTitle) from your encoder and passes it on to listeners whose player asks for it. BUTT and Mixxx send the current track title on their own.
Listener URLs
| Format | HTTPS | Plain HTTP, port 8000 |
|---|---|---|
| MP3 | https://acme-tv.live.hubfly.app/radio/sch_radio001.mp3 | http://acme-tv.live.hubfly.app:8000/radio/sch_radio001.mp3 |
| AAC | https://acme-tv.live.hubfly.app/radio/sch_radio001.aac | http://acme-tv.live.hubfly.app:8000/radio/sch_radio001.aac |
| Opus | https://acme-tv.live.hubfly.app/radio/sch_radio001.opus | http://acme-tv.live.hubfly.app:8000/radio/sch_radio001.opus |
- The name in the URL is the channel id (here
sch_radio001), not the input id. A format the channel does not offer answers404. - Use HTTPS on websites. The port 8000 URLs are for older hardware players and apps that cannot use TLS.
- For a channel in
tokenmode, add?token=with a playback token. hubfly stream channels playback acme-tv Radioprints the URLs. On a web page,<hubfly-player audio-only>from@hubfly/streamsplays the Opus stream, or MP3 where Opus is not offered.
<audio controls src="https://acme-tv.live.hubfly.app/radio/sch_radio001.mp3"></audio>What a station costs
Listeners use bandwidth. Each listener format is an audio-only output that bills 0.1 processing Mbps while it runs. The speed covers all listeners at once: 100 listeners at 128 kbps need 12.8 Mbps, inside the free 25 Mbps.
A station on air 24/7 (730 hours) at 128 kbps, with one listener format and 100 listeners on average:
- Bandwidth: 128 kbps × 100 listeners × 730 h = 4,204.8 GB. After the free 50 GB, 4,154.8 GB × $0.004 = $16.62.
- Processing: 0.1 Mbps × 730 h = 73 Mbps-hours. After the free 20, 53 × $0.004 = $0.21.
- Speed: free on a 25 Mbps server.
- Total: about $16.83 a month. Each extra listener format adds about $0.29 a month of processing.
The free allowance is shared by all your servers. See pricing and limits.