Stream an OGG file using icecast2 + ices2

Installation

apt-get install icecast2 ices2

The icecast2 server should now be running, you can check this by visiting the localhost icecast2 web page (e.g..)[168.4.140:8000]

Configuration

Change the icecast2 password withing /etc/icecast2/icecast.xml

vi /etc/icecast2/icecast.xml

Create a directory for /var/log/ices, /etc/ices2 and /etc/ices2/music

mkdir /var/log/ices
mkdir /etc/ices2
mkdir /etc/ices2/music

Copy the ices2 playlist example into /etc/ices2

cp /usr/share/doc/ices2/examples/ices-playlist.xml /etc/ices2

Configuring ices2

Change the password to match the password you set in the icecast2 configuration file and modify the instances section to display the file you want to stream.

vi /etc/ices2/ices-playlist.xml

Note: I also changed the encode/samplerate to 22050 and channels to 1 since that's what my ogg file was encoded with when I created it.

Creating the playlist containing the audio files

Create the /etc/ices2/playlist.txt file

vi /etc/ices2/playlist.txt

e.g.

/etc/ices2/music/myday.ogg
/etc/ices2/music/1vs0_JuniorGroove.ogg
/etc/ices2/music/1vs0_TheWavechangerSuperhero.ogg

Note: Each audio file will be played consecutively under the playlist heading of /myday.ogg as was set in the ices-playlist.xml file.

Running ices2

ices2 /etc/ices2/ices-playlist.xml

Note: After the playlist has been played once the ices2 program will finish. There is an option in the ices-playlist.xml to set once to false, however it didn't seem to make any difference.

Listening to the stream

To listen to the stream you can use almost any audio player which can play streams. To use mplayer (e.g. `mplayer.)[168.4.140:8000]

Resources

Tags:
Source:
1030hrs.txt
Published:
23-02-2016 10:30