1. What is Streaming?
2. What is Darwin?
3. Getting hold of the program
4. Installation
5. Configuration
6. Testing
7. Ending Note

Streaming on the Internet is the process of delivering media content in a way very similar to radio. There are two ways of getting media to your desktop, you can either download the whole file or get it in chunks as you need it, this second method is called streaming. Streaming has many advantages including better control over content as it as not saved to the computer and happier users; they get media quality appropriate to their connection speed and they can start viewing/listening within a few seconds of starting the stream. In other words streaming allows on demand media delivery. The main drawback is that depending on internet traffic and the server load streams may break up or be stopped completely. To get round this you can restrict the number of simultaneous users that can access your server. Finally another great feature is the way you can broadcast live media, this is out of the scope of this tutorial.

Technically speaking, Darwin is the codename for Apple's Mac OS UNIX based kernel. What this article is about is Darwin Streaming Server, DSS for short. Why would I want DSS you ask? DSS is the only open source and freely distributed audio/video streaming server available that works with industry standards, built upon a reiliable commercial product. For the icing on top there is no per-connection licensing restriction. All this means that within half an hour you can have DSS setup and streaming your media out to your LAN, or the unforgiving world! At present the most current version is v 5.5.

All you need to get going is a box with SME 6 or higher installed (SME 5.x may work but is not tested) and some Quicktime files to stream. Just to say, I don't work for Apple and I hope this doesn't sound like a plug, but, I would reccomend you get hold of a copy of Quicktime Pro, it will only cost you the grand sum of $29.99 (€25 / £17), this will allow you to convert virtually any type of media into a Quicktime Movie file suitiable for streaming.

Here lies the biggest problem for SME users, the binaries provided by Apple are only compatiable with Redhat 8 or newer due to the version of glib that they were compiled with, this is a problem as SME 5.x/6.x are based upon Redhat 7. As you may or not know the default SME server has no compilers to get around this problem by compiling from source. However there is a way to get round this, I found an unofficial binary of DSS 4 on the Apple mailing lists at http://www.heapsys.com/ftp/DarwinStreamingSrvr4.1.3-Linux.tar.gz. Download this and you are good to go.

It is likely that SME 7 will have a more up-to-date glib package and will therefore run the most current binary, v 5.5. This is available from http://developer.apple.com/darwin/projects/streaming/. You will need to do a free registration before you can download.

Whichever route is taken the installation appears to be the same. The features available are virtually the same between the two versions, however, it is claimed v 5.5 has enhancements to improve stream quality.

This installation assumes you are using the DSS 4 binary, if you are not, the only thing that changes is the name of archive and folder.

Installation is simple, unpack the contents of the tar file you downloaded to anywhere you want, in my case I dumped it in /tmp. Make sure you either login as root or issue each command with su - install will not run if you are not an admin! So, you would issue the following command:

cp /my-ftp-dropbox/DarwinStreamingSrvr4.1.3-Linux.tar.gz /tmp

cd /tmp

tar -xvzf DarwinStreamingSrvr4.1.3-Linux.tar.gz

Next enter the directory:

cd DarwinStreamingSrvr4.1.3-Linux

To install simply issue:

./Install

This will install the DSS and a separate server for Administration.

Text will scroll on the screen until it prompts for a username. This username will be used to log in to the Admin Web Interface later on. After this you will be prompted for a password to go with the username. Once this is done the installation is complete.

The Administration server and the DSS itself appear to be started by:

streamingadminserver.pl

After installation this will be executed immediately, however this will not restart at boot, to fix this you need to add the command above to /etc/rc.d/rc.local.

That should be it for installation.

Configuration is achieved through a web-based administration interface. To get to it, point your browser to http://your-sme-server:1220, the :1220 is needed because the Admin server runs on port 1220.

Before continuing I would recommend creating an ibay to put all your media files in. To make things easy make it read and write for everyone, you can always lock it down later on.

Now you can Login using the details you provided during installation, go to the Admin server on port 1220 and follow the steps. Do not enable streaming on Port 80 as this will clash with your Apache server (unless you have it running on another port). Make sure you change the media path to the full path of your media ibay, on my box the path was:

/home/e-smith/files/ibays/media/files/ (Replace media with the name of your ibay if it is different)

The rest of the steps are simple and in reality to get the server working no other settings need to be changed. Once you have finished this we are going to test this server.

EDIT: I have had some reports of rtsp steaming not working on fresh installs, this appears to be a firewall problem. Make sure you have TCP port 554 open for it to work.

First upload some content to your media ibay (if you created one). It can be any size/length that you want, however it does need to be 'hinted'. Hinting according to Apple can be done from most authoring programs. To hint a file, open it as usual and choose Export from the File Menu. Choose Movie to Quicktime Movie from the dropdown. Under options make sure 'Prepare for Internet Streaming' is checked and Hinted is chosen from the dropdown. After this, save the file to the media ibay.

If you don't have these facilities but still want to test your server then you can copy one of the sample files that Apple kindly include in the original extracted folder. Copy one or more of these files to your ibay, for example I would issue the following command on my machine to copy one of the samples over:

cp /tmp/DarwinStreamingSrvr4.1.3-Linux/sample_300kbit.mp4 /home/e-smith/files/ibays/media/files

Now that you hopefully have some media in place to test, there are two ways to go, you can either view the file in Quicktime or embedded in an HTML page. I will cover both in this How-To.

To view in Quicktime go to File > Open URL in New Player and type:

rtsp://your-sme-server/media_file_name.extension (eg. rtsp://intranet/sample_300kbit.mp4)

Hopefully in a few seconds you will see your file play. If it doesn't make sure the path is correct and that the server is started.

What does rtsp mean? rtsp stands for Real Time Streaming Protocol, it is a non-proprietary standard developed to transport streaming media, however the distinction to make is that the data is carries may be proprietary, for example the RealPlayer format.

As promised, to embed in a HTML document, insert the following code into a blank file:

<html>
<head>
<title></title>
</head>
<body>
My First Streaming enabled webpage!<br />
<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="sample.mov">
<param name="qtsrc" value="rtsp://intranet/streaming_demo.mp4">
<param name="autoplay" value="true">
<param name="loop" value="false">
<param name="controller" value="true">
<embed src="sample.mov" qtsrc="rtsp://intranet/streaming_demo.mp4" width="320" height="256" autoplay="true" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/">
</embed>
</object>
</body>
</html>

Save the file with in a web-enabled ibay with a .htm or .html extension (you could also use .php). Sample.mov is a placeholder that gets around the fact that not all browsers support the qtsrc tag immediately, setting the source as sample.mov invokes Quicktime which then enables the required functionality in the browser. sample.mov is simply a blank file (a blank text file will do) which has the extension of .mov. If you do not put it in the same folder as the HTML then you will need to change the path in the src tag.

If you want to create the effect where you see an image you click on to start the movie, then create a movie from an image in Quicktime (open an image and export it as a movie like above, except not optimised for streaming) and use this in place of sample.mov.

The value sample.mov can be changed to anything you want, it is just what i used in the example.

Change qtsrc to the value of your rtsp://server/file. Change the width and height properties as required to fit in with your media.

Open the file like any other HTML document using your web browser and you should get your media file streaming to your webpage....

Thanks for giving this little article a read, I hope it is useful, it is the result of hours of experimentation! For further help I would recommend looking at http://developer.apple.com/darwin/projects/streaming/qtss_admin_guide.pdf. If you are really pleased with your new server, perhaps you can show it off and put a Darwin badge on your site using the logo at http://www.apple.com/about/webbadges/? Finally, good luck and if you have any problems I can be contacted at t-o-m-w-e-r-n-e-r at gmail dot com (remove the - 's!)

'Apple' is Copyright © 2005 Apple Computer, Inc. All rights reserved.