Embedding Streams using HTTP and Quicktime



Using Quicktime to export video for WI-FI, 4G LTE and 3G

How to encode video for streaming mobile delivery using Quicktime Pro






So between 2003 – 2010 or so, Gravitylab made a decent living deploying  Apple’s open source streaming server, Darwin Streaming Server (DSS)

Over the years, I clipped things off the web; things like tech manuals, and development notes. This is one of those clips, a mashup of setup options for Darwin Streaming Server for live HTTP streaming.

QuickTime Player and Darwin Streaming Server support two primary transport methods for streaming:

  1. RTSP/RTP streams use standard IETF streaming protocols to stream video and audio to clients. The Streaming Server supports QuickTime .mov, MPEG-4 .mp4 and 3G .3gp files for on-demand streaming. In addition, the Streaming Server can reflect live streams and playlists using Session Description Protocol .sdp files. Linking to RTSP/RTP streams is described in the Embedding RTSP/RTP Streams section below
  2. MP3 streams used the Shoutcast protocol for streaming mp3 files over http. The Streaming Server supports streaming MP3 playlists from locally stored MP3 files and reflecting live MP3 streams from Shoutcast compatible webcasting software. Linking to MP3 playlists and live MP3 webcasts is described in Linking to mp3 streams below.


[vc_separator separator_type=”thick_solid”]

Precise Commands and Settings to deploy live HTTP streaming video using Darwin Streaming Services

The Movie URL should be an http URL to a file on a web server (relative or absolute URLs are OK).

This file will be either a poster movie the client clicks on to play the stream, a reference movie to the stream, or a placeholder movie that will be replaced by the stream. Options are covered below.

The MovieWidth and MovieHeight attributes are measured in pixels.

You should add 16 to the height if you want do display the QuickTime playback controller for the movie.

The ActiveX Version should be left blank. The attribute name value pairs are described in detail on Apple’s site here.


[vc_cta_button call_text=”Need reliable streaming video encoding?” title=”Start Today” target=”_self” color=”btn_red” icon=”none” size=”btn-large” position=”cta_align_right” href=”http://gravlab.com/plans.html”]





One way to embed a streaming movie is with a poster movie. The client clicks on the poster movie to start the stream. The poster movie can be a file in any format that QuickTime can open (usually a still image).


Poster movies are usually used with the target attribute. Using the target attribute, the movie can play in the same space as the poster movie (target set to ‘myself’) or in QuickTime Player (target set to ‘quicktimeplayer’). The url that plays when the poster movie is clicked is set by the href attribute. The following code is used to create a poster movie that will play the stream in the same space as the poster image (target is set to ‘myself’):


Note: A good format to use for a Poster Movie is a .qtif file. The qtif file format is an image file format that only QuickTime understands, so it is unlikely to be hijacked by other players. In addition, setting the mime type with the ‘type’ attribute to insure the QuickTime plugin will get control. Most image formats can be converted into a qtif files with QuickTime Pro and PictureViewer (Classic Mac OS and Windows) or Preview (Mac OS X). Setting the ‘controller’ attribute to ‘true’ displays only the image without the playback controller. When the user clicks on the picture the controller will be displayed. If you want to keep the controller hidden, the attribute ‘saveembedtags’ can be set to ‘true’.

Embedding a stream using a Reference Movie
Another way to embed a streaming movie is with a reference movie. There are a variety of ways to create reference movies, which function like pointers to the actual media. The simplest way to create a reference movie is with QuickTime Pro:

If you don’t have QuickTime Pro, you can create a simple reference movie with any text editor. Just create a text file with one line in the following format:RTSPtextRTSP:///

Save the file with the .mov extension.

Reference movies can also be used to create “movie alternates.” This sophisticated capability of QuickTime allows you to have a single reference that automatically plays content based on the client’s connection speed, operating system platform, etc. Movie alternates are covered in more detail here.

All reference movies can be embedded by specifying them as the first attribute for the QT_WriteOJECT method. Streaming movies embedded using reference movies are often used with the autoplay attribute set to true. In this case the attribute has been set to false so you can scroll to the movie and press the play button on the controller when you want to view the movie. The following code shows a typical use of a reference movie:

Embedding a stream using a Placeholder Movie

Sometimes web authors want to embed a movie that plays automatically, but they don’t want to use a reference movie. There are two ways to accomplish this:

1. Use the poster movie technique outlined above, but add the attribute ‘autohref’ with the value
‘true’ to the QT_WriteOJECT method call. QT_WriteOBJECT('poster.jpg',

2. Use the poster movie technique outlined above, but replace the ‘href’ attribute with the attribute
‘qtsrc’ and elminate the ‘target’ attribute. This method ignores the poster movie entirely and loads
the url specified by ‘qtsrc’ directly:

Linking to mp3 Streams
Linking to mp3 streams requires a text file with the extension .m3u. This file has the URL to your mp3 stream in it. For instance, if a mp3 playlist named “Blues” was playing from the Streaming Server, and the domain name of the server was stream.mydomain.net, the m3u file would contain the link:


The “:8000” is the port for streaming mp3 playlists from Darwin Streaming Server. If you enable port 80 streaming the “:8000” is not required. The .m3u file could be placed on any web server, and linked to a web page with the standard tag. For instance, to link to a file named “blues.m3u” from a web page in the same directory with the file, the link could be:

Play the blues

Note: For .m3u files to work correctly, your web server must be configured to deliver the correct mime type for .m3u files:
audio/x-mpegurl .m3u





[vc_cta_button call_text=”Need reliable streaming video encoding?” title=”Start Today” target=”_self” color=”btn_red” icon=”none” size=”btn-large” position=”cta_align_right” href=”http://gravlab.com/plans.html”]