Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Apple has included HTTP Adaptive Bitrate Streaming in the iPhone OS 3.0, in particular Safari handles this automatically.

I'd like to play with this in a low cost manner, but I expect it'll require a custom HTTP server in the worst case, and interesting PHP/etc scripting in the best case.

But first I need to know what the protocol differences or standard is. HTTP is reasonably simple as a protocol, but adaptive bitrate means the file size is different, the chunk locations are different at different bitrates, etc. For instance, does the client tell the server anything special about the stream as it's downloading, or is it all handled on the server side?

Eliminating buffering pauses for the end user is very attractive for both live and pre-recorded video streams, and doing both over HTTP is even better given many networks and gov'ts are limiting non port 80 traffic.

  • What are the technical details for HTTP adaptive bitrate streaming, especially Apple's implementation?

-Adam

share|improve this question

4 Answers 4

up vote 3 down vote accepted

Update

Looks like Apple made an IETF draft proposal, and some people are already working on segmenters:

HTTP Live Streaming - draft-pantos-http-live-streaming-01
http://tools.ietf.org/id/draft-pantos-http-live-streaming-01.txt

iPhone HTTP Streaming with FFMpeg and an Open Source Segmenter
http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/


Ok, looks like the HTTP server acts simply as a dumb HTTP server. Poking around the example website provided by Akamai gives me enough info to get started with static content streaming.

http://iphone.akamai.com/

The whitepaper ( http://www.akamai.com/dl/akamai/iphone_wp.pdf ) provides information about the transport stream encoding, so the .ts streams are straightforward.

The encoder (or a separate segmenter process) will produce H.264/AAC content in a sequence of small content segments, in MPEG-2 TS format (.ts). There is also an M3U8 index file that references the segments; in the case of live content the M3U8 is continuously updated to reflect the latest content.

H.264 Encoding should be single-pass Baseline Profile, frame re-ordering disabled. Key frames are suggested every 5 seconds, ideally an even divisor of the chosen segment length.

The website provides an M3U8 file, which is simply an M3U playlist, but in the UTF-8 character encoding format.

That file then links to an M3U8 file for each bitrate. I assume they must all have cuts at the same positions (every 2 or 10 seconds, for instance) so that switching can be seamless. It appears to be completely client driven - the client decides how to measure bandwidth and which version it's going to get.

The contents of the main file are:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=860000
hi/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=512000
med/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=160000
lo/prog_index.m3u8

Then each of the other files are:

hi/prog_index.m3u8

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, 
fileSequence0.ts
#EXTINF:10, 
fileSequence1.ts
#EXTINF:10, 
fileSequence2.ts
#EXTINF:10, 
fileSequence3.ts
#EXTINF:1,  
fileSequence4.ts
#EXT-X-ENDLIST

med/prog_index.m3u8

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, 
fileSequence0.ts
#EXTINF:10, 
fileSequence1.ts
#EXTINF:10, 
fileSequence2.ts
#EXTINF:10, 
fileSequence3.ts
#EXTINF:1,  
fileSequence4.ts
#EXT-X-ENDLIST

lo/prog_index.m3u8

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, 
fileSequence0.ts
#EXTINF:10, 
fileSequence1.ts
#EXTINF:10, 
fileSequence2.ts
#EXTINF:10, 
fileSequence3.ts
#EXTINF:1,  
fileSequence4.ts
#EXT-X-ENDLIST

This works with the HTML 5 video tag:

<video width=”640” height=”480” >
   <source src=”content1/content1.m3u8” />
</video>

Still a lot of unanswered questions, but this is probably enough to get started.

-Adam

share|improve this answer

Akamai describes it as such:

Starting with iPhone OS version 3.0 and QuickTime X, you can send streaming audio and video over HTTP from an ordinary web server for playback on iPhone, iPod touch, or other devices, such as desktop computers, without the limitations of Progressive Downloads.

The new streaming protocol supports Multiple Bitrates and automatically switches to the optimal bit-rate based on network conditions for a smooth quality playback experience. This implementation also provides for media encryption and user authentication over HTTPS, allowing publishers to protect their work. Both Live and On demand content can be delivered using the 3.0 specification.

HTTP Streaming to the iPhone consists of three parts: the server component, the Akamai network, and the client software.

In a typical configuration, a hardware encoder takes audio-video input and turns it into an MPEG-2 transport stream containing H.264 video and AAC or HE-AAC audio. The encoded stream is then split into a series of short media files by a stream segmenter. The segmenter also creates and maintains an index file containing the list of short media files that were created. These files are placed on a web server.

A media player built into the iPhone OS is provided a link to the index file, it then requests the media files in order and plays them without any pauses or gaps between segments

So you apparently need the stream segmenter in order to properly create content. The HTTP server is generic in this technology.

share|improve this answer
    
What, then, is the format of the index file, and does the stream segmenter do anything other than create new keyframes and split the streams up? And, further, could this be done dynamically? I wonder if the protocol supports live streaming then, which would require the index file be updated frequently, and the client to understand that it needs to request the index frequently... –  Adam Davis Jul 1 '09 at 19:17
    
Akamai's white paper on the subject gives a few more clues: akamai.com/dl/akamai/iphone_wp.pdf seems to indicate that the splitter provides an M3U8 file, which is a UTF-8 format M3U playlist. Still no information on the specific format of that file with regards to the bit stream... –  Adam Davis Jul 1 '09 at 19:35

No windows segmenter - iPhone segmenter is not working properly for unknown reasons. You must be registered iPhone developer to be able to download the segmenter

share|improve this answer

Svitoch, do you have snow leopard? it comes with apple stream segmenter. just type in man mediastreamsegmenter to see the manual.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.