A little bit of everything answered here. : mp3StreamingServer

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2007-10-08 09:27:04 by JimLucas

Additions:

Setup MP3 Server

Setup Source Client

Setting up your playlist





Edited on 2007-10-08 09:09:33 by JimLucas

Additions:
These notes should help set up an mp3 server on an OpenBSD system, I used version 41. The software used is icecast (the server) and ices (the source client, the thing that actually produces the audio stream from your mp3s).
pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/icecast-2.3.1.tgz

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/ices-0.4p1.tgz


Deletions:
These notes should help set up an mp3 server on an OpenBSD system, I used version 3.9. The software used is icecast (the server) and ices (the source client, the thing that actually produces the audio stream from your mp3s).
pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/icecast-2.3.1.tgz

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/ices-0.4p0.tgz




Edited on 2007-10-08 08:02:56 by JimLucas

Additions:
pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/icecast-2.3.1.tgz

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/ices-0.4p0.tgz

/usr/local/bin
/usr/local/examples

useradd -c "Icecast Server" -d /nonexistent -g =uid -s /sbin/nologin -u 400 _icecast

mkdir /var/icecast

cp -R /usr/local/share/examples/icecast/* /var/icecast

cd /var/icecast
mkdir log
touch log/error.log log/access.log
chown _icecast:_icecast log/*.log

mkdir /var/icecast/etc
cp -p /etc/{hosts,localtime,resolv.conf} /var/icecast/etc

mv icecast.xml.dist icecast.xml
chmod 600 icecast.xml

icecast -c /var/icecast/icecast.xml

/usr/local/bin/ices
/usr/local/share/ices/ices.py.dist

find /path/to/files -name '*.mp3' > playlist.txt

icecast -b -c /var/icecast/icecast.xml

ices -c /var/ices/ices.conf -F playlist.txt

http://machinename:8000/ices//
/usr/local/bin/icecast -b -c /var/icecast/icecast.xml


Deletions:
# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/icecast-2.3.1.tgz
# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/ices-0.4p0.tgz
/usr/local/bin
/usr/local/examples
# useradd -c "Icecast Server" -d /nonexistent -g =uid -s /sbin/nologin -u 400 _icecast
# mkdir /var/icecast
# cp -R /usr/local/share/examples/icecast/* /var/icecast
# cd /var/icecast
# mkdir log
# touch log/error.log log/access.log
# chown _icecast:_icecast log/*.log
# mkdir /var/icecast/etc
# cp -p /etc/{hosts,localtime,resolv.conf} /var/icecast/etc
# mv icecast.xml.dist icecast.xml
# chmod 600 icecast.xml
# icecast -c /var/icecast/icecast.xml
/usr/local/bin/ices
/usr/local/share/ices/ices.py.dist
# find /path/to/files -name '*.mp3' > playlist.txt
# icecast -b -c /var/icecast/icecast.xml
# ices -c /var/ices/ices.conf -F playlist.txt
http://machinename:8000/ices
/usr/local/bin/icecast -b -c /var/icecast/icecast.xml




Edited on 2007-10-08 07:59:55 by JimLucas

Additions:
I got this from http://www.ralph-moseley.co.uk/blog/?page_id=55

Deletions:
I got this from http://www.ralph-moseley.co.uk/blog/?page_id=55



Oldest known version of this page was edited on 2007-10-08 07:59:39 by JimLucas []
Page view:
I got this from http://www.ralph-moseley.co.uk/blog/?page_id=55
OpenBSD MP3 Server

These notes should help set up an mp3 server on an OpenBSD system, I used version 3.9. The software used is icecast (the server) and ices (the source client, the thing that actually produces the audio stream from your mp3s).

The easy way to do this is to use pkg_add as root:

# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/icecast-2.3.1.tgz

and

# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/ices-0.4p0.tgz

The files for Icecast are placed in:

/usr/local/bin
/usr/local/share
/usr/local/doc
/usr/local/examples

The first thing to do is to create a new user for the server:

# useradd -c "Icecast Server" -d /nonexistent -g =uid -s /sbin/nologin -u 400 _icecast

Now we need to create a directory for Icecast.

# mkdir /var/icecast

Copy the example configuration files into the new directory:

# cp -R /usr/local/share/examples/icecast/* /var/icecast

Icecast needs to make several log files in specific locations which are accessible to the user that was just created:

# cd /var/icecast
# mkdir log
# touch log/error.log log/access.log
# chown _icecast:_icecast log/*.log

Next the chroot environment has to be made with additional system file, optional, but it allows YP directory listing to work and the log files will contain correct timestamps.

# mkdir /var/icecast/etc
# cp -p /etc/{hosts,localtime,resolv.conf} /var/icecast/etc

Find icecast.xml.dist in /var/icecast:

# mv icecast.xml.dist icecast.xml
# chmod 600 icecast.xml

(Mode 600 is highly recommended; icecast.xml contains plain-text passwords. At least keep it inaccessible to “others”.)

Edit icecast.xml in your favorite editor:

* CHANGE THE DEFAULT PASSWORDS FOR SOURCE CLIENTS, RELAYS AND
THE ADMIN INTERFACE

* Change to /var/icecast

* Change to /log
* Change to /web
* Change to /admin

* Change to 1
* Uncomment the directive, replace both “nobody” and
“nogroup” with “_icecast”.

Start Icecast and monitor error.log for errors and clues on how to solve any issues.

# icecast -c /var/icecast/icecast.xml

If things look good, add the command line parameter `-b’ to send Icecast into daemon land.

Test the server: Use a source client to create a stream and listen to it with your favorite player that supports streaming. Also test Icecast’s web interface. Be aware that Icecast sends everything located in to those who request it like a regular (basic) web server. You can restrict this behavior to serve only .xsl files by setting to 0 in your icecast.xml, however, you should definitely take a closer look at what you actually want to show the world here. There is no reason for paranoia, it’s all safe, but you should spend some time thinking about it. Note that disabling will also prevent CSS stylesheets and images from being sent, making the web interface less pleasant to look at.

You now need to set up the source client such as ices for the mp3 audio stream.
When you have used the pkg_add above the files are placed in:

/usr/local/bin/ices
/usr/local/man/man1/ices.1
/usr/local/share/doc/ices/icesmanual.html
/usr/local/share/examples/ices/ices.conf.dist
/usr/local/share/ices/ices.pm.dist
/usr/local/share/ices/ices.py.dist

As before you can copy the example config file into /var/ices/ and make a log directory together with error.log and access.log.

Alter the configuration file you may have placed in /var/ices to correspond to your Icecast configuration changing the password you have set for the source.

The main thing is that ices can find the configuration file and a playlist when it starts up.

if you have all your mp3s in one directory you could create a test playlist by:

# find /path/to/files -name '*.mp3' > playlist.txt

To get it all going start Icecast as before under root (it changes to the new user itself!).

# icecast -b -c /var/icecast/icecast.xml

You could then check it is running by checking the html server page, as before. Next start Ices:

# ices -c /var/ices/ices.conf -F playlist.txt

When you are sure this is working you can move it into the background by adding a -B option (note: it’s uppercase, -b is an option for bitrate!).

On another machine try and plug into the stream with software such as RealPlayer, Audion, iTunes, XMMS and point at:

http://machinename:8000/ices

replacing machinename with the hostname of your computer, or its IP address. 8000 is the socket you specified and /ices is the mountpoint.

To make icecast run after boot add the following line to your /etc/rc.local:

/usr/local/bin/icecast -b -c /var/icecast/icecast.xml

If you want multiple streams running it’s just a matter of pointing ices at different configuration files with alternative mount points and, if you like, different stream details.

Hope this saves you some annoyance and time — Good Luck!
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.2734 seconds