Streaming Media Guide | Streaming Media | Hypertext Transfer Protocol

HTTP Live Streaming Overview

Networking & Internet

2010-03-25

Apple Inc. © 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apple’s copyright notice. The Apple logo is a trademark of Apple Inc. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Every effort has been made to ensure that the information in this document is accurate. Apple is not responsible for typographical errors. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 App Store is a service mark of Apple Inc. Apple, the Apple logo, iPhone, iPod, iPod touch, Leopard, Mac, Mac OS, QuickTime, Safari, and Snow Leopard are trademarks of Apple Inc., registered in the United States and other countries. iPad is a trademark of Apple Inc. DEC is a trademark of Digital Equipment Corporation. IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license.

Intel and Intel Core are registered trademarks of Intel Corportation or its subsidiaries in the United States and other countries. Simultaneously published in the United States and Canada.
Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED “AS IS,” AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.

Contents Introduction Introduction 7 Organization of This Document 8 See Also 8 Chapter 1 HTTP Streaming Architecture 9 Overview 9 Server Components 10 Media Encoder 10 Stream Segmenter 11 File Segmenter 12 Media Segment Files 12 Distribution Components 12 Client Component 13 Chapter 2 Using HTTP Live Streaming 15 Download the Tools 15 Media Stream Segmenter 15 File Stream Segmenter 15 Media Stream Validator 15 Varient Playlist Creator 16 Session Types 16 Content Protection 16 Caching and Delivery Protocols 17 Stream Alternates 17 Video Over Cellular Networks 18 Requirements for Apps 18 Failover Protection 19 Sample Streams 19 Chapter 3 Frequently Asked Questions 21 Document Revision History 27 3 2010-03-25 | © 2010 Apple Inc. . All Rights Reserved.

CONTENTS 4 2010-03-25 | © 2010 Apple Inc. All Rights Reserved. .

All Rights Reserved. .Figures Chapter 1 HTTP Streaming Architecture 9 Figure 1-1 A basic configuration 10 Chapter 2 Using HTTP Live Streaming 15 Figure 2-1 Stream alternates 18 5 2010-03-25 | © 2010 Apple Inc.

All Rights Reserved.FIGURES 6 2010-03-25 | © 2010 Apple Inc. .

A video placeholder is displayed when Safari encounters an <OBJECT> or <EMBED> tag with the URL of an HTTP Live stream. routers. caching systems. On Mac OS X. and the client software can switch streams intelligently as network bandwidth changes. media distributors.6 and later. Safari is able to play HTTP Live streams natively on iPad. 7 2010-03-25 | © 2010 Apple Inc. as part of a <video> element. The full-screen media player is launched when the user touches the video placeholder. HTTP Live Streaming is designed to work seamlessly in conjunction with media distribution networks for large scale operations. and desktop computers. QuickTime can play HTTP Live Streams. iPad. HTTP Live Streaming supports both live broadcasts and prerecorded content (video on demand). this kind of streaming is automatically supported by nearly all edge servers.0 and later include built-in client software. Additionally. The HTTP Live Streaming specification is an IETF Internet-Draft. Additionally. The QuickTime plug-in allows you to embed streams in websites using the <OBJECT> or <EMBED> tags. HTTP Live streams can also be played in native iPhone or iPad apps using the media player framework.INTRODUCTION Introduction If you are interested in any of the following: ■ ■ ■ Streaming audio or video to iPhone. within a webpage. HTTP Live Streaming supports multiple alternate streams at different bit rates. Because it uses HTTP. Important: iPhone and iPad apps that send large amounts of audio or video data over cellular networks are required to use HTTP Live Streaming. HTTP Live Streaming lets you send audio and video over HTTP from an ordinary web server for playback on iPhone. All devices running iOS 3. These servers require specialized skills to set up and maintain. . allowing publishers to protect their work. All Rights Reserved. iPod touch. Developers can also use the QTKit framework to create desktop applications that play HTTP Live Streams. iPad. and firewalls. and in a large-scale deployment this can be costly. and Safari can play HTTP Live streams natively within the <VIDEO> element. HTTP Live Streaming avoids this by using standard HTTP to deliver the media. Note: Many existing streaming services require specialized servers to distribute content to end users. HTTP Live Streaming also provides for media encryption and user authentication over HTTPS. or iPod touch Streaming live events without special server software Sending video on demand with encryption and authentication you should read this document. version 10.

and their answers: format details. HTTP Live Streaming protocol—the IETF Internet-Draft of the HTTP Live Streaming specification. and what clients are available. what formats are supported.” Organization of This Document This document contains three chapters: ■ “HTTP Streaming Architecture” (page 9)—how the technology works. “Frequently Asked Questions” (page 21)—common questions about HTTP Live Streaming. Para ■ ■ 8 Organization of This Document 2010-03-25 | © 2010 Apple Inc. and so on. ■ ■ See Also ■ ■ Designing Web Content for iPhone—how to design web content for iPhone. and how to set up alternate bandwidth streams.INTRODUCTION Introduction Note: This document was formerly tltled “iPhone Streaming Media Guide for Web Developers. “Using HTTP Live Streaming” (page 15)—how to set up live broadcast or video on demand sessions. . All Rights Reserved. Links to sample streams are included. tips. what you need on the server. Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad—step by step guidance in setting up a server and network for HTTP Live Streaming. how to implement encryption and authentication. where to go for support.

In a typical configuration. and then reassembling them so that the media can be presented to the user in a continuous stream. then requests the listed media files in order and displays them without any pauses or gaps between segments.0 or later (including iPad). Overview Conceptually.” Overview 2010-03-25 | © 2010 Apple Inc. edge networks or other content delivery networks can also be used. Client software reads the index. HTTP Live Streaming consists of three parts: the server component. and preparing the encapsulated media for distribution. the distribution component. and the client software. These files are placed on a web server. which is then broken into a series of short media files by a software stream segmenter. The server component is responsible for taking input streams of media and encoding them digitally. a hardware encoder takes audio-video input. All Rights Reserved. The distribution component consists of standard web servers. encodes it as MPEG-4 audio and video. downloading those resources. Client software is included on iOS 3. and outputs it in an MPEG-2 Transport Stream.0 and later and computers with QuickTime X or later installed. They are responsible for accepting client requests and delivering prepared media and associated resources to the client. 9 . The segmenter also creates and maintains an index file containing a list of the media files.CHAPTER 1 HTTP Streaming Architecture HTTP Live Streaming allows you to send live or prerecorded audio and video from an ordinary web server to any device running iOS 3. An example of a simple HTTP streaming configuration is shown in “A basic configuration. encapsulating them in a format suitable for delivery. with support for encryption and authentication. The URL of the index file is published on the web server. For large-scale distribution. The client software is responsible for determining the appropriate media to request. or any computer with QuickTime X or later installed.

264 video and HE-AAC audio. 10 Server Components 2010-03-25 | © 2010 Apple Inc.CHAPTER 1 HTTP Streaming Architecture Figure 1-1 A basic configuration Server Distribution stream segmenter origin web server Index file media encoder MPEG-2 transport stream .ts Audio/Video inputs HTTP Client Input can be live or from a prerecorded source.M3U8 format. or MPEG elementary streams for audio-only. The MPEG2 stream is then broken into segments and saved as a series of one or more . which can be off-the-shelf hardware. Encoding should be set to a format supported by the client device. encodes the media. Media Encoder The media encoder takes a real-time signal from an audio-video device. The URL of the index file is accessed by clients. Currently. All Rights Reserved. which then request the indexed files in sequence. . The index file contains a list of media files. It is typically encoded into an MPEG-2 Transport Stream by off-the-shelf hardware. and a way to break the encoded media into segments and save them as files. and encapsulates it for transport. The segmenter also creates an index file. The index file is in . Server Components The server requires a media encoder. which can be software such as the media stream segmenter provided by Apple. the supported delivery format is MPEG-2 Transport Streams for audio-video.ts media files. such as H. Audio-only streams can be a series of MPEG elementary audio files formatted as either AAC with ADTS headers or MP3. This is typically accomplished using a software tool such as the Apple stream segmenter. The index file also contains metadata.

For details of the index file format.com/segment1. 11 .mp3 audio media files. Here is a very simple example of an .M3U8 files.com/segment2. see the IETF Internet-Draft of the HTTP Live Streaming specification. Each time the segmenter completes a new media file. Stream Segmenter The stream segmenter is a process—typically software—that reads the Transport Stream from the local network and divides it into a series of small media files of equal duration.264 video and AAC audio are supported at this time for audio-video content. Note: MPEG-2 transport streams should not be confused with MPEG-2 video compression. an extension of the .ts #EXTINF:10. Server Components 2010-03-25 | © 2010 Apple Inc. Even though each segment is in a separate file. and because the system also supports . either in AAC format with ATDS headers or in MP3 format) Important: The video encoder should not change stream settings—such as video dimensions or codec type—in the midst of encoding a stream. Note: Because the index file format is an extension of the . Only MPEG-2 transport streams with H. http://media.com/segment3. The segmenter may also encrypt each media segment and create a key file as part of the process. All Rights Reserved.ts #EXTINF:10. The segmenter also creates an index file containing references to the individual media files.example. The index is used to track the availability and location of the media files.ts #EXT-X-ENDLIST The index file may also contain URLs for encryption key files or alternate index files for different bandwidths. Media segments are saved as . http://media. the index file is updated. http://media.m3u file format.CHAPTER 1 HTTP Streaming Architecture The encoder delivers the encoded media in an MPEG-2 Transport Stream over the local network to the stream segmenter. Audio-only content can be either MPEG-2 transport or MPEG elementary audio streams. The transport stream is a packaging format that can be used with a number of different compression formats.example.m3u format used for MP3 playlists.example. the client software may also be compatible with typical MP3 playlists used for streaming Internet radio.M3U8 file a segmenter might produce if the entire stream were contained in three unencrypted 10-second media files: #EXTM3U #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-TARGETDURATION:10 #EXTINF:10. video files are made from a continuous stream which can be reconstructed seamlessly.ts files (MPEG-2 streams) and index files are saved as .

File extension MIME type .264 video and AAC audio. . listing a series of existing . It performs the same tasks as the media segmenter. For audio-only broadcasts.ts Tuning time-to-live (TTL) values for . Recommended configuration is typically limited to specifying MIME-type associations for . based on input from the encoder. provided they conform the published specification.ts files containing segments of an MPEG-2 Transport Stream carrying H. Alternatively. and the latest version should be downloaded for each request. the segmenter can produce MPEG elementary audio streams containing either AAC audio with ADTS headers or MP3 audio. and consist of a series of . 12 Media Segment Files 2010-03-25 | © 2010 Apple Inc.M38U file using a text editor. For an audio-only broadcast. All Rights Reserved.CHAPTER 1 HTTP Streaming Architecture File Segmenter If you already have a media file encoded using supported codecs. Distribution Components The distribution system is a web server or a web caching system that delivers the media files and index files to the client over HTTP.mpegURL video/MP2T . as these files are frequently overwritten. The file segmenter allows you to use a library of existing audio and video files for video on demand via HTTP Live Streaming.MP3 files. the file segmenter omits this step). No custom server modules are required to deliver the content. for example. it is possible to create the . Media Segment Files The media segment files are normally produced by the stream segmenter.M3U8 files and . you could create an .M3U8 application/x-mpegURL or vnd.M3U8 files may also be necessary to achieve desired caching behavior for downstream web caches.apple.M3U8 file and the media segment files independently. you can use a file segmenter to encapsulate it in an MPEG stream and break it into segments of equal length (if the file is already encapsulated in an MPEG-2 transport stream.ts files. and typically very little configuration is needed on the web server. but it takes files as input instead of streams.

If no #EXT-X-ENDLIST tag is encountered. and any alternate streams available. The index file in turn specifies the location of the available media files. The client is responsible for fetching any decryption keys. This process continues until the client encounters the #EXT-X-ENDLIST tag in the index file. the client begins presenting the reassembled stream to the user. based on a URL identifying the stream. Each file contains a consecutive segment of the stream. The client looks for new media files and encryption keys in the updated index and adds these URLs to its queue. and decrypting media files as needed. authenticating or presenting a user interface to allow authentication.CHAPTER 1 HTTP Streaming Architecture Client Component The client software begins by fetching the index file. the index file is part of an ongoing broadcast. All Rights Reserved. Client Component 2010-03-25 | © 2010 Apple Inc. Once it has a sufficient amount of data downloaded. The client loads a new version of the index file periodically. For the selected stream. decryption keys. the client downloads each available media file in sequence. 13 .

CHAPTER 1 HTTP Streaming Architecture 14 Client Component 2010-03-25 | © 2010 Apple Inc. All Rights Reserved. .

but is accessible from the Terminal application. They can be found in the /usr/bin/ directory. suitable for use in HTTP Live Streaming. File Stream Segmenter The filestreamsegmenter command-line tool takes an encoded media file as an input. type man mediastreamvalidator from the terminal window. For details. The file stream segmenter behaves very much like the media stream segmenter. encrypt the media. The tools are included with Mac OS X. and produces a series of equal-length files from it. stream alternates.CHAPTER 2 Using HTTP Live Streaming Download the Tools There are several tools available that can help you set up an HTTP Live Streaming service. The tools include a media stream segmenter. and media segment files on a server and tests to determine whether they will work with HTTP Live Streaming clients. so you should download the current version of the HTTP Live Streaming Tools from the Apple Developer website. It can also generate index files. type man mediastreamsegmenter from the terminal window. Media Stream Validator The mediastreamvalidator command-line tool examines the index files.6 (Snow Leopard) and later. a media file segmenter. 15 . and a variant playlist generator. wraps it in an MPEF-2 transport stream (unless it is already encapsulated in one). This directory is hidden from the finder. Media Stream Segmenter The mediastreamsegmenter command-line tool takes an MPEG-2 transport stream as an input and produces a series of equal-length files from it. The tools are frequently updated. Download the Tools 2010-03-25 | © 2010 Apple Inc. All Rights Reserved. You can access them if you are a member of either the iPhone or Mac Developer Program. version 10. For details. type man filetreamsegmenter from the terminal window. suitable for use in HTTP Live Streaming. but it works on existing files instead of streams coming from an encoder. optimize the files by reducing overhead. For details. a stream validator. then click either iPhone or QuickTime under the Downloads heading.com. and create the necessary files for automatically generating multiple stream alternates. produce encryption keys. One way to navigate to the tools is to log onto connect.apple.

The first mode allows you to specify a path to an existing key file on disk. It encrypts all media files using this key. It is typically more efficient to deliver such media as a single QuickTime movie or MPEG-4 file. but HTTP Live Streaming offers some advantages. Session Types The HTTP Live Streaming protocol supports live broadcast sessions and video on demand (VOD) sessions. but QuickTime movies do not support dynamically switching between data rates in mid-movie. The new index file includes the new media files. do not remove the old media files from the server or delete their URLs from the index file. The format of the key file is a packed array of these 16 octets in binary format. 16 . media files are available representing the entire duration of the presentation. All media files are encrypted using this randomly generated key. When a key file is listed in the index file. When encryption is employed. This allows clients to join the broadcast late and still see the entire event.) Content Protection Media files containing stream segments may be individually encrypted. The media stream segmenter available from Apple provides encryption and supports three modes for configuring encryption.CHAPTER 2 Using HTTP Live Streaming Varient Playlist Creator The variantplaylistcreator command-line tool creates index files. It is possible to create a live broadcast of an event that is instantly available for video on demand. Session Types 2010-03-25 | © 2010 Apple Inc. (QuickTime also supports multiple-data-rate movies using progressive download. or playlists. VOD can also be used to deliver “canned” media. save it in a specified location. older files are typically removed. as new media files are created and made available the index file is updated. type man varientplaylistcreator from the terminal window. The index file is static and contains a complete list of all files created since the beginning of the presentation. The second mode instructs the segmenter to generate a random key file. and add an #EXT-X-ENDLIST tag to the index when the broadcast ends. for alternate streams from the output of the media stream segmenter (the media stream segmenter must be invoked with the -generate-variant-info argument to produce the required output for the playlist creator). For details. It also allows an event to be archived for rebroadcast with no additional time or effort. To convert a live broadcast to VOD. and reference it in the index file. such as support for media encryption and dynamic switching between streams of different data rates in response to changing connection speeds. Currently HTTP Live Streaming supports AES-128 encryption using 16-octet keys. For live sessions. For VOD sessions. This kind of session allows the client full access to the entire program. In this mode the segmenter inserts the URL of the existing key file in the index file. The updated index file presents a moving window into a continuous stream. All Rights Reserved. references to the corresponding key files appear in the index file so that the client can retrieve the keys for decryption. This type of session is suitable for continuous broadcasts. the key file contains a cipher key that must be used to decrypt subsequent media files listed in the index file.

Stream Alternates Index files may reference alternate streams of content. The client software uses heuristics to determine appropriate times to switch between the alternates. Currently. since HTTPS requests often bypass web server caches. Caching and Delivery Protocols HTTPS is commonly used to deliver key files. as illustrated in Figure 2-1 Caching and Delivery Protocols 2010-03-25 | © 2010 Apple Inc. reference it in the index file. it is important to make sure that any content delivery network you use understands that the . HTTP Live Streaming supports switching between streams dynamically if the available bandwidth changes. This mode is referred to as key rotation. For this very reason. changing to a new key periodically is less likely to impact system performance than changing keys for each segment. save it in a specified location. and then regenerate and reference a new key file every n files. The index file points to alternate streams of media by including a specially tagged list of other index files.CHAPTER 2 Using HTTP Live Streaming The third mode instructs the segmenter to generate a random key file. Each group of n files is encrypted using a different key. these heuristics are based on recent trends in measured network throughput. You may also choose to protect the delivery of the key files using your own session-based authentication scheme. but this is not recommended when scalability is important. or new keys may be required at intervals. You can serve key files using either HTTP or HTTPS. Note: All media files may be encrypted using the same key. 17 . causing all content requests to be routed through your server and defeating the purpose of edge network distribution systems. All Rights Reserved. References can be used to support delivery of multiple streams of the same content with varying quality levels for different bandwidths or devices. but because each media key adds a file request and transfer to the overhead for presenting the following media segments. It may also be used to deliver the content files and index files. however.M3U8 index files are not to be cached for longer than one media segment duration. The theoretical limit is one key per media file.

even for video on demand. for example.ts Index file Alternate-B Index file . providing the best stream as the device moves between cellular and WiFi connections. and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period. you should provide cellular-capable clients an alternate stream at 64 Kbps or less for slower data connections.) 18 Video Over Cellular Networks 2010-03-25 | © 2010 Apple Inc. or between 3G and EDGE connections. Video Over Cellular Networks When you send video to a mobile device such as iPhone or iPad. HTTP Live Streaming allows the client to choose among stream alternates dynamically as the network bandwidth changes. Requirements for Apps Warning: Apps submitted for distribution in the App Store must conform to these requirements.ts Note that the client may choose to change to an alternate stream at any time. All alternates should use identical audio to allow smooth transitions among streams.CHAPTER 2 Using HTTP Live Streaming Figure 2-1 Stream alternates Alternate-A Index file . such as when a mobile device enters or leaves a WiFi hotspot. you should provide an audio-only stream. It is strongly recommended that you use HTTP Live Streaming to deliver video to all cellular-capable devices. you are required to use HTTP Live Streaming. All Rights Reserved. If your app delivers video over cellular networks. so that your viewers have the best experience possible under changing conditions.ts Alternate-C Index file . (Progressive download may be used for smaller clips. In addition. . If you cannot provide video of acceptable quality at 64 Kbps or lower. the client’s Internet connection may move to or from a cellular network at any time. or audio with a still image. This is a significant advantage over progressive download.

mycompany.apple. if the primary stream comes from server ALPHA. the client chooses among them in the order listed in the playlist. or set of streams.com/iphone/samples/bipbopgear1. To implement failover protection. BANDWIDTH=500000 http://ALPHA. In the example above. In the event of an index load failure on one stream.com/lo/prog_index. you need not provide a complete parallel set of streams.mycompany. on a separate server or content distribution service. for example). for instance. and generate a playlist file as you normally would. the client attempts to switch to an alternate stream. for example. 19 . BANDWIDTH=200000 http://BETA.M3U8 files to index the streams. The streams can be accessed at the following URLs: ■ http://devimages.html Failover Protection 2010-03-25 | © 2010 Apple Inc.com/md/prog_index. Add the list of backup streams to the playlist file. Then create a parallel stream. For example.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1.com/lo/prog_index.CHAPTER 2 Using HTTP Live Streaming If your app uses HTTP Live Streaming over cellular networks. All Rights Reserved.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1. and the backup stream is on server BETA. at the discretion of Apple.mycompany. You are not limited to a single backup stream set. ALPHA and BETA could be followed by GAMMA. If there are multiple alternates at the same bandwidth. such as a server crashing or a content distributor node going down. You can use this feature to provide redundant streams that will allow media to reach clients even in the event of severe local failures. with the backup at each bandwidth listed after the primary for that bandwidth. but as failure fallbacks. if the client is unable to reload the index file for a stream (due to a 404 error. BANDWIDTH=500000 http://BETA.com/md/prog_index. These examples show proper formatting of HTML to embed streams.1. Failover Protection If your playlist contains alternate streams.ts media segment files. Sample Streams There are a series of HTTP streams available for testing on Apple’s developer site. Similarly.m3u8 Note that the backup streams are intermixed with the primary streams in the playlist. . BANDWIDTH=200000 http://ALPHA. Starting with iOS 3. or multiple alternate bandwidth streams. the client chooses the highest bandwidth alternate stream that the network connection supports.mycompany. and . These requirements apply to apps submitted for distribution in the App Store for use on Apple products. create a stream.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1. so that the backup stream at each bandwidth is listed after the primary stream. your playlist file might look something like this: #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1. Non-compliant apps may be rejected or removed. You could provide a single low-bandwidth stream on a backup server. they can not only operate as bandwidth or device alternates. you are required to provide at least one stream at 64 Kbps or lower bandwidth (the low-bandwidth stream may be audio-only or audio with a still image).

. the QuickTime plug-in or ActiveX component is required.html The samples show the same NTSC test pattern at four different resolutions and data rates.CHAPTER 2 Using HTTP Live Streaming ■ ■ ■ ■ http://devimages. You must install iOS version 3. QuickTime X is required for playback on the desktop.html http://devimages.apple.com/iphone/samples/bipbopgear4.0 or later to play these samples on your iPhone or iPod touch.apple.html http://devimages.com/iphone/samples/bipbopgear2.com/iphone/samples/bipbopall. 20 Sample Streams 2010-03-25 | © 2010 Apple Inc. The last sample streams at multiple data rates.com/iphone/samples/bipbopgear3.apple.apple. All Rights Reserved.html http://devimages. To view the sample streams in browsers other than Safari. The stream starts with sample 1 and switches to the fastest sample the connection supports.

However. Longer segments will extend the inherent latency of the broadcast and initial startup time.0 for compatibility. The client identifies an ongoing session by the lack of an #EXT-X-ENDLIST tag in the index file. the current Apple implementation should interoperate with encoders that produce MPEG-2 Transport Streams containing H. but the optimum number may be larger. and iPod touch (2nd generation and later) support H. Apple has tested the current implementation with the following commercial encoders: ■ ■ Inlet Technologies Spinnaker 7000 Envivio 4Caster C4 2. 4. 21 2010-03-25 | © 2010 Apple Inc. stereo audio MP3 (MPEG-1 Audio Layer 3) 8 kHz to 48 kHz.0 Audio: ❏ ❏ HE-AAC or AAC-LC up to 48 kHz. which might create unnecessary network overhead for the client. you should use H.264 Baseline Level 3. iPhone 3G. A duration of 10 seconds of media per file seems to strike a reasonable balance for most broadcast content. What duration should media files be? The main point to consider is that shorter segments result in more frequent refreshes of the index file.264 video and AAC audio (HE-AAC or AAC-LC). ongoing session? The specification requires at least 3 media files be listed in the index file. The client does not allow the user to seek into the last two files in the index for ongoing broadcasts. however. Encoders that are capable of broadcasting the output stream over UDP should also be compatible with the current implementation of the Apple provided segmenter software.1. stereo audio Note: iPad. Periodically.CHAPTER 3 Frequently Asked Questions 1. How many files should be in listed in the index file during a continuous. If your app runs on older versions of iPhone or iPod touch. All Rights Reserved. 3.264 Baseline 3. the client requests a new copy of the index. What are the specifics of the video and audio formats supported? Although the protocol specification does not limit the video and audio formats. . What kinds of encoders are supported? The protocol specification does not limit the encoder selection. the current Apple implementation supports the following formats: ■ ■ Video: H.264 Baseline 3.

including MP3 audio. causing one or more segments to be dropped. The m3u file format is a de facto standard playlist format suitable for carrying lists of media file URLs. It is an m3u playlist containing UTF-8 encoded text. H. see “Media Encoder” (page 10). The current implementation has been tested using audio-video streams with data rates as low as 100 Kbps and as high as 1. The trade-off is that a longer index file adds to network overhead—during live broadcasts. the client switches to a lower quality. This is the format used as the index file for HTTP Live Streaming. 6. Note: For seamless transitions between alternate streams.) 7. What is an . What is a . the longer the client can be paused without losing its place in the broadcast.264 video. This is a file format that encapsulates a series of encoded media samples—typically audio and video.M3U8 file is a extensible playlist file format. Where can I find a copy of the media stream segmenter from Apple? 22 2010-03-25 | © 2010 Apple Inc. no segments are lost. but inadequate bandwidth does cause slower startup and periodic stalling while data buffers. see IETF Internet-Draft of the HTTP Live Streaming specification.ts file? A . If a higher-quality stream is available and the bandwidth appears sufficient to support it. Not all compression formats are currently supported in the Apple HTTP Live Streaming implementation. 5. The longer the list. even though the index file is typically small. the client will eventually fall behind in such cases. How does the client software determine when to switch streams? The current implementation of the client observes the effective bandwidth while playing a stream. . If a lower-quality stream is available and the current bandwidth appears insufficient to support the current stream.CHAPTER 3 Frequently Asked Questions The important point to consider when choosing the optimum number is that the number of files available during a live session constrains the client's behavior when doing play/pause and seeking operations. What data rates are supported? The data rate that a content provider chooses for a stream is most influenced by the target client platform and the expected network topology. there is more latency before startup and the client may have to pause to buffer more data periodically. 8. however. AAC audio. so it does add up. Another point to consider is that clients typically request new copies of the index file at higher rate when the index contains a shorter list of files.M3U8 file? An . and the wider the time range within which the client can seek. the audio portion of the stream should be identical in all versions. The file format supports a variety of compression formats. 9. For details. the further back in the broadcast a new client begins.6 Mbps to iPhone. (For a list of currently supported formats. The streaming protocol itself places no limitations on the data rates that can be used.ts file contains an MPEG-2 Transport Stream. Audio-only streams at 64 Kbps are recommended as alternates for delivery over slow cellular connections. the clients are all refreshing the index file regularly. Note: If the data rate exceeds the available bandwidth. the client switches to a higher quality. During a broadcast using an index file that provides a moving window into the content. and so on. All Rights Reserved. In the case of VOD.

You can obtain a list of the command line arguments and their meanings by typing man mediastreamsegmenter from the Terminal application.66. 10. version 10. A target duration (length of the media segments) of 10 seconds is recommended. 64 Kbps Low—96 Kbps video.0 "avc1.0 to 3.77.30” for compatibility with iOS versions 3.0 "avc1. and is the default if no target duration is specified.12.66.40.264 (MPEG-4.2" "mp4a.0 video Keyframes every 3 seconds HE-AAC (version 1) stereo audio at 44.5" "mp4a. file stream segmenter. one set of quotes is used to contain all values.0 to 3. If multiple values are specified.40.264 video access units must use Access Unit Delimiter NALs. and must be in unique PES packets. The segmenter also has a number of user-configurable settings.30” Note: Use “avc1. An example follows.CHAPTER 3 Frequently Asked Questions The media stream segmenter.264 Main Profile level 3. See “Download the Tools” (page 15) for details.34" H. H.264 Baseline Profile level 3. H.ts) files with the following characteristics for the Apple segmenter: ■ ■ ■ ■ H. There are also certain requirements. so you should download the current version of the HTTP Live Streaming Tools from the Apple Developer website. . it must include all codecs and profiles required to play back the stream. The following values are currently recognized: AAC-LC HE-AAC MP3 "mp4a. it must have ADTS headers.40. The attribute value must be in quotes. These tools are frequently updated.264 profile are required to play back my stream? Use the CODECS attribute of the EXT-X-STREAM-INF tag.42001e" or “avc1. 64 Kbps audio High—800 Kbps video. The transport stream must contain H.30” for compatibility with iOS versions 3. for use with the media segmenter from Apple? Your encoder should produce MPEG-2 transport stream (. and other tools are in the /usr/bin/ directory of Mac OS X computers. How can I specify what codecs or H. When this attribute is present. All Rights Reserved.6 and later. 11. 23 2010-03-25 | © 2010 Apple Inc. What settings are recommended for a typical HTTP stream.12.1 kHz Four streams: Cellular Fallback—Audio only or audio with still image.77. with alternates. The current mediastreamsegmenter tool works only with MPEG-2 Transport Streams as defined in ISO/IEC 13818. part 10) video and AAC or MPEG audio. 64 Kbps audio These settings are the current recommendations. and the values are separated by commas.30” Note: Use “avc1. If AAC audio is used.4d001e" or “avc1. 64 Kbps audio Medium—256 Kbps video.264 Baseline 3.

150 Kbps for slower connections. but not enough for the lowest video alternate.40. the stream is identified as audio-only. What are the hardware requirements or recommendations for servers? See question #1 for encoder hardware recommendations. How can I specify an audio-only alternate to an audio-video stream? Use the CODECS and BANDWIDTH attributes of the EXT-X-STREAM-INF tag together. . Currently. so use of the CODECS attribute is optional.m38u #EXT-X-STREAM-INF:PROGRAM-ID=1. 24 2010-03-25 | © 2010 Apple Inc. BANDWIDTH=3000000. such as a Mac Pro or an XServe.m38u 12. BANDWIDTH=64000.4d001e.5" aacaudio_index. CODECS="mp4a.5" h264main_heaac_index.m38u #EXT-X-STREAM-INF:PROGRAM-ID=1. 13. How can I add a still image to an audio-only stream? Use the -meta-file argument when invoking the stream or file segmenter with -meta-type=picture to add an image to every segment.40. this would add an image named poster. The following is an example that specifies video streams at 500 Kbps for fast connections. BANDWIDTH=800000 wifi_video_index.m38u #EXT-X-STREAM-INF:PROGRAM-ID=1. CODECS="avc1. BANDWIDTH=64000. CODECS="mp4a.mp3 Remember that the image is typically resent every ten seconds. All the streams should use the same 64 Kbps audio to allow transitions between streams without an audible disturbance.jpg --meta-type=picture track01. it must list all codecs required to play the stream. and an audio-only stream at 64 Kbps for very slow connections. If the available bandwidth is enough for the audio alternate.5" aacaudio_index. If the CODECS attribute is included. If only an audio codec is specified. How can I create an audio-only stream from audio/video input? Add the -audio-only argument when invoking the stream or files segmenter. while the second network interface can provide access to a wider network. #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1. All Rights Reserved. the client switches to the audio stream.jpg to every segment of an audio stream created from the file track01. 14.CHAPTER 3 Frequently Asked Questions #EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1. mp4a.m38u 15. it is not required to specify that a stream is audio-only.m38u #EXT-X-STREAM-INF:PROGRAM-ID=1. One network interface can be used to obtain the encoded stream from the local network. BANDWIDTH=500000 mid_video_index.mp3: mediafilesegmenter -f /Dir/outputFile -a --meta-file=poster.m38u #EXT-X-STREAM-INF:PROGRAM-ID=1. We recommend using a Mac with two Ethernet network interfaces. The Apple stream segmenter is capable of running on any Intel-based Mac. BANDWIDTH=500000 mid_video_index. BANDWIDTH=150000 3g_video_index. For example. so it’s best to keep the file size small. The BANDWIDTH attribute specifies the bandwidth required for each alternate stream.40.

Otherwise. the duration of this file is the minimum latency before media is available for download. media can be encrypted and key access can be limited using HTTPS authentication. 24. 20. What advantages does this approach have over RTP/RTSP? HTTP is less likely to be disallowed by routers. Encoder and multiplexer implementations vary in their efficiency at packing media data into these fixed packet sizes. Why is my stream’s overall bit rate higher than the sum of the audio and video bitrates? MPEG-2 transport streams can include substantial overhead. sample rate. Also. HTTP is also supported by more content-distribution networks. which can affect cost in large distribution models. or firewall settings. with recommended settings. at http://tools. All Rights Reserved.0 or later) or any device with QuickTime X or later installed. Is the protocol specification available? Yes.CHAPTER 3 Frequently Asked Questions 16. However. Content is therefore more likely to get through to the client in more locations and without special settings. it is possible to implement a software encoder. 21. the client may cache data for performance optimization when seeking within the media. Expertise in customizing HTTP content delivery using tools such as PHP is also more widespread.org/html/draft-pantos-httplive-streaming. NAT. How can I reduce the overhead and bring the bit rate down? 25 2010-03-25 | © 2010 Apple Inc. Does the Apple implementation of HTTP Live Streaming support DRM? No. They utilize fixed packet sizes that are padded when the packet contents are smaller than the default packet size. Does the client cache content? The index file can contain an instruction to the client that content should not be cached. more available hardware and software works unmodified and as intended with HTTP than with RTP/RTSP. See question #15. In general. the encoder and segmenter must create a file from the input. It has inherent latency corresponding to the size and duration of the media files containing stream segments. 23. 18. and two may be required to ensure seamless transitions between segments. and iPod touch (requires iOS version 3. and resolution. Using the protocol specification. In addition. 22. Typical latency with recommended settings is in the neighborhood of 30 seconds. . No ports need to be opened that are commonly closed by default. 25.ietf. RTSP streaming is not supported. 17. HTTP Live Streaming is supported in Safari and the media player framework on iOS. The protocol specification is an IETF Internet-Draft. The amount of padding can vary with frame rate. What client platforms are supported? iPhone. iPad. 19. Is this a real-time delivery system? No. What is the latency? Approximately 30 seconds. Do I need to use a hardware encoder? No. At least one segment must fully download before it can be viewed by the client.

You can mix media files from different transport streams. as can tuning the encoder settings. Also. Where can I get help or advice on setting up an HTTP audio/video server? You can visit the Apple Developer Forum at http://devforums.CHAPTER 3 Frequently Asked Questions Using a more efficient encoder can reduce the amount of overhead. Do all media files have to be part of the same MPEG-2 Transport Stream? No. For best results.com/. 26. however. 26 2010-03-25 | © 2010 Apple Inc. the -optimize argument can be passed to the Apple mediastreamsegmenter. All Rights Reserved. check out Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad. See the protocol specification for more detail. as long as they are separated by EXT-X-DISCONTINUITY tags. This removes some unnecessary padding and can significantly reduce the overhead. Also. .apple. particularly for low-bandwidth streams. all video media files should have the same height and width dimensions in pixels. 27.

Added sample code. New document that describes live streaming of audio and video over HTTP for iPhone. Changed title from iPhone Streaming Media Guide for Web Developers. Date 2010-03-25 2010-02-05 Notes Updated to include iPad and -optimize option for stream segmenter. Added documentation of CODECS attribute and video streams with audio-only alternates.REVISION HISTORY Document Revision History This table describes the changes to HTTP Live Streaming Overview. Reorganized document for readability. Added URL for downloading media segmenter. . QuickTime X support. Updated links to tools and sample streams. 2010-01-20 2009-11-17 2009-09-09 2009-06-04 2009-05-22 2009-03-15 27 2010-03-25 | © 2010 Apple Inc. Defines requirement for apps to use HTTP Live Streaming for video over cellular networks and requirement for 64 Kbps streams. All Rights Reserved. Updated to include failover support. Fixed typos and corrected URLs for samples.

All Rights Reserved.REVISION HISTORY Document Revision History 28 2010-03-25 | © 2010 Apple Inc. .

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.