Archive for August, 2007

Setting up Darwin Streaming Server – Part 2

August 22, 2007

Part 1 can be found here.

Darwin Streaming Server documentation states that the video clips that need to be streamed should be under the Movies folder. This, on Windows, is C:\Program Files\Darwin Streaming Server\Movies. When the server receives a RTSP request for a video clip, it checks this folder for that file. What is not documented is that the server looks recursively under the sub-folders for the requested video clip.

So, if you have folders like Songs, FunnyVideos etc. under Movies folder, Darwin server will be able to stream all video clips under these sub-folders. Catch: These sub-folders should not contain spaces! If a sub-folder ‘Funny Videos’ is present under Movies folder and you request for a file which is under ‘Funny Videos’, Darwin server will return a 404 Not Found error.

I wonder why this is not included in Darwin Streaming Server documentation.

Main Form loses focus

August 16, 2007

Apologies if this post comes across as naive. I recently put my foot into the Windows Forms world and I have been learning new things. This might be a problem which all GUI programmers have encountered on day one and also know the solution to it. This post is to those souls like me who make a late entry into this magical world and seem to get lost, err… lose focus.

Problem:

We have a main form called MainForm. Whenever the user clicks a button on this MainForm, a method Copy in a class HelperClass is called. This method Copy uses the kernel call FileSystem.CopyFile to carry out the copying. One reason to use the kernel call is you need not re-write the progress bar and cancel features, just reuse the features provided by the kernel call. This will display the standard Windows file copying dialog with a cancel button.

The problem is, whenever you click Cancel on the file copying dialog, the MainForm loses focus.

Solution:

Since we are using the file copying dialog provided by the kernel, we have no access to the dialog directly. Hence, we cannot set the MainForm as the owner of the file copying dialog.

The solution to this problem is, in MainForm, right after we make a call to Copy method, set the focus back to MainForm.

    Copy(source, destination);
this.Focus();

Problem solved.

How to setup Darwin Streaming Server on Windows

August 7, 2007

PS: Part 2 of this article can be found here.

What is Darwin Streaming Server?

Darwin Streaming Server is an open source, free to use streaming server from Apple. The commercial version of this server is the Quick Time Streaming Server.

Where do I get it from?

The Darwin streaming server source code can be downloaded here. You need an Apple ID for this. Registration is free – go get an Apple ID for yourself.

How do I install?

Once you download the source code, you will see a install.bat in the root directory. Just double click on it and the batch file will copy the necessary files under C:\Program Files\Darwin Streaming Server. This is all the installation required.

How do I start streaming?

Along with the source code, Apple ships a few sample video clips which are ready to be streamed. All these video clips are under the C:\Program Files\Darwin Streaming Server\Movies folder. You can stream any of these video clips and view it on a player. Open up a command prompt. Go to C:\Program Files\Darwin Streaming Server and start Darwin server by typing DarwinStreamingServer.exe -d. If all is fine, you will get some INFO messages and a message that says ‘Streaming Server done starting up’. This means the server is up and ready to accept client connections.

If you get an error something like ‘WARNING: Another process is already using the following RTSP port: 554′, then the Darwin Service is already running in the background and you don’t have to start the server explicitly.

Your server is ready and all set to stream.

How do I connect using a player?

VLC Player: File->Open Network Stream. Select RTSP and give the URL as rtsp://localhost:554/sample_100kbit.mp4

QuickTime player: File->Open URL. Give the URL as rtsp://localhost:554/sample_100kbit.mp4

If all is fine, you should see an animated ‘Q’ – logo of Quick Time.

More info?

Google is of course there.

Administrator’s guide.

FAQ.

Darwin users mailing list.