Encoders
Encoders send audio from your station to streaming servers for distribution to listeners.
Overview
An encoder compresses audio and transmits it to a streaming server (Icecast, SHOUTcast, or similar). The streaming server then distributes the audio to listeners.
Station → Encoder → Streaming Server → ListenersKey Concepts
What is an encoder? An encoder converts raw audio into a compressed stream format (MP3, AAC, Opus) and transmits it to a remote server using a streaming protocol.
Why use multiple encoders?
- Provide different quality levels (128 kbps for mobile, 320 kbps for high fidelity)
- Stream to multiple platforms simultaneously
- Maintain backup streams for redundancy
Encoder vs streaming server: The encoder sends audio. The streaming server receives it and distributes it to listeners. Your streaming provider supplies the server; xtra audio provides the encoder.
Setup
Prerequisites
- Streaming server credentials from your provider
- Server address and port
- Mount point (for Icecast servers)
Add an Encoder
- Navigate to Encoders in the station sidebar
- Click Add Encoder
- Enter the connection details (see table below)
- Click Save
Connection Settings
| Field | Description | Required |
|---|---|---|
| Name | Internal identifier | Yes |
| Host | Server address | Yes |
| Port | Server port | Yes |
| Mount Point | Stream path (Icecast) | Yes |
| Username | Source username | Yes |
| Password | Source password | Yes |
| Genre | Station genre tag | No |
| Enabled | Toggle encoder on or off | — |
The connection parameters define how the encoder reaches the streaming server:
- Host: IP address or hostname of the Icecast or SHOUTcast server
- Port: TCP port the server listens on
- Mount Point: stream path on the server (Icecast)
- Username: source account username
- Password: source account password
Encoders can be deactivated without deleting them by toggling the Enabled setting. Disabled encoders show a "Disabled" badge.
An SSL/TLS indicator (shield icon) appears when the encoder uses a secure connection.
Audio Settings
Audio passes through loudness processing before it reaches the encoder. Configure target loudness in EBU R128 to ensure consistent levels across the stream.
Codec Comparison
| Feature | MP3 | AAC | Opus |
|---|---|---|---|
| Compatibility | Universal | Good | Modern players only |
| Efficiency | Baseline | 30% better than MP3 | 50% better than MP3 |
| Quality at 128 kbps | Good | Excellent | Excellent |
| Quality at 64 kbps | Poor | Good | Good |
| Bitrate range | 64–320 kbps | 32–256 kbps | 32–256 kbps |
| Latency | Low | Low | Very low |
| License | Royalty-free | May require license | Royalty-free |
Codec Selection
| Codec | Best For | Bitrate Range |
|---|---|---|
| MP3 | Maximum compatibility | 64–320 kbps |
| AAC | Mobile listeners, efficiency | 32–256 kbps |
| Opus | Best quality at low bitrates | 32–256 kbps |
Metadata
Configure how track information appears to listeners.
Metadata Format
The metadata format is a template that combines text and placeholders. The format determines the string sent to the streaming server for each track.
{{artist}} - {{title}}This template produces Miles Davis - So What for a track by Miles Davis. Static text outside placeholders appears unchanged. An empty placeholder resolves to an empty string.
Template Variables
| Variable | Output |
|---|---|
{{artist}} | Track artist |
{{title}} | Track title |
{{album}} | Album name |
{{station}} | Station name |
Case Transformation
| Option | Result |
|---|---|
| None | Original casing |
| Upper | ALL UPPERCASE |
| Lower | all lowercase |
| Title | Title Case |
Status and Monitoring
| Status | Meaning |
|---|---|
connected | Streaming active |
connecting | Establishing connection |
offline | Not streaming |
timeout | Connection timed out |
busy | Server reports mount point in use |
ssl_error | SSL/TLS handshake failed |
cast_denied | Authentication rejected by server |
internal | Internal error |
The station.encoder.statuschange webhook trigger fires whenever an encoder transitions between these states. Use it to alert on disconnects or failed connections. See Webhooks.
Troubleshooting
Connection Refused
- Verify host and port
- Check if server is running
- Confirm firewall allows outbound traffic
Authentication Failed
- Verify username and password
- Check mount point spelling (Icecast)
- Ensure source account exists
Frequent Disconnections
- Check network stability
- Reduce bitrate
- Contact server provider
Icecast vs SHOUTcast
| Feature | Icecast | SHOUTcast |
|---|---|---|
| License | Open source (GPL) | Proprietary |
| Codecs | MP3, AAC, Opus, Vorbis, FLAC | MP3, AAC |
| Mount points | Multiple streams per server | One stream per port |
| Metadata | Full support | Basic support |
| Cost | Free (self-hosted) | Free tier + paid plans |
| Fallback streams | Built-in | Limited |
Bandwidth Calculator
| Listeners | Bitrate | Hourly | Monthly (24/7) |
|---|---|---|---|
| 10 | 128 kbps | 576 MB | 414 GB |
| 50 | 128 kbps | 2.88 GB | 2.07 TB |
| 100 | 128 kbps | 5.76 GB | 4.15 TB |
| 10 | 64 kbps | 288 MB | 207 GB |
| 50 | 64 kbps | 1.44 GB | 1.04 TB |
Formula: listeners × bitrate (kbps) × 3600 / 8 / 1024 = MB per hour
FAQ
What is the best codec for internet radio?
MP3 at 128 kbps offers the best balance of quality and compatibility. For bandwidth-constrained scenarios, AAC at 64 kbps provides similar quality at half the bitrate.
How much bandwidth does streaming use?
Bandwidth depends on bitrate and listener count. A 128 kbps stream uses approximately 57.6 MB per listener per hour. Multiply by concurrent listeners for total usage.
Can I stream to multiple servers?
Yes. Create multiple encoders, each with different server credentials. All encoders stream simultaneously from the same audio source.
What causes stream buffering?
Buffering occurs when listeners cannot download audio fast enough. Common causes include high bitrate on slow connections, server capacity limits, or network congestion.
Should I use stereo or mono?
Use stereo for music stations (128+ kbps). Use mono for talk/speech to save bandwidth.
Related
- Station Configuration - Complete station setup
- EBU R128 - Loudness normalization settings
- Sound Processing - Audio processing before encoding