Icecast2

Fra SemarkIT
Skift til: Navigation, Søgning

The Icecast server is capable of streaming content as Vorbis over standard HTTP, Theora over HTTP, MP3 over the protocol used by SHOUTcast, AAC, and NSV over the SHOUTcast protocol. (Theora, AAC, and NSV are only supported in version 2.2.0 and newer.) It uses external programs, called "source clients", to originate the streams, and the Icecast project includes a source client program known as IceS. The source runs typically in the place where the audio is generated (e.g. a studio) and the Icecast server in a place where a lot of bandwidth is available (e.g., a colocation).

It has similar functionality to the proprietary media server program SHOUTcast, by Nullsoft.

Install Icecast

apt-get install icecast2 ezstream ices2 ffmpeg2theora flac

Configure Icecast

A complete list of settings can be found here: Icecast2 Config File

nano /etc/icecast2/icecast.xml

My server-example config

<icecast>
   <limits>
       <clients>100</clients>
       <sources>50</sources>
       <threadpool>30</threadpool>
       <queue-size>524288</queue-size>
       <client-timeout>30</client-timeout>
       <header-timeout>15</header-timeout>
       <source-timeout>10</source-timeout>

       /*   If enabled, this will provide a burst of data when a client
        *   first connects, thereby significantly reducing the startup
        *   time for listeners that do substantial buffering. However,
        *   it also significantly increases latency between the source
        *   client and listening client.  For low-latency setups, you
        *   might want to disable this.
        */
       <burst-on-connect>1</burst-on-connect>
       /*   same as burst-on-connect, but this allows for being more
        *   specific on how much to burst. Most people won't need to
        *   change from the default 64k. Applies to all mountpoints'
        */
       <burst-size>65535</burst-size>
   </limits>

   <directory>
	<yp-url-timeout>15</yp-url-timeout>
	<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
   </directory>
		
   <authentication>
       /* Sources log in with username 'source' */
       <source-password>source-Password</source-password>

       /* Relays log in username 'relay' */
       <relay-user>relay</relay-user>
       <relay-password>relay-Password</relay-password>

       /* Admin logs in with the username given below */
       <admin-user>admin</admin-user>
       <admin-password>Admin-Password</admin-password>
   </authentication>

   <hostname>host.domain.local</hostname>
   <fileserve>1</fileserve>
   <server-id>Icecast 2.3</server-id>
	
   /* You may have multiple <listener> elements */
   <listen-socket>
	
       <port>8000</port>
	<port>8001</port>
   </listen-socket>
   <listen-socket>
	/* This is a SHOUTcast port if you need SHOUT-relays */
       <port>8002</port>
       <shoutcast-compat>1</shoutcast-compat>
   </listen-socket>

   /* Icecast-relay (Master/Slave style) */
   /* 
    *   <master-server>Some-IP-address-to-master-icecast-server</master-server>
    *   <master-server-port>8001</master-server-port>
    *   <master-update-interval>120</master-update-interval>
    *   <master-password>hackme</master-password>
    *   <relays-on-demand>1</relays-on-demand>
    */

   /* Icecast-relay (Specific Mountpoint style) */
   /* Icecast-server relay */
   <relay>
       <server>some-Icecast-stream</server>
       <port>80</port>
       <mount>/aac</mount>
       <local-mount>/local-mount-name</local-mount>
       <relay-shoutcast-metadata>1</relay-shoutcast-metadata>
   </relay>

   /* SHOUTcast-server relay */
   <relay>
       <server>some-SHOUTcast-stream</server>
       <port>8000</port>
       <mount>/</mount>
       <local-mount>/local-mount-name</local-mount>
       <relay-shoutcast-metadata>1</relay-shoutcast-metadata>
   </relay>

   /* Server mounts (Video/Audio) */
   /* Video exsample */
   <mount>
       <mount-name>/test_1</mount-name>

       <username>test1</username>
       <password>testing1</password>

       <max-listeners>20</max-listeners>
       <dump-file>/tmp/test1</dump-file>
       <intro>/test1/intro.ogv</intro>
       <fallback-mount>/test1/test1-off.ogv</fallback-mount>
       <fallback-override>1</fallback-override>
       <fallback-when-full>1</fallback-when-full>
       <hidden>0</hidden>
       <public>0</public>
       <charset>UTF-8</charset>
       <type>application/ogg</type>
       <subtype>theora</subtype>
       <bitrate>64</bitrate>
       <stream-name>Some stream name</stream-name>
       <stream-description>Some stream description</stream-description>
       <stream-url>http://outside-name.domain.local</stream-url>
       <genre>some genre</genre>
   </mount>
   /* Audio example */
   <mount>
       <mount-name>/test_2</mount-name>

       <username>test2</username>
       <password>testing2</password>

       <max-listeners>20</max-listeners>
       <dump-file>/tmp/test2</dump-file>
       <intro>/test2/intro.ogg</intro>
       <fallback-mount>/test2/test2-off.ogg</fallback-mount>
       <fallback-override>1</fallback-override>
       <fallback-when-full>1</fallback-when-full>
       <hidden>0</hidden>
       <public>0</public>
       <charset>UTF-8</charset>
       <type>application/ogg</type>
       <bitrate>64</bitrate>
       <stream-name>Some stream name</stream-name>
       <stream-description>Some stream description</stream-description>
       <stream-url>http://outside-name.domain.local</stream-url>
       <genre>some genre</genre>
   </mount>
   /* Source determined */
   <mount>
       <mount-name>/test_3</mount-name>

       <username>test3</username>
       <password>testing3</password>

       <max-listeners>20</max-listeners>
       <dump-file>/tmp/test3</dump-file>
       <hidden>0</hidden>
       <public>0</public>
       <charset>UTF-8</charset>
       <stream-name>Some stream name</stream-name>
       <stream-description>Some stream description</stream-description>
       <stream-url>http://outside-name.domain.local</stream-url>
       <genre>some genre</genre>
   </mount>

   <paths>
       /* basedir is only used if chroot is enabled */
       <basedir>/usr/share/icecast2</basedir>

       /* Note that if <chroot> is turned on below, these paths must both
        * be relative to the new root, not the original root
        */
       <logdir>/var/log/icecast2</logdir>
       <webroot>/usr/share/icecast2/web</webroot>
       <adminroot>/usr/share/icecast2/admin</adminroot>
       <pidfile>/usr/share/icecast2/icecast.pid</pidfile>

       /*   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"/>
        */
       /*   Aliases: can also be used for simple redirections as well,
        *   this example will redirect all requests for http://server:port/ to
        *   the status page
        */
       <alias source="/" dest="/status.xsl"/>
   </paths>

   <logging>
       <accesslog>access.log</accesslog>
       <errorlog>error.log</errorlog>
       <playlistlog>playlist.log</playlistlog>
       <loglevel>1</loglevel>   /* 4 Debug, 3 Info, 2 Warn, 1 Error */
       <logsize>10000</logsize> /* Max size of a logfile */

	/* If logarchive is enabled (1), then when logsize is reached
        * the logfile will be moved to [error|access|playlist].log.DATESTAMP,
        * otherwise it will be moved to [error|access|playlist].log.old.
        * Default is non-archive mode (i.e. overwrite)
        */
       <logarchive>1</logarchive>
   </logging>

   <security>
       <chroot>0</chroot>
   /*
    *  <changeowner>
    *      <user>icecast</user>
    *      <group>icecast</group>
    *  </changeowner>
    */
   </security>
</icecast>

Your icecast-server is now ready to be tested, a way of testing is with VLC cause it supports both streaming to and from Icecast

Personlige værktøjer
Navnerum

Varianter
Handlinger
Navigation
Værktøjer