[Icecast] IceCast and ICES

Paul Martin pm at nowster.me.uk
Thu Nov 28 13:22:28 UTC 2019


On Thu, Nov 28, 2019 at 11:39:56AM +0000, Michael Brenegan wrote:
> I may be wrong, but looking at your ffmpeg command, it looks as
> though you are trying to stream mp3 files.  Ices2 is no longer
> compatible with mp3 files, and instead has moved to ogg.  For an
> ices version that handles mp3 files, you will need to compile
> ices0.4.

One alternative is to use liquidsoap, but its configuration is not for
the faint-hearted.

With appropriate libraries, you can get liquidsoap to do simultaneous
encoding to pretty much any current format (Vorbis, MP3, FLAC, Opus,
AAC), and clever things like failover to a standby feed or file on
silence detection.

An example configuration, very close to the one I'm using:




#!/usr/bin/liquidsoap

# Enable telnet server for on-the fly metadata changes
set("server.telnet", true)

# Logging. Very useful for debugging problems.
set("log.file.path", "/tmp/liquid.log")

# ALSA audio source, at 48kHz sampling
# Many consumer sound cards work at 48kHz natively and resample
# for any other rate.
set("frame.audio.samplerate", 48000)
source = mksafe(input.alsa())

# Allow telnet server to override metadata
source = server.insert_metadata(id="ID", source)

# Metadata used when silence detected
def fault_meta(m) =
 [
  ("title", "There is a fault"),
  ("artist", "My Radio")
 ]
end

# Add metadata to emergency stream.
# The file can be any supported type.
emergency= map_metadata(
 fault_meta,
 mksafe(single("/srv/audio/birdsong.opus"))
)

# Detect 30 seconds of silence on ALSA source
source = strip_blank(
 max_blank=30.0,
 threshold=-60.0,
 source
)

# Switch over to emergency stream on silence, and switch back automatically
source = fallback(track_sensitive=false, [source, emergency])

# Icecast server common parameters
ice_host = "127.0.0.1"
ice_port = 8000
ice_pass = "hunter2"
station = "My Radio"

# A FLAC feed
output.icecast(
 %ogg(%flac(samplerate=48000, compression=5)),
 host = ice_host,
 port = ice_port,
 password = ice_pass,
 mount = "radio.flac",
 name = "My Radio FLAC",
 description = station,
 url="",
 encoding="UTF-8",
 source
)

# An Ogg Vorbis feed
output.icecast(
 %ogg(%vorbis(quality=0.0, samplerate=48000)),
 host = ice_host,
 port = ice_port,
 password = ice_pass,
 mount = "radio.ogg",
 name = "My Radio Vorbis",
 description = station,
 url="",
 encoding="UTF-8",
 source
)

# An Opus feed
# Be aware that Opus always uses 48kHz sampling internally.
output.icecast(
 %ogg(%opus(bitrate=128, samplerate=48000, application="audio", complexity=5)),
 host = ice_host,
 port = ice_port,
 password = ice_pass,
 mount = "radio.opus",
 name = "My Radio Opus",
 description = station,
 url="",
 encoding="UTF-8",
 source
)

# An MP3 feed
output.icecast(
 %mp3(bitrate=128, samplerate=48000),
 host = ice_host,
 port = ice_port,
 password = ice_pass,
 mount = "radio.mp3",
 name = "My Radio MP3",
 icy_metadata = "true",
 description = station,
 url="",
 encoding="UTF-8",
 source
)

-- 
Paul Martin <pm at nowster.me.uk>


More information about the Icecast mailing list