Your SlideShare is downloading. ×
0
Streaming Video in iOS
Nirbhay K
http://above-inc.com
CocoaHeads - Cocoa on the Brain
Streaming Apps Overview
CNBC Pro Netflix Hulu +
Twitch.tvUstream.tvJustin.tv
Technology
• HLS (HTTP Live Streaming) - [Apple Inc.]
• Progressive Download
• Streaming on Other Platforms
– Smooth Strea...
MPEG–DASH
HTTP Streaming Standard
DASH - Dynamic Adaptive Streaming over HTTP .
Courtesy - http://xkcd.com/927/
Problems with streaming on iOS
• Network
• Do’s/Don’ts [Apple restrictions]
MEH.. !!
How do I get my streaming app
working??
Todays menu
• Streaming Live v/s Streaming On Demand
• How HLS works
• Setting up HLS on Server
• Streaming HLS in iOS
• U...
HLS Architecture
• Server components
• Distribution components
• Client components
HLS Architecture
• Server Components
– Media Encoder
– Stream Segmenter
• Media Segment File
• Index Files (m3u8 playlists...
HLS Architecture
• Distribution Components
File Ext. Mime Type
.m3u8 application/x-mpegURL or vnd.apple.mpegURL
.ts Video/...
HLS Architecture
• Client components
– End user media player software
– Custom player
– HTML5 Browser
HLS Architecture
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTIN...
HLS Architecture
• Simple Index File (m3u8)
M3U8 fomat,
Just a list of files to
play
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT...
HLS Architecture
• Simple Index File (m3u8)
M3U8 fomat,
Just a list of files to
play
Metadata tags
describing the
content
...
Each segment file
preceded by
metadata eg.
#EXTINF:10
(depicts segment
duration)
HLS Architecture
• Simple Index File (m3u...
If there is no end
tag client will treat
this as live stream
Each segment file
preceded by
metadata eg.
#EXTINF:10
(depict...
HLS Architecture
Basic Configuration Diagram
Courtesy - http://apple.com/
HLS Specification
HTTP Live Streaming Specification
TOOLS
• Media segmenter
– File Segmenter
– Stream segmenter (Will not cover it today)
• Streaming Tools – Download link
me...
Setting up HLS with Tools
File Segmenter
{ Demo }
Distributing HLS with Webservers
• Apache
• Nginx
• Any webserver/CDN
{ Demo }
What is Wowza Server
Wowza Media Systems® provides the next
generation of media streaming software which
simplifies the hi...
Why Wowza
• Integrated Live Transcoder
• Multi protocol nDVR
• Multi Platform DRM
• Streaming to multiple devices includin...
Life Before Wowza
Courtesy - http://www.telestream.net/
Wowza Live Stream delivery Diagram
Courtesy - http://www.wowza.com/
Setting up Wowza Server
{ Demo }
Live cam publishing on Wowza
{ Demo }
Consume Wowza stream
{ Demo }
Code Links
• iOS HLS Client
– https://github.com/NirbhayK/Streamingplayer
• Factime camera broadcast using VLC (script)
– ...
Q&A
Upcoming SlideShare
Loading in...5
×

Cocoaheads - Streaming on iOS devices

1,346

Published on

Transcript of "Cocoaheads - Streaming on iOS devices"

  1. 1. Streaming Video in iOS Nirbhay K http://above-inc.com CocoaHeads - Cocoa on the Brain
  2. 2. Streaming Apps Overview CNBC Pro Netflix Hulu + Twitch.tvUstream.tvJustin.tv
  3. 3. Technology • HLS (HTTP Live Streaming) - [Apple Inc.] • Progressive Download • Streaming on Other Platforms – Smooth Streaming -[Microsoft] – HDS (HTTP Dynamic Streaming) - [Adobe] – RTMP (Real Time Messaging Protocol) – [Adobe] – RTP (Real Time Transport Protocol) – RTCP (RTP Control Protocol) – RTSP (Real Time Streaming Protocol) = RTP+RTCP
  4. 4. MPEG–DASH HTTP Streaming Standard DASH - Dynamic Adaptive Streaming over HTTP . Courtesy - http://xkcd.com/927/
  5. 5. Problems with streaming on iOS • Network • Do’s/Don’ts [Apple restrictions]
  6. 6. MEH.. !! How do I get my streaming app working??
  7. 7. Todays menu • Streaming Live v/s Streaming On Demand • How HLS works • Setting up HLS on Server • Streaming HLS in iOS • Using Wowza Server to deliver multi device streaming
  8. 8. HLS Architecture • Server components • Distribution components • Client components
  9. 9. HLS Architecture • Server Components – Media Encoder – Stream Segmenter • Media Segment File • Index Files (m3u8 playlists) – File Segmenter
  10. 10. HLS Architecture • Distribution Components File Ext. Mime Type .m3u8 application/x-mpegURL or vnd.apple.mpegURL .ts Video/MP2T
  11. 11. HLS Architecture • Client components – End user media player software – Custom player – HTML5 Browser
  12. 12. HLS Architecture #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.00000, fileSequence0.ts #EXTINF:10.00000, fileSequence1.ts #EXTINF:10.00000, […] #EXT-X-ENDLIST • Simple Index File (m3u8)
  13. 13. HLS Architecture • Simple Index File (m3u8) M3U8 fomat, Just a list of files to play #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.00000, fileSequence0.ts #EXTINF:10.00000, fileSequence1.ts #EXTINF:10.00000, […] #EXT-X-ENDLIST
  14. 14. HLS Architecture • Simple Index File (m3u8) M3U8 fomat, Just a list of files to play Metadata tags describing the content #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.00000, fileSequence0.ts #EXTINF:10.00000, fileSequence1.ts #EXTINF:10.00000, […] #EXT-X-ENDLIST
  15. 15. Each segment file preceded by metadata eg. #EXTINF:10 (depicts segment duration) HLS Architecture • Simple Index File (m3u8) M3U8 fomat, Just a list of files to play Metadata tags describing the content #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.00000, fileSequence0.ts #EXTINF:10.00000, fileSequence1.ts #EXTINF:10.00000, […] #EXT-X-ENDLIST
  16. 16. If there is no end tag client will treat this as live stream Each segment file preceded by metadata eg. #EXTINF:10 (depicts segment duration) HLS Architecture • Simple Index File (m3u8) M3U8 fomat, Just a list of files to play Metadata tags describing the content #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.00000, fileSequence0.ts #EXTINF:10.00000, fileSequence1.ts #EXTINF:10.00000, […] #EXT-X-ENDLIST
  17. 17. HLS Architecture Basic Configuration Diagram Courtesy - http://apple.com/
  18. 18. HLS Specification HTTP Live Streaming Specification
  19. 19. TOOLS • Media segmenter – File Segmenter – Stream segmenter (Will not cover it today) • Streaming Tools – Download link mediafilesegmenter -f <foldername> <source file>.mp4 mediastreamsegmenter -s 3 -D -f <foldername> <live encoder url>
  20. 20. Setting up HLS with Tools
  21. 21. File Segmenter { Demo }
  22. 22. Distributing HLS with Webservers • Apache • Nginx • Any webserver/CDN { Demo }
  23. 23. What is Wowza Server Wowza Media Systems® provides the next generation of media streaming software which simplifies the highest quality live and on- demand video streaming to any Internet- connected device.
  24. 24. Why Wowza • Integrated Live Transcoder • Multi protocol nDVR • Multi Platform DRM • Streaming to multiple devices including IPTV devices • Restreaming of IP cameras or other sources • Encoder for SHOUTcast / ICEcast restreaming • Supports all major server OS • Recording of live streams • Multiparty video conferencing • 10GBps per server performance
  25. 25. Life Before Wowza Courtesy - http://www.telestream.net/
  26. 26. Wowza Live Stream delivery Diagram Courtesy - http://www.wowza.com/
  27. 27. Setting up Wowza Server { Demo }
  28. 28. Live cam publishing on Wowza { Demo }
  29. 29. Consume Wowza stream { Demo }
  30. 30. Code Links • iOS HLS Client – https://github.com/NirbhayK/Streamingplayer • Factime camera broadcast using VLC (script) – https://github.com/NirbhayK/vlcbroadcastscript
  31. 31. Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×