Creating a Server


You have the authoring computer's Winamp encoder ready to crank out your MP3-encoded live stream. Now you need to connect to a server so that listeners on the Internet can hear it. Naturally, you must make some decisions regarding the type of server you will use. How many concurrent (simultaneous) listeners do you need to be able to serve, and at what bit rate? Multiplying the number of concurrent users times the streams' bit rate will provide the total bandwidth requirements for your server scenario.

This test case runs the server computer from home using a 384Kbps sDSL (s for synchronous, meaning 384Kbps upload and download). It is encoding at a bit rate of 32Kbps and supports 10 concurrent listeners. Multiplying the number 10 (listeners) times 32 (the encode bit rate) comes out to around 320Kbps, leaving a little headroom for other tasks, such as testing the streams. Know how much upload bandwidth you have available. Most DSL connections are actually aDSL (a for asynchronous) and usually have much higher download than upload speeds. Check with your ISP customer support to verify your data rates.

If you're using co-located (third-party) server facilities, place limits on the number of users your server will accept. Just because the collocation server facility has the bandwidth to support hundreds of users doesn't mean you should use it. You'll be charged by user access and, if your stream is popular, that can quickly add up to lots of money. Start small.

For live stream authoring, you must use a real-time streaming server such as SHOUTcast or Icecast, which are available for all of the popular operating systems. For serving on-demand files, you can use either of these for real-time streaming of on-demand files or any Web server (via HTTP/Progressive streaming). For the purposes of this book, you'll be using the SHOUTcast server for both.

NOTE

MP3 on-demand files can be streamed through HTTP/Progressive streaming from a Web server. See Chapter 2 for an explanation of the differences between progressive (for on-demand only) and real-time (both on-demand and live) streaming. See Chapter 7 for examples on how to do both.

One feature that the SHOUTcast server has over a Web server when streaming on-demand files is that it becomes more difficult for listeners to save copies of your content. The SHOUTcast server does this by only allowing certain client players to request the stream, disallowing the Web browser from saving it to a local file. This limitation has workarounds, but it's a good first line of defense against people saving your MP3-encoded on-demand files.


For more information on issues relating to streaming servers, see Chapter 7.

Other MP3 Streaming Servers

SHOUTcast is just one of many servers that support on-demand and live streaming MP3-encoded audio. RealMedia, Windows Media and QuickTime have varying capabilities for using the MP3 codec. When MP3 files are served via real-time streaming from RealMedia, Windows Media, or QuickTime servers, the corresponding players to these formats must be used to play the streams. For example, iTunes cannot play back a Windows Media MP3-encoded stream. The great advantage to using SHOUTcast to encode MP3 streams is that 99% of all the common MP3 players can hear it.

SHOUTcast's closest cousin is Icecast, which is fully compatible with SHOUTcast. Icecast is more of an open-source project, making it easy for software developers to contribute new features. Advanced users can create extensive tools to perform various tasks. With Icecast, developers can easily fine-tune the authoring of live streams from static files (unlike SHOUTcast, which must encode through Winamp) and run those files from remote locations. Icecast's liveice tool supports cross fades and live mixing for live MP3 streams. While Icecast is not as user friendly as SHOUTcast (and other formats) that support MP3-streaming, it does offer more flexibility for advanced users. Go to www.icecast.com to learn more about this suite of tools.

Installing a SHOUTcast Server

SHOUTcast is a popular and free server for streaming live and on-demand MP3-encoded files. It's possible to turn your collection of MP3 files into rotating (and repeating) playlists for users to hear online. This is one way to become an Internet radio station.

NOTE

Older versions of the SHOUTcast server cannot stream on-demand MP3-encoded files, so make sure you're using the latest version.


The Server can run on Windows, Mac OS X, Unix (FreeeBSD, Linux, and Solaris) platforms. This chapter uses the SHOUTcast server v1.8.3 for Windows and FreeBSD.

NOTE

Due to size constraints, this book can only cover the basic processes to stream MP3-encoded on-demand files and live audio. Many deeper levels of complexity and flexibility are available for these applications and their processes. Refer to the README file in your SHOUTcast Download folder for detailed installation, configuration, and operation instructions for SHOUTcast tools. Novice Unix users especially will find this helpful.


Go to www.shoutcast.com/download and click on Be a Server.

graphics/01icon04.gif

Download and run the installer, which puts an entry in your Startup menu. Launch the SHOUTcast server by selecting Start, Programs, SHOUTcast DNAS, SHOUTcast DNAS GUI. Click Edit config. The default text editor (most likely Notepad) opens the configuration file for the SHOUTcast server. Follow the Step-by-Step tutorial that follows.

graphics/01icon03.gif

Download and unpack. Edit the sc_serv.conf file according to the Step-by-Step tutorial.

STEP-BY-STEP: Configuring a SHOUTcast MP3 Server

  1. Open the SHOUTcast server's configuration file, as noted earlier (see Figure 6.17).

    Figure 6.17. The SHOUTcast DNAS server configuration is accomplished by editing a text file.

    graphics/06fig17.gif

  2. Set MaxUser to 10. This specifies how many concurrent users can connect to your server.

    NOTE

    Setting the MaxUser value appropriately ensures that your server's Internet connection isn't overloaded. The scenario mentioned earlier assumes enough bandwidth to support 10 concurrent users with 32Kbps streams. Remember that even though you set MaxUser to 10 doesn't automatically mean that 10 x 32Kbps (320Kbps) is in use at all times. The server only uses bandwidth for actively connected users.

  3. Set the SHOUTcast server's Password to something other than the installer default value. Anyone who is broadcasting a live stream to this server will need this password to connect.

  4. The PortBase value can be left at its default setting of 8000. This value will also be needed for anyone who is broadcasting a live stream through your server.

  5. The rest of the values can be left as they are for regular operation. (Feeling adventurous? If you want to play with some neat stuff, take a look at the IntroFile setting.)

  6. After you are finished making the necessary changes, save the file and exit your text editor.

  7. Close the text editor and start the SHOUTcast server application.

    graphics/01icon04.gif Windows users need to stop the server by choosing Kill Server from the SHOUTcast server console menu. If you accidentally closed the console window, you can bring it back by clicking on the SHOUTcast icon in your system tray (next to the clock). After successfully closing the server, select Start, Programs, SHOUTcast DNAS, SHOUTcast DNAS GUI to start it back up using your new configuration file.

    graphics/01icon03.gif Unix users simply start the server (named sc_serv) for the first time. If you had started it earlier, you would need to stop and restart it so that it will use your new configuration settings.

  8. With your server running, open a Web browser to access the SHOUTcast Administrator (see Figure 6.18). Go tohttp://servername:port, where servername is the name (or IP address) of your server, and port is the install port (typically 8000). This Web page shows a page with stream status and a link to test the stream. (Click Listen.) The SHOUTcast Administrator also allows you to log in (using the password you set for the server) and perform various administration tasks, including editing restrictions on who can listen, view log messages, and so on.

    Figure 6.18. Access the SHOUTcast Administrator through your Web browser.

    graphics/06fig18.gif

With your SHOUTcast server configured and running, make your on-demand files available for streaming by uploading them into the Content subdirectory where the SHOUTcast server software resides.

NOTE

graphics/01icon04.gif

There is a bug in version 1.8.2 of the SHOUTcast server for Windows that requires you to include a trailing slash on the directory that you specify for ContentDir (used to enable on-demand streaming). For example, ContentDir=C:\Program Files\SHOUTcast\content\.


For live streams, configure the encoder on your authoring computer to match your server name, port, and password settings.

FezGuys' Tip

graphics/01icon02.gif

Although you need a separate SHOUTcast server for each live stream that you want to receive, more than one server can be run on different ports on a single server computer. See the SHOUTcast configuration file and documentation for more information on how to do this.



Streaming Audio. The FezGuys' Guide
Streaming Audio: The FezGuys Guide
ISBN: B000H2N1T8
EAN: N/A
Year: 2001
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net