Icecast Live Stream: Sample conf for Icecast/Ices
Original date: June 23, 2006 3:30 AM by sonnik
Here's a simple configuration file I use for Icecast for live streaming of audio. I found the original floating around on the web, perhaps in the original documentation, or on a HOWTO website. I know that sometimes a good practical example of Icecast configuration files can be hard to find. Below is a configuration I use for streaming live content, including an icecast.conf and an ices.conf file. (Read On)
Unlike Windows Media Encoder, you'll have two programs. First you'll have Icecast, which handles accepting encoded material and streaming via the network. Second, you'll have Ices which encodes the content and feeds it to Icecast. Note that Ices has had two major versions. The first favored MP3 content; the current favors Ogg-Vorbis. You can still find the original Ices at Xiph.org if you'd like to stream MP3. The configuration file for MP3 is slightly different, you should be able to find an example for the MP3 configuration somewhere out there.
Note that I've created a user iceuser with restricted permissions used only for the Icecast server. You'll also want to ensure that any directories referenced in the configuration file exist and have appropriate permissions for iceuser.
I won't go into full detail on all of Icecast's features. I will point out that it includes an administration mode as well as a simple file server, including HTML files. You'll find the appropriate information for those in the lines of the Icecast.conf configuration file.
As always, be aware of any security concerns even if you are streaming this on your own network. You probably won't be able to stream from your home computer commercial because of obvious bandwidth restrictions. If you're looking to more than yourself or a couple of friends, you may wish to look into a streaming media service provider.
icecast.conf
<icecast>
<location>Not Currently Used</location>
<admin>Not Currently Used</admin>
<limits>
<clients>100</clients>
<sources>5</sources>
<threadpool>5</threadpool>
<queue-size>102400</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
</limits>
<authentication>
<!--
Sources log in with username 'source' -->
<source-password>sourcepwd</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>relaypwd</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>adminpwd</admin-user>
<admin-password>hackme</admin-password>
</authentication>
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://www.oddsock.org/cgi-bin/yp-cgi</yp-url>
</directory>
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://yp.icecast.net/cgi-bin/yp.cgi</yp-url>
</directory>
-->
<!-- The
address of machine on my private network -->
<hostname>192.168.1.155</hostname>
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
</listen-socket>
<listen-socket>
<port>8001</port>
</listen-socket>
<fileserve>1</fileserve>
<paths>
<basedir>/usr/local/share/icecast</basedir>
<!-- Note that if <chroot> is turned on below, these paths
must both
be relative to the new root, not the original root -->
<logdir>/usr/local/share/icecast/log</logdir>
<webroot>/usr/local/share/icecast/web</webroot>
<adminroot>/usr/local/share/icecast/admin</adminroot>
<!-- Aliases: treat requests for 'source' path as being for
'dest' path
May be made specific to a port or bound address using the
"port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" dest="/bar"/>
-->
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error
-->
</logging>
<security>
<chroot>0</chroot>
<changeowner>
<user>iceuser</user>
<group>iceuser</group>
</changeowner>
</security>
</icecast>
|
Now, here's the ices.conf file
<ices>
<background>0</background> <!-- run in background?
(unimplemented) -->
<logpath>/tmp</logpath> <!-- where logs, etc go. -->
<logfile>/usr/local/icecast/log/ices.log</logfile>
<loglevel>4</loglevel> <!-- 1=error,2=warn,3=info,4=debug -->
<consolelog>1</consolelog> <!-- logfile is ignored if this is
set to 1 -->
<stream>
<!--
metadata used for stream listing (not currently used) -->
<metadata>
<name>Example stream name</name>
<genre>Example genre</genre>
<description>A short description of your
stream</description>
</metadata>
<!-- input module
This example uses the 'oss' module. It takes input from the
oss audio device (i.e. line-in), and processes it for live
encoding.
-->
<input>
<module>oss</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">/dev/dsp</param>
<param name="metadata">1</param>
<param name="metadatafilename">
/usr/local/share/icecast/conf/source_meta.txt
</param>
<!-- Read metadata (from stdin by default, or filename
defined below (if the latter, only on SIGUSR1) -->
</input>
<!-- Stream instance
You may have one or more instances here. This allows you to
send the same input data to one or more servers (or to
different
mountpoints on the same server). Each of them can have
different
parameters. This is primarily useful for a) relaying to
multiple
independent servers, and b) encoding/reencoding to multiple
bitrates.
If one instance fails (for example, the associated server
goes
down, etc), the others will continue to function correctly.
This example defines a single instance doing live encoding
at
low bitrate.
-->
<instance>
<!-- Server details:
You define hostname and port for the server here, along
with
the source password and mountpoint.
-->
<hostname>localhost</hostname>
<port>8000</port>
<password>sourcepwd</password>
<mount>/livestream.ogg</mount>
<yp>0</yp> <!-- allow stream to be advertised on YP,
default 0 -->
<!-- Live encoding/reencoding:
channels and samplerate currently MUST match the
channels
and samplerate given in the parameters to the oss input
module above.
-->
<encode>
<quality>4</quality>
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
<!-- stereo->mono downmixing, enabled by setting this to
1 -->
<downmix>0</downmix>
<!-- resampling. Set to the frequency (in Hz) you wish
to resample
to, or 0 to disable -->
<resample>0</resample>
</instance>
</stream>
</ices> |