How to setup a streaming multimedia server

From Salix OS
Jump to: navigation, search

Contents

What is Icecast

Icecast is free server software for streaming multimedia. Icecast, is a program that streams audio data to listeners

What is ices

IceS, is a program that sends audio data to Icecast servers Ices comes in two flavors,

  • the 0.x flavor which supports sending an MP3 stream to an icecast server, and
  • the 2.x flavor which supports sending an Ogg Vorbis stream to an icecast server.

Obtain a dyndns domain

  • "Obtain a DNS domain" and create one with a dynamic dns provider (e.g. dyndns.org)
  • Port forward tcp, udp port 8000 using your router interface

Getting and Installing icecast

Download icecast binary package from http://people.salixos.org/djemos/icecast/icecast-2.3.2-i486-1dj.txz
There is also SLKBUILD file here http://people.salixos.org/djemos/icecast
Install icecast with command:

installpkg icecast-2.3.2-i486-1dj.txz

Getting and Installing ices

ices 0.4

If you want to stream MP3 files to icecast server then
Download ices 0.4 binary package from http://people.salixos.org/djemos/ices/ices-0.4/ices-0.4-i486-1dj.txz
SLKBUILD is here http://people.salixos.org/djemos/ices/ices-0.4/
deps are gcc-g++,faad2,gcc,lame,libmp4v2,libogg,libshout,libtheora,libvorbis,libxml2,speex,zlib
Install ices with command:

installpkg ices-0.4-i486-1dj.txz

ices 2.0.1

If you like to stream OGG files to icecast server then
Download ices 2.0.1 binary package from http://people.salixos.org/djemos/ices/ices-2.0.1/ices-2.0.1-i486-1dj.txz
SLKBUILD is here http://people.salixos.org/djemos/ices/ices-2.0.1/
deps are alsa-lib,libogg,libshout,libtheora,libvorbis,libxml2,speex,zlib
Install ices with command:

installpkg ices-2.0.1-i486-1dj.txz

Setting up icecast config file

Open file /etc/icecast.xml and change some settings:

  • <source-password>hackme</source-password> to whatever you like
  • <relay-password>hackme</relay-password> to whatever you like
  • <admin-user>admin</admin-user> to whatever you like
  • <admin-password>hackme</admin-password> to whatever you like
  • <shoutcast-mount>/live.nsv</shoutcast-mount> to whatever you like, if it is not set then default /stream will be used
  • <hostname>localhost</hostname> to your dynamic domain name e.g. mediaserver.dyndns.org
  • <!-- <changeowner> <user>nobody</user> <group>nogroup</group> </changeowner> --> remove <!-- and -->

Save file /etc/icecast.xml and start icecast server as root with command:

icecast -b -c /etc/icecast.xml

Setting up ices 2.0.1 config file

Open file /etc/ices.xml and change some settings:

  • <background>0</background> change 0 to 1 if you want ices to run in background
  • <name>Example stream name</name> to whatever you like
  • <genre>Example genre</genre> to <genre>mixed</genre>
  • <description>A short description of your stream</description> to whatever you like
  • if you want random play change <param name="random">0</param> to <param name="random">1</param>
  • <hostname>localhost</hostname> to your dynamic domain name e.g. mediaserver.dyndns.org
  • <password>hackme</password> change "hackme" to same password you gave above for icecast server
  • <mount>/example1.ogg</mount> change /example1.ogg to whatever you like (e.g. /live.ogg)

Now pay attention. Set the following to the values shown bellow

  • <nominal-bitrate>32000</nominal-bitrate>
  • <samplerate>22050</samplerate>
  • <channels>2</channels>

Save the file.

Making the OGG playlist

There is a line in config file <param name="file">playlist.txt</param> we have to create a file playlist.txt with contents the paths with names of ogg files we like to stream. you can do this with find command

find PATH_to_OGG_DIR  -name *.ogg > playlist.txt

Next start ices with command as user:

ices /etc/ices.xml

Open firefox and type in address bar http://yourdynamic_dns:8000
You will see icecast server and will be asked for user name and password. Give what you have set in config file.
Open with a media player (clementine, vlc etc) the stream URL ( http://yourdynamic_dns:8000/mount-point) you have set (e.g. http://ariadni.dynalias.net:8000/live.ogg.m3u) and listen to your radio station.

Setting up ices 0.4 config file

Open file /etc/ices.conf and change some settings:

  • <Randomize>1</Randomize> Set this to 0 if you don't want to randomize your playlist, and to 1 if you do
  • <Background>0</Background> if want Set this to 1 if you want ices to launch in the background as a daemon
  • <Hostname>localhost</Hostname> set this to your dynamic domain name (e.g <Hostname>ariadni.dynalias.net</Hostname>)
  • <Password>letmein</Password> set the password to the same password you set above for icecast server
  • <Mountpoint>/ices</Mountpoint> change this to to whatever you wrote above to icecast server mount point.
  • change <Name>Default stream</Name> to whatever you like
  • <Genre>Default genre</Genre> to <Genre>mixed</Genre>
  • <Description>Default description</Description> to whatever you like
  • <URL>http://localhost/</URL> change this to your dynamic domain name
  • <Public>0</Public> to <Public>1</Public>

Now pay attention. Set the following to the values shown bellow

  • <Bitrate>32</Bitrate>
  • <Reencode>1</Reencode>
  • <Samplerate>22050</Samplerate>
  • <Channels>2</Channels>

Save the file.

Making the MP3 playlist

There is a line <File>playlist.txt</File>. Be careful. If use absolute paths e.g. File>/home/dimitris/playlist.txt</File> can run ices from everywhere, otherwise have to run ices from the directory where playlist.txt exists. We have to create file playlist.txt. It is the list of mp3 files we like to stream. you can do this with find command

find PATH_to_MP3_DIR  -name *.mp3 > playlist.txt

Next start ices with command as user: (We have to start ice from directory contenting playlist.)

ices -c /etc/ices.conf 

with -c can use different config files than default /etc/ices.conf If we use /etc/ices.conf and have absolute path for playlist.txt then to run ice it is so simple:

ices

Open firefox and type in address bar http://yourdynamic_dns:8000
You will see icecast server and will asked for user name and password. Give what you have set in config file.
Open with a media player (clementine, vlc etc) the stream URL ( http://yourdynamic_dns:8000/mount-point) you have set (e.g. http://ariadni.dynalias.net:8000/live.m3u) and listen to your radio station.
Send your http://dynamic_domain:8000/mount_point by email to your friends to connect and listen to your radio station.