Icecast2 streaming MP3 using icegenerator, by otheos.

 

Download icecast-2.2.0.tar.gz*

Download icegenerator-0.5.5-pre2.tar.gz

      Download lid3lib-3.8.3.tar.gz

      Download libshout-2.1.tar.gz

 

Compile icecast

Compile libshout and lib3lib, ruh ldconfig

Compile icegenerator (use configure --with-shout=/usr/local --with-id3=/usr/local)

 

Set up icecast:

-----------------------------

icecast installation created

/usr/local/bin/icecast (executable)

/usr/local/etc/icecast.xml (configuration file)

/usr/local/share/icecast (http client)

/usr/local/share/doc/icecast (documentation in html format)

 

Create icecast user:

-----------------------------

useradd -d /usr/local/share/icecast icecast

chown -R icecast.icecast /usr/local/share/icecast

su - icecast

 

Put the configuration file in user's homespace:

-----------------------------------------------

cp /usr/local/etc/icecast.xml ~icecast/

 

Edit configuration file:

------------------------

Simply change the following -

 

<source-password> - will be used by the source client

<admin-password> - will be used to access admin features of icecast

<listen-socket> (both port and bind-address)

<logdir> - directory where log files will be placed

<webroot> - any static content can be placed here (file serving root)

<adminroot> - directory containing admin xslt files

 

and make sure all file locations point to the right places!!!

 

Test icecast:

-------------

icecast -c /usr/local/share/icecast/icecast.xml

 

and check the log /usr/local/share/icecast/log/error.log

 

to see

 

INFO main/main.c icecast server started

 

If you see errors you need to edit your config file.

Now you can fire up your browser and see it running at http://yourip:8000/admin/stats.xml

You will need to type the password you entered in the config file.

Username is admin unless changed in the config file.

 

 

Set up icegenerator:

--------------------

 

Once compiled icegenerator executable is found in /usr/local/bin

For each source (channel) you need one config file.

 

So for 2 channels you need 2 files.

 

example:

-------------------------------------------------------------------------

NAME=Proteus Streaming Server

IP=127.0.0.1

PORT=8000

# 2 - Icecast 2.0 (HTTP protocol compatible)

SERVER=2

SOURCE=source

PASSWORD=psa405

FORMAT=1

RECURSIVE=1

DUMPFILE=

LOOP=1

SHUFFLE=1

BITRATE=48000

PUBLIC=0

METAUPDATE=5

MDFPATH=/mypath/global.mdf

LOG=2

LOGPATH=/var/log/icegenerator.log

DATAPORT=8796

 

#######################################################

 

MOUNT=/jazz

 

MP3PATH=m3u:/etc/custom/icegen/jazz.m3u

 

GENRE=Jazz Music

 

DESCRIPTION=Home Radio

 

URL=http://proteus:8000/jazz

 

----------------------------------------------------------------------------

 

This provides a feed for random play on the /jazz channel.

The source MP3's are from an m3u file, jazz.m3u with the following format:

 

/my/path/to/the/mp3/file.mp3

 

and can be generated running:

 

find /my/path/to/some/mp3/files/or/folders/ | grep .mp3 > jazz.m3u

 

Alternatively you can feed the source with a simple path using:

 

MP3PATH=pth://my/path/to/the/mp3/file/or/folder

 

 

Run the client:

----------------

 

icegenerator -f /etc/custom/icegen/jazz

 

where jazz is the above example file.

 

Testing the client:

--------------------

 

Go to the web interface http://myip:8000

 

to see your channel listed (/jazz in the above case).

 

 

Connecting:

--------------

 

Fire up your player, and ask it to Play URL, then point it to http://myip:8000/jazz to enjoy.

 

 

 

Extras:

---------

 

You can make a script to run icecast at startup.

 

Example:

-------------------------------------------------------------------------------

#!/bin/csh

su - icecast -c usr/local/bin/icecast -b -c /usr/local/icecast/conf/icecast.xml

sleep 5

su - icecast -c /usr/local/bin/icegenerator -f /etc/custom/icegen/classical

-------------------------------------------------------------------------------

 

the "su - icecast -c" part allows the command to run as the icecast user (it's a bad idea to run icecast as root).

 

Put this script somewere handy make it executable (chmod +x) and add a line for it at your /etc/rc.d/rc.local

 

Enjoy!!!