|
Icecast Scripts
Here's how we do our streaming audio webcasts:
|
Here are the shell scripts that make all that work. Please let me know if you find this useful, or make any improvements...
| ice-downcoder.pl | This is the script that listens to one
icecast stream, and then rebroadcasts it as another,
after changing the bitrate. It uses
LAME
to decode and then re-encode the MP3 data.
This is also the script that reads from the local sound card, converts it to an on-the-fly MP3 stream, and feeds that to an Icecast server. |
| shout-archive.pl | When the club is open we broadcast live audio; but when the club is closed, we used to re-broadcast audio from our archive of past live performances. We don't do that any more, but this is the script that did it. This script rolls through the directory of archived MP3 files and feeds them to the icecast server one after another, from oldest to newest. When it runs out, it wraps around and does it again. |
| ice-downcoders-initd | This is the /etc/rc.d/init.d/ script that launches a number of instances of ice-downcoder-loop.sh (one for each additional stream.) |
| ice-downcoder-loop.sh | This just runs ice-downcoder.pl in a loop, in case it exits. It is also somewhat smart about detecting network lossage: when the downcoder exits, it pings a particular host; if that host is not pingable, it waits until it becomes pingable before restarting the downcoder script. |
| write-metadata.pl | This is a handy little script for updating the metadata (streaming titles) in an existing Icecast stream. |
| update-downcoder-metadata.sh | This runs write-metadata.pl for each of the downcoded streams, so that all versions have the song titles in them. |