[Live-devel] A new server extension for streaming to iPhones and iPads

Ross Finlayson finlayson at live555.com
Sun Jul 17 21:23:20 PDT 2011


The latest version (2011.07.18) of the "LIVE555 Streaming Media" code 
includes an experimental server extension that supports streaming 
media files to iPhones and iPads, using Apple's "HTTP Live Streaming" 
mechanism.

This means that you can use a single server to stream the same 
file(s) using either RTSP/RTP (to standard RTSP/RTP clients such as 
VLC), or using HTTP (to "Safari" on iPhones and iPads).

(Note though, that for "HTTP Live Streaming" to iPhones and iPads, 
only one kind of file is supported: MPEG Transport Stream files with 
H.264 video.  (To be streamed using our server, the files must also 
be indexed - using the same 'index file' mechanism that we use for 
'trick play'.))

I have added this support to the "LIVE555 Media Server" application 
(the "live555MediaServer" application, in the "mediaServer" 
directory).  (As of now, this support is only in the source code; 
*not* in the pre-built "live555MediaServer" application binaries that 
you can download from our web site.  However, the pre-built binary 
versions will be updated shortly, perhaps after I get feedback from 
this mailing list.)


To use the "HTTP Live Streaming" feature, using the "LIVE555 Media Server":
======================================
1/ Download and build the latest version of the "LIVE555 Streaming 
Media" software.
2/ Go to the "mediaServer" directory.  Build "live555MediaServer" (if 
it hasn't been built already).
3/ Copy the media file(s) that you wish to stream to this directory. 
(To use "HTTP Live Streaming", these files must be MPEG Transport 
Stream files with H.264 video.)
4/ Each of these Transport Stream files must be indexed (to create an 
'index file'), using the "MPEG2TransportStreamIndexer" utility.  (For 
more information about this utility, see 
<http://www.live555.com/liveMedia/transport-stream-trick-play.html>) 
The index file (with file name suffix ".tsx") must be put in the 
"mediaServer" directory, along with its ".ts" file.
4a/ Note: An example Transport Stream file - and its index file - is 
available at <http://www.live555.com/liveMedia/public/h264-in-mp2t/>: 
You can download the files "bipbop-gear1-all.ts" and 
"bipbop-gear1-all.tsx", and put them in the "mediaServer" directory.
5/ Run the "live555MediaServer" application.  Note the port number 
that it prints out at the end - for use for HTTP Live Streaming.
6/ On your iPhone or iPad, start the "Safari" (web browser) app, and 
enter the URL
	http://<server-name-or-ip-address>:<port-number>/<filename>
where <port-number> is the port number noted in step 5.  If the port 
number is 80 (the default port number for HTTP), then you can omit 
":80" from the URL.  (In principle, you could also use the RTSP port 
number (554 or 8554) for HTTP.  I don't recommend this, though, 
because it might confuse firewalls.)


To add the "HTTP Live Streaming" feature to your own RTSP server application:
======================================
1/ Instead of using the "RTSPServer" class, use the 
"RTSPServerSupportingHTTPStreaming" class.  (This is a subclass of 
"RTSPServer".)
2/ To set up the server to use a specific HTTP port number, call
	setHTTPPort(<http-port-number>)
and be sure to test the result, to make sure it worked.  (On most 
Unix/Linux systems, you will not be able to use port number 80, 
unless you're running as "root".  However, ports 8000 or 8080 should 
work.)


Additional notes
=============
- If your streamed file does not display properly on an iPhone or 
iPad, then it might be because it was encoded with a version of H.264 
that Apple does not support.  According to Apple's documentation, at
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html
your file must be encoded using H.264 "Baseline profile 3.0, Baseline 
profile 3.1, or Main profile 3.1", or just "Baseline 3.1" for older 
iPhones.

- The "bipbop-gear1-all.ts" file (available, along with its index 
file, from <http://www.live555.com/liveMedia/public/h264-in-mp2t/> is 
known to work OK.  However, I'm looking for more examples of workable 
files to put in this directory (so people can use them for their own 
testing).  If you have such a working file, and wish to contribute it 
to this public repository, then please let me know.

- Note that Apple's "QuickTime Player" application (for Mac or 
Windows) *cannot* play these streams, using either "HTTP Live 
Streaming", or RTSP/RTP.  (It can play RTSP/RTP streams that consist 
of separate Elementary Stream audio/video substreams, but - for some 
strange reason - cannot play RTSP/RTP streams of Transport Stream 
data.)  Go figure...  (If you want to play these streams using 
RTSP/RTP, use VLC <http://www.videolan.org/>, not "QuickTime Player".)

- Unlike some other servers that support "HTTP Live Streaming", we do 
not actually 'segment' (split up) the Transport Stream files that 
we're streaming.  Instead, we segment the files 'virtually', inside 
the server, in response to each client request.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list