Icecast

Icecast is a program for streaming media such as audio and video across a network. Different types of clients connect to the IceCast server, either to provide a "mount point", control the server, or listen to the audio being cast.

Icecast has support for streaming many audio streams simultaneously - each stream has a "mount point" which a client can access, with a network URI such as http://localhost:8000/example.ogg.m3u (this refers to a mount point called "example").

Installation

Install icecast.

Alternatively, you can build and install the icecast-khAUR package. Icecast-kh (Karl Heyes) extends on the official release with features that may be (if found to be working out well) merged into next official releases.

Configuration

All configuration is done in /etc/icecast.xml.

Warning: Before starting icecast make sure to change the default passwords in the <authentication> section!

By default icecast listens on port 8000. It can listen on more than one port - this behavior can be changed by modifying one or more sections.

Icecast binds to all interfaces (i.e. ) by default. To change this behavior, modify a section below a respective section.

To set defaults for all mounts that do not specify their type (e.g. <mount type="normal">) the section can be modified:

/etc/icecast.xml
<mount type="default">
  <public>0</public>
  <intro>/stream.m3u</intro>
  <max-listener-duration>3600</max-listener-duration>
  <authentication type="url">
    <option name="mount_add" value="http://auth.example.org/stream_start.php"/>
  </authentication>
  <http-headers>
    <header name="foo" value="bar" />
  </http-headers>
</mount>

Running

Enable and start .

To verify that icecast is running go to http://localhost:8000/ or check the status of .

Streaming

Several programs are able to stream to icecast based on a set in the section of the configuration.

MPD

Make sure to setup MPD and a client to control it.

Configure MPD (as system or user service) to be an icecast source:

Start mpd.service.

The icecast web interface should now list this new stream and the playlist should be available as http://localhost:8000/example.ogg.m3u

Oggfwd and ffmpeg2theora

Install the and packages.

Pipe ffmpeg2theora output of an audio file to , which forwards to the icecast server.

$ ffmpeg2theora --no-skeleton --novideo -o - path/to/audio/file | oggfwd localhost 8000 source-password /mount.ogg

Alternatively, use the following script:

ezstream

is a native source client for icecast. It uses XML files for configurations, like icecast

Several examples can be found in /usr/share/examples/ezstream/. It supports mp3, Ogg Vorbis, Ogg Theora, for streaming video ffmpeg2theora can be used to reencode into Ogg Theora.

After configuring, stream can be started by

Multiple media can streamed by creating a m3u playlist and defining it under <intakes> in configuration file

XMMS2

is a minimal music player which can be controled with several clients, setting this up is fairly simple compared to MPD and media can be added to stream on fly unlike ezstream.

Icecast configuration can be displayed with:

These can be changed as follows,

$ xmms2 server config ices.password my_password
$ xmms2 server config ices.port 5080
$ xmms2 server config ices.public 1

Change the output as ices so XMMS2 can mount the stream on icecast server.

Upon starting, the stream should be working and files can be added with the command "add".

Alternatively, XMMS2 can be controlled with which provides a simple GUI.

VLC

is a full-featured media player and transcoder with built-in support for Icecast streaming. It can be controlled via GUI or command line, and can act as an Icecast source for  media files or real-time audio captured from JACK output ports and other sources. For example, this command connects VLC to the first JACK audio output ports it finds, encodes the audio as Ogg Vorbis, and streams it to an Icecast mount point at :

Alternatively, VLC offers a guided GUI to stream to an Icecast server. When opening any media source, choose Stream and then add Icecast as a destination. You will be prompted for the network Address, Port, Mount Point, and Login:pass. Use source:<password> as the format for the latter. Select the desired transcoding options on the next screen and you are ready to go.

Playback

Streams can be listened to via a web browser when visiting http://localhost:8000.

Additionally, there are several clients that can make direct use of a provided playlist file (e.g. http://localhost:8000/example.ogg.m3u)

MPD

Icecast streams can be played back using MPD.

Use an MPD client such as to add the URL of an icecast playlist file to the playlist of a (local) MPD instance:

$ mpc add http://localhost:8000/example.ogg.m3u

The added item behaves like any other track in the MPD playlist.

MPlayer

Install the package.

Start the program and provide it with the icecast playlist:

$ mplayer -playlist http://localhost:8000/example.ogg.m3u

Mpv

Install the package.

Start the program and point it at the icecast playlist:

$ mpv http://localhost:8000/example.ogg.m3u

Sonata

  • Install the sonata-gitAUR package.
  • Start it up and you should be greeted by Sonata's preferences.
  • Set 'Name' to the name of your server.
  • Set 'Host' to the IP address of your server.
  • Set 'Port' to '6600'.
  • Click the '+' and repeat the previous steps but instead about your local computer (i.e. its name and IP).
  • Right-click->'Connections' and select your server. Then click on the 'Library' tab, if all is well, you should see your entire music selection that is on your server. Find a folder, right-click and click 'Add'. Clicking on the 'Current' tab will show you your current playlist, which should have the contents of whatever folder you just chose from the library. Double-click on a song. You should see the text get bold and the progress bar show up, just like it is playing, but you will not hear anything. Fear not.
  • Right-click->'Connections' and select your local computer. Then click the 'Streams' tab. Right-click and click 'New'. Make 'Stream Name' the name from your servers /etc/mpd.conf file's audio_output { } section and make the URL IP.of.server:8000/example.ogg.m3u. Double-click on this stream.
  • Click on the 'Current' tab and you will see the URL of the stream as your only item. Double-click on it and after a delay you should hear whatever song you had chosen on the server.

VLC

In addition to acting as an Icecast source, can play back streams from Icecast and other network audio sources. Choose Open Network Stream... and provide the URL when prompted.

Tips and tricks

Running Icecast in a chroot environment

Change following settings in /etc/icecast.xml:

Edit the section of :

Now change this entries in /etc/icecast.xml:

Create a log directory under and set the permissions:

Local user

Note that if you are running icecast under a local user (i.e. one that does not use /etc/icecast.xml) then you will need to copy the icecast web xml files from /usr/share otherwise you will get errors about XSLT and the web interface will not work.

$ cp -R /usr/share/icecast/web ~/icecast/

Also, make sure that the <changeowner> section in the icecast configuration file is commented out, as changing the owner of a process requires root privileges.

gollark: Over here, something like half of students go to university at 18?
gollark: Whether some "college educated" people believe anything is basically irrelevant to whether it's true, though.
gollark: > So do college educated people.... how is that related?
gollark: You can't get infinite *power* from that unless Thatcher spins with infinite torque, though, can you?
gollark: Also "credit unions".

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.