http live streaming presentation

37
HTTP LIVE STREAMING A review of Apple’s new streaming specification andrewsblog.org — [email protected]

Upload: andrew-fecheyr

Post on 22-Mar-2016

220 views

Category:

Documents


1 download

DESCRIPTION

A Review of Apple's new streaming specification. This is the presentation of this paper: http://issuu.com/andruby/docs/http_live_streaming.

TRANSCRIPT

Page 1: HTTP Live Streaming Presentation

HTTP LIVE STREAMINGA review of Apple’s new streaming specification

andrewsblog.org — [email protected]

Page 2: HTTP Live Streaming Presentation

STREAMING MEDIA

• On-Demand vs Live

• Popular Solutions:

• RTP/RTSPOpen protocol but has firewall issues

• Adobe Flash Media StreamingProprietary, high client cpu usage on some platforms

Page 3: HTTP Live Streaming Presentation

HTTP LIVE STREAMING

Page 4: HTTP Live Streaming Presentation

HTTP LIVE STREAMING

• Originally developed by Apple for its iPhone platform

• The specification is an IETF Internet-Draft

• Pure HTTP delivery

• No firewall issues

• No special server needed (any web server will do)

Page 5: HTTP Live Streaming Presentation

ARCHITECTURE

• Server component

• Distribution component

• Client software

Page 6: HTTP Live Streaming Presentation

ARCHITECTURE

A/V input

MPEG 2transport stream

Server

media encoder

stream segmenter

Client

Distribution

.tsIndex

file

HTTP

Page 7: HTTP Live Streaming Presentation

ARCHITECTURE

A/V input

MPEG 2transport stream

Server

media encoder

stream segmenter

• Media encoder

• Outputs an MPEG-2 Transport Stream

• Stream Segmenter

• Cuts the stream in small files of equal duration

• Creates/updates an .m3u8 index files

Page 8: HTTP Live Streaming Presentation

ARCHITECTURE

A/V input

MPEG 2transport stream

Server

media encoder

stream segmenter

Client

Distribution

.tsIndex

file

HTTP

Page 9: HTTP Live Streaming Presentation

ARCHITECTURE

Client

Distribution

.tsIndex

file

HTTP

• Distribution

• Ordinary web server or web caching/proxy system

• Serves index file & stream segments

• Client

• Fetches index file

• Fetches stream segments in sequence

Page 10: HTTP Live Streaming Presentation

FEATURES

• On-Demand Streaming (VOD) and Live Streaming

• Content Protection

• Encryption: AES-128, key files listed in index file

• Key files served by HTTP or HTTPS, can be protected by own session-based authentication scheme

• Stream alternatives and Failover protection

Page 11: HTTP Live Streaming Presentation

STREAM ALTERNATIVES

Main Server

.ts

Alt. A Index

file

.ts

Alt. B Index

file

.ts

Alt. C Index

file

Index file

Backup Server

.ts

Backup Index

file

• Different bandwidths for varying network connections or devices

• eg: high quality for Wifimedium quality for 3Glow quality for Edge

• Client switches automatically

• Failover alternative(s) as Backup

Page 12: HTTP Live Streaming Presentation

.M3U8 INDEX FILE

• Extension of .m3u playlist file (by Nullsoft for Winamp)

• Simple example

#EXTM3U#EXT-X-MEDIA-SEQUENCE:0#EXT-X-TARGETDURATION:10#EXTINF:10,http://media.example.com/segment1.ts#EXTINF:10,http://media.example.com/segment2.ts#EXTINF:10,http://media.example.com/segment3.ts#EXT-X-ENDLIST

Page 13: HTTP Live Streaming Presentation

.M3U8 INDEX FILE

• Extension of .m3u playlist file (by Nullsoft for Winamp)

• Simple example

#EXTM3U#EXT-X-MEDIA-SEQUENCE:0#EXT-X-TARGETDURATION:10#EXTINF:10,http://media.example.com/segment1.ts#EXTINF:10,http://media.example.com/segment2.ts#EXTINF:10,http://media.example.com/segment3.ts#EXT-X-ENDLIST

end of on-demand video

segment urls

duration of segments in seconds

Page 14: HTTP Live Streaming Presentation

.M3U8 INDEX FILE

• More complex example

#EXTM3U#EXT-X-KEY:METHOD=AES-128,URI="https:// priv.mycompany.com/key"

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://ALPHA.mycompany.com/lo/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://BETA.mycompany.com/lo/prog_index.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://ALPHA.mycompany.com/md/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://BETA.mycompany.com/md/prog_index.m3u8

Page 15: HTTP Live Streaming Presentation

.M3U8 INDEX FILE

• More complex example

#EXTM3U#EXT-X-KEY:METHOD=AES-128,URI="https:// priv.mycompany.com/key"

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://ALPHA.mycompany.com/lo/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000http://BETA.mycompany.com/lo/prog_index.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://ALPHA.mycompany.com/md/prog_index.m3u8#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=500000http://BETA.mycompany.com/md/prog_index.m3u8

no X-ENDLIST so it is a Live stream

200kbpsalternatives

failoveralternatives500kbps

alternatives

encryption method and key url

Page 16: HTTP Live Streaming Presentation

CRITICAL COMPARISON

Page 17: HTTP Live Streaming Presentation

CRITICAL COMPARISON

• Ease of setup

• Compatibility

• Client & Server Performance

• Features

• Ease of distribution

• Cost

Page 18: HTTP Live Streaming Presentation

CRITICAL COMPARISON

Tested @ http://streaming_test.andrewsblog.org

Page 19: HTTP Live Streaming Presentation

EASE OF SETUP

• HTTP Live Streaming

• Apple toolkit (~5 min) easy, fast and complete, but only available for MacOS

• Open Source toolchain (~15 min)

FFMpeg+Ruby+C: for *nix, flexible but experimental

• RTP/RTSP with Darwin Streaming Server (~1.5 hours)

• Install & configure server, conflict with web server if running on port 80

• Required to ‘hint’ media files

Page 20: HTTP Live Streaming Presentation

COMPATIBILITY

HTTP Live Streaming RTP/RTSP Flash Media

Safari 4.0.4, MacOS 10.6.2

FireFox 3.5.7, MacOS 10.6.2

Chrome 4.0.249, MacOS 10.6.2

FireFox 3.5, Vista SP1

IExplorer 8, Vista SP1

iPhone 3.1.2

✔ ✔ ✔

external player external player ✔

external player external player ✔

✖ external player ✔

✖ external player ✔

✔ ✖ redirected*

* YouTube automatically sends an alternative HTTP Live Stream to iPhone users.

Page 21: HTTP Live Streaming Presentation

COMPATIBILITY

HTTP Live Streaming RTP/RTSP Flash Media

Safari 4.0.4, MacOS 10.6.2

FireFox 3.5.7, MacOS 10.6.2

Chrome 4.0.249, MacOS 10.6.2

FireFox 3.5, Vista SP1

IExplorer 8, Vista SP1

iPhone 3.1.2

✔ ✔ ✔

external player external player ✔

external player external player ✔

✖ external player ✔

✖ external player ✔

✔ ✖ redirected*

greatokaystill low

* YouTube automatically sends an alternative HTTP Live Stream to iPhone users.

Page 22: HTTP Live Streaming Presentation

CLIENT PERFORMANCE

• Average CPU Load from 120 samples taken over 40sec

• Ran on a 1.8 Ghz dual core MacBook (MacOS 10.6.2)

Page 23: HTTP Live Streaming Presentation

CLIENT PERFORMANCE

• Average CPU Load from 120 samples taken over 40sec

• Ran on a 1.8 Ghz dual core MacBook (MacOS 10.6.2)

HTTP Live Streaming

RTP/RTSP

Flash Media

CPU Load EmbeddedCPU Load External

Page 24: HTTP Live Streaming Presentation

CLIENT PERFORMANCE

• Average CPU Load from 120 samples taken over 40sec

• Ran on a 1.8 Ghz dual core MacBook (MacOS 10.6.2)

HTTP Live Streaming

RTP/RTSP

Flash Media

15,10%16,94%

21,28%21,64%

86,44%78,02%

CPU Load EmbeddedCPU Load External

Page 25: HTTP Live Streaming Presentation

SERVER PERFORMANCE

• Concurrency is the important metric!

• RTP/RTSP: Darwin Streaming Server

• Tested with StreamingLoadTool

• HTTP Live Streaming: Nginx web server

• Tested with ApacheBench

• Ran on a FreeBSD 7.2 Virtual Private Server with 128MB Ram

Page 26: HTTP Live Streaming Presentation

SERVER PERFORMANCE

0

10

20

30

40

50

60

0 20 40 60 80 100

Darwin Streaming ServerS

trea

ms

Concurency

Success Errors Failed

Page 27: HTTP Live Streaming Presentation

SERVER PERFORMANCE

0

10

20

30

40

50

60

0 20 40 60 80 100

Darwin Streaming ServerS

trea

ms

Concurency

Success Errors Failed

CPU bound, max 20~40 users

Page 28: HTTP Live Streaming Presentation

SERVER PERFORMANCE

0

2.500

5.000

7.500

10.000

12.500

15.000

10 30 50 70 90 110 1300%

25%

50%

75%

100%

Nginx web server

Mea

n re

que

st t

ime

(ms)

Concurrency

Req

uest

s ou

t of

tim

e

Mean Requests > 10s

Page 29: HTTP Live Streaming Presentation

SERVER PERFORMANCE

0

2.500

5.000

7.500

10.000

12.500

15.000

10 30 50 70 90 110 1300%

25%

50%

75%

100%

Nginx web server

Mea

n re

que

st t

ime

(ms)

Concurrency

Req

uest

s ou

t of

tim

e

Mean Requests > 10s

Network bound, max 80~130 users

Page 30: HTTP Live Streaming Presentation

EASE OF DISTRIBUTION

• Clear advantage for HTTP Live Streaming <= only HTTP objects !

• Easy to integrate with Content Delivery Networks (CDNs)

• eg: Amazon Cloudfront

• Inexpensive !$1 = 2500minutes of streaming video

Page 31: HTTP Live Streaming Presentation

EASE OF DISTRIBUTION

• Clear advantage for HTTP Live Streaming <= only HTTP objects !

• Easy to integrate with Content Delivery Networks (CDNs)

• eg: Amazon Cloudfront

• Inexpensive !$1 = 2500minutes of streaming video

Page 32: HTTP Live Streaming Presentation

COST

• RTP/RTSP = open standards

• Free Open Source Server : Darwin Streaming Server

• HTTP Live Streaming = open specification

• Open Source toolchain and web servers

• Adobe Flash Media Streaming Server

• $995 License - or reverse engineered java implementation

Page 33: HTTP Live Streaming Presentation

CONCLUSION

Page 34: HTTP Live Streaming Presentation

HTTP Live Streaming RTP/RTSP Flash Media

Protocol Type

Server Cost

Ease of setup

Compatibility

Client Performance

Server Performance

Variable bitrates

Encryption

Authentication

Built in Failover

Seek delay

Ease of distribution

standard standard proprietary

free free $995

very easy Okay ?

low using plugins very high

great good high cpu on some platforms

great, network bound good, cpu bound ?

Built in some servers only latest version

Built in ? ~ server version

by protecting key files custom module ?

yes no no

~ segments duration < 2 seconds 4-10 seconds

Very easy ? ?

Page 35: HTTP Live Streaming Presentation

HTTP Live Streaming RTP/RTSP Flash Media

Protocol Type

Server Cost

Ease of setup

Compatibility

Client Performance

Server Performance

Variable bitrates

Encryption

Authentication

Built in Failover

Seek delay

Ease of distribution

standard standard proprietary

free free $995

very easy Okay ?

low using plugins very high

great good high cpu on some platforms

great, network bound good, cpu bound ?

Built in some servers only latest version

Built in ? ~ server version

by protecting key files custom module ?

yes no no

~ segments duration < 2 seconds 4-10 seconds

Very easy ? ?

Page 36: HTTP Live Streaming Presentation

HTTP Live Streaming RTP/RTSP Flash Media

Protocol Type

Server Cost

Ease of setup

Compatibility

Client Performance

Server Performance

Variable bitrates

Encryption

Authentication

Built in Failover

Seek delay

Ease of distribution

standard standard proprietary

free free $995

very easy Okay ?

low using plugins very high

great good high cpu on some platforms

great, network bound good, cpu bound ?

Built in some servers only latest version

Built in ? ~ server version

by protecting key files custom module ?

yes no no

~ segments duration < 2 seconds 4-10 seconds

Very easy ? ?

highest compatibilitylow latencyembedded devices

Page 37: HTTP Live Streaming Presentation

Thank you