|
Related YoLinux Tutorials:
°Linux Networking
°Linux Sys Admin
°Internet Security
°Security Tools
°Web site configuration
°Web Tricks
°YoLinux Tutorials Index
Free Information Technology Magazines and Document Downloads
|
| Audio Streaming Server Set-Up Using IceCast 1: |
This tutorial outlines the installation and set-up of an Icecast MP3 audio
streaming server using the binary Linux RPM from icecast.org.
Icecast comes with an http server built in. Icecast can use this if staticdir directive is incuded in the configuration file or icecast will use an existing server such as Apache or Netscape.
This example will employ the http server within Icecast.
Note on using Linux RPM's:
The configuration I used was the icecast 1.3.10 server from the RPM downloaded
from icecast.org and the shout module supplied by the Red Hat RPM.
The icecast.org icecast-1.3.10 RPM did not include the shout module.
The Red Hat powertools icecast RPM included shout but in other ways the RPM
was horribly incomplete (No templates or configuration file.) and thus
the icecast server it shipped with was unuseable.
The configuration file detailed below is intended for the icecast 1.3.10
server and does NOT work with the Red Hat RPM
(icecast-1.3.op2).
Bottom line: I had to install both RPM's to get a complete set of tools.
Amazingly enough there were no RPM conflicts and both installed without
hassle.
Icecast Setup:
Using TCP wrappers:
- File: /etc/hosts.deny
or use nothing at all to allow everyone.
- File: /etc/hosts.allow
icecast: 192.168.10. - Allow from 192.168.10.* network addresses
|
OR
icecast: ALL - Allow all to listen
|
More Icecast Info:
- People typically use 128 kbps compression mono MP3 files. (Sample rate: 44100 Hz)
- Icecast uses TCP port 8000
[Potential Pitfall]: Many corporate firewalls block everything except port 80.
Many of the large MP3 streaming stations such as live365.com have changed
all their servers to stream over port 80 to avoid problems.
- The streaming protocol used is called the shoutcast protocol.
- Header type: application/x-audio
- Icecast has a web interface for administration which is good for viewing
the status of the icecast server but useless at making changes.
(That part is broken.)
- Remote administration can be performed in console mode:
- telnet node.your-domain.com 8000
- Enter: ADMIN password then Enter + Enter (carraige return twice)
- Switch to operator status: oper operator-password
- Get list of commands: help
- You can list your server with a directory server to gain exposure and more listeners.
List of directory servers:
- yp.shoutcast.com
- yp.breakfree.com
- yp.musicseek.net
- yp.van-pelt.com
- yp.radiostation.de
- yp.mp3.de
Point your browser at: http://dir.xiph.org/ to take a peek of the directory listings.
- Icecast can run as a relay thus adding scalability by adding more servers.
Use the "alias" directive to employ this capability.
- Icecast can support access control lists (ACL) using "deny" and "allow" directives.
- There are NO man pages.
Icecast configuration file directives for /etc/icecast/icecast.conf
-
| Directive |
Description |
| icydir yp.shoutcast.com |
Directive for old directories. |
| directory yp.shoutcast.org |
Directive for new directories. Icecast 1.3+
Default port: 80 |
| touch_freq integer |
How often the directory servers get 'touched' by the icecast server.
Default: 5 minutes |
| max_admins integer |
Max. number of simultaneous connected admins. |
| console_mode integer |
0: admin console
1: same as 0 but without logfile info
2: Use as logfile window
3: Run icecast as a daemon process. |
| reverse_lookups integer |
0: Turns off reverse lookups of IP addresses.
1: Reverse lookup all ips to hostnames. |
| acl_policy integer |
0: Deny connections if no rule is given.
1: Allow connections by default if no rule is given. |
| logfiledebuglevel integer |
Debugging messages output to log file:
0: No debigging output
1: more
2: Even more output
...
..
6: Max debugging output |
| consoledebuglevel integer |
Debugging messages output to console:
0: No debigging output
1: more
2: Even more output
...
..
6: Max debugging output |
| streamtitletemplate string |
Template for stream title sent to client and
directory servers. The symbol "%s" will be replaced with the filename
of the current song. |
| accessfile file-name |
Access logging which can be parsed by Apache log file parsers. |
| templatedir directory-name |
HTML templates.
/usr/share/icecast/templates/ |
| http_admin integer |
0: No www admin access
1: Allow www admin access |
| include file-to-be-included |
Include the contents of another include file. |
| alias /directory-1 /directory-2 |
Server mount points set as the same logically. |
| mount_fallback integer |
0: Send message "HTTP 404 Stream Not Found" if not found.
1: Send default stream if not found. |
For more information and a full list of directives see the icecast manual.
See: http://node.your-domain.com:8000/admin?mode=help
Icecast command line directives:
Useage: icecast [options]
-
| Directive |
Description |
| -c configuration-file |
Command line parameters overide configuration file directives.
Default: /etc/icecast/icecast.conf |
| -P port-number |
Used for all client, source, and admin connections.
Default: 8000 |
| -m max-clients |
If exceeded, icecast will issue the error: 'HTTP/1.0 504 Server Full' |
| -p encoder-password |
Password used to deliver stream to server. |
| -b |
Run in background as a daemon process. |
| -d directory |
Configuration files.
i.e.: /etc/icecast |
| -V |
Full debugging. |
Shout configuration file directives for /etc/icecast/shout.conf:
Format: option value or option bool
where bool is yes/no, on/off or 1/0.
-
| Directive |
Description |
| port 8000 |
Same port as configured in icecast.conf.
Default: 8000 |
| server_name localhost |
Name of server. |
| password password |
Same as defined in the icecast.conf as the encoder password. |
| mount default |
Mount point for this stream/channel. (Other examples: rock, rap, etc)
Default: default |
| name name |
Name of this stream.
Default: Icecast Radio |
| desc text |
A description of the channel. |
| url URL |
Web address associated with this stream. |
| public bool |
If you want this published on a yp server lookup list.
Supported only if the icecast server has yp touch enabled. |
| genre genre |
talk, rock, rap, alt, techno...
Default: misc |
| playlist file |
Fully qualified file names to play. |
| loop bool |
true: Endless playing loop. |
| shuffle bool |
true: Shuffle playlist entries. |
| autodetect bool |
Check the file for bitrate info, before trying to stream it. If no, it will be sent at the default bitrate. |
| default_bitrate 128000 |
If different than file and autodetect is off, you get a mess. |
| force bool |
on: If file does not match the default_bitrate, skip file. |
| truncate bool |
. |
| update bool |
. |
| usedj bool |
. |
| djprogram file |
Program/script to run before every song. |
| usecuefile bool |
. |
| short_titles bool |
Trim path names from file names when using non ID3 data for stream title info. |
| title_streaming bool |
Turns title updates on or off. |
| id3 bool |
Use id3 tags for title streaming.
Requires: title_streaming yes |
| autocorrect bool |
Adapt the stream calculations to match each file's bitrate. |
| daemon bool |
yes: launched in the background. |
| verbose bool |
yes: Extra text output. |
Download source and see file shout.h for full list of directives and the defaults.
Sample: shout.conf
-
# Comments are valid
server_name localhost port 8000 password mypassword
mount default
name Radio_Linux
desc The_best_linux_music
genre Music
url http://www.your-domain.com/
public yes
short_titles yes title_streaming yes id3 no autocorrect yes
playlist shout.playlist_01 loop yes shuffle no
autodetect yes default_bitrate 128000 force no
daemon no verbose no
|
Signals:
- SIGINT: makes shout skip to the next song.
- SIGUSR1: makes shout reshuffle the internal playlist.
- SIGHUP: makes shout re-read its configuration file.
You may run multiple instances of shout, one for each channel. i.e.
http://localhost:8000/rock, http://localhost:8000/rap, etc...
using rock and rap etc as the different mount points.
Shout command line directives:
Useage: shout host-name [options]
-
| Directive |
Description |
| -B directory-name |
Base/root for all of shout's files.
Default: /tmp |
| -C configuration-file |
Specify a configuration file. |
| -D DJ-file |
Run this before every song. |
| -P password |
Specify encoder password.
Must match that specified in /etc/icecast.conf |
| -S |
Display all settings and exit. |
| -V |
Use verbose output. |
| -X description |
Use specified description. |
| -a |
Turn on automatic bitrate (transfer) correction. |
| -l |
Go on forever. Loop through playlist endlessly. |
| -p playlist-file |
Use specified file as a playlist. |
| -u URL |
Use specified url |
| -v |
Show version. |
| -z |
Go into the background (Daemon mode) |
| -t |
Enable title streaming |
To view all directives use the command shout -h.
MP3 MIME Types:
-
| MIME type |
Extension |
Description |
| audio/x-scpls |
pls |
Used by shoutcast.com for their MP3 streams |
| audio/mpegurl |
m3u |
Used by icecast.org for their MP3 streams |
| audio/x-mpegurl |
m3u |
Used by mp3.com for their MP3 streams |
| audio/mpeg |
mp3 |
|
| audio/x-mpeg |
mp3 |
|
| audio/mp3 |
mp3 |
|
| audio/x-mp3 |
mp3 |
|
Testing with the Xmms client:
Testing with the FreeAmp client:
- Attaching FreeAmp to a streaming server:
- freeamp http://216.226.139.62:8016
MP3 Streaming Stations: See http://www.live365.com
Clients:
Directories of MP3 Streaming Stations: (pick one and listen)
Audio Streaming Servers:
- IceCast.org - Open Source MP3 and OggVorbis Streaming Server
- Shoutcast.com - Commercial MP3 Audio streaming
- DarkIce -
Live streamer - Takes live input from a soundcard, encodes it and sends
the encoded stream to an IceCast server. DarkIce uses an external mp3
encoder.
- AmpJuke - Web based.
Uses Apache, MySQL and PHP. AmpJuke streams music files to one or more
clients using the HTTP-protocol. Scanning and import of music stored in
the MP3, OGG, WMA and/or APE format.
- Ampache - Web-based
Audio file manager. Implemented with MySQL, and PHP. It allows you to
view, edit, and play your audio files via the web. Supports playlists,
artist and album views, album art, random play, playback via Http/On
the Fly Transcoding and Downsampling.
- kPlaylist.net - PHP interface to a streaming web site (ogg, mp3, wav, ...) Allows upload, creation of playlists, share, search and download.
- Agatha - Stream music and playlists
- Edna - MP3 streaming
- Fluid - MP3 streaming server written in JAVA
- Streamcast - Supports ID3 tags, mountpoints. The PHP-stream version is a database enabled version of streamcast.
- netjukebox - Web based Winamp/httpQ media jukebox.
Stream encoders:
- Comparason of MP3 encoders on Linux
- Shout - MP3 stream encoder from the icecast site
- LiveIce - Provide "Real Time" streams for icecast.
- MuSE - Desktop GUI
application for the mixing, encoding, and network streaming of sound.
Can use 6 encoded audio bitstreams (from files or network) plus a
souncard input signal to be played locally or encoded for broadcast.
Also hadles Ogg Vorbis.
Support tools:
Ogg Vorbis Encoders:
Other Links:
|