Icecast Server/Getting Started: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
A mountpoint could be described as a file on a normal local file system.<br />
A mountpoint could be described as a file on a normal local file system.<br />
The listener accesses the "file" (mountpoint) and can listen to the "file content" (stream).<br />
The listener accesses the "file" (mountpoint) and can listen to the "file content" (stream).<br />
The server now offers the stream it gets from the source client on that specified mountpoint.<br />
The server offers the stream it gets from the source client on that specified mountpoint.<br />
Now listeners can connect to this mountpoint like they would to a normal file on a remote server.
Listeners can connect to this mountpoint like they would to a normal file on a remote server.


Icecast sends the data it receives from the source client to the listeners, to everyone the same bitstream in realtime.<br />
Icecast sends the data it receives from the source client to the listeners. Everyone gets the same bitstream in realtime.<br />
It is not possible to use Icecast with static files (like ogg or mp3 files), Icecast always needs an source client which sends the bitstream!
You cannot use Icecast with static files (like ogg or mp3 files), it always needs a source client which sends a bitstream!


== Getting Icecast ==
== Getting Icecast ==

Revision as of 16:57, 24 December 2014

This article describes how to get an Icecast server up and running.

On this resulting server you can connect with a Source Client, like IceS, and stream music or video to listener clients.

To get started with using Icecast you should first understand how everything works together.

How it works

Graphic showing the flow from source clients through Icecast to listeners
Graphic showing the flow from source clients through Icecast to listeners

The graphic above shows how Icecast basically works.

A source client, for example IceS, connects to the server on a specified mountpoint.
A mountpoint could be described as a file on a normal local file system.
The listener accesses the "file" (mountpoint) and can listen to the "file content" (stream).
The server offers the stream it gets from the source client on that specified mountpoint.
Listeners can connect to this mountpoint like they would to a normal file on a remote server.

Icecast sends the data it receives from the source client to the listeners. Everyone gets the same bitstream in realtime.
You cannot use Icecast with static files (like ogg or mp3 files), it always needs a source client which sends a bitstream!

Getting Icecast

Before you can actually start to set up the server, you have to download the source code (or alternatively a binary package on Windows).
This "Getting Started" is written for the server version 2.4.1, but should work with at least every 2.4.x version.

You can get the latest releases on icecast.org.

Windows users should download the binary package, while others can download the source. There may be compiled versions on Homebrew (Mac OS) or apt-get (Debian, Ubuntu, etc), but these could be outdated, so how to compile from source will be explained in the next step.

Windows users who download the binary package – and extract it to some location – can skip the next step and continue with "The configuration".

Compiling

After downloading the source package you like, you have to extract it. After that you will have to use your console and change directory (cd) to your extracted files.

$ cd /path/to/icecast-source

After doing that you have to run the configuration tool, then compile and install it. You may have to install additional dependencies first, when done, run the following commands.

$ ./configure
$ make
$ make install

The configuration

After installing Icecast, you are just one step away from using it! You have to configure it. Icecast is shipped with a default configuration. The default configuration can be found

  • on Linux here:
    /etc/icecast.xml
    or
    /etc/icecast2/icecast.xml
  • on Mac OS here:
    /etc/icecast.xml
    or
    /usr/local/etc/icecast.xml
  • on Windows here:
    /path/to/extracted/icecast/etc/icecast.xml

You can now edit this file and save it to a location where you like it, or just leave it there, however you will need the full path to start the server, so you should remember it. To set up the server you should edit some fields in this xml file, like setting the right passwords, and hostname.

It is never wrong to set up these values, especially if you plan running a public server.

<location>The server's location</location>
<admin>admin@yourdomain.tld</admin>

You always should change the passwords from hackme to something more secure.

<authentication>
    <!-- Sources log in with username 'source' -->
    <source-password>myfancypassword</source-password>
    <!-- Relays log in username 'relay' -->
    <relay-password>youshallnotpass</relay-password>

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

If you plan to run a public server and/or a server with Yellow Pages listing, you should change the hostname to one where your server can be accessed from.

<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<hostname>streams.yourdomain.tld</hostname>

Setting up more advanced things like relays, Yellow Pages listing and various other things will be explained in following in-depth parts of this Getting started.

Starting the server

To start your first server, type

$ icecast -c /path/to/icecast.xml

into your console. If you did everything correctly Icecast should start and listen for connections on the default port. You can access it by typing http://127.0.0.1:8000/ into your web browser. If you see a page which says Icecast2 Status on top, you have done everything right and finished the basic part of this Getting started!

What next?

If you want in-depth infos, you should look at the following articles.