Apple Streaming

Revision as of 08:53, 23 July 2021 by Connor.sanders (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

HTTP Live Streaming (HLS) is a technology for Apple devices such as iPhones, iPads, iPod Touches and Safari to receive live video streams, given Apples disapproval of Flash RTMP streaming.

Functional Overview

Broadly, video is ingested from some source (in our case the YSTV live stream) and transcoded to an H.264 format and fed to a segmenter. The segmenter splits incoming video into short chunks of a few seconds long, and generates an M3U8 playlist file with addresses of the currently active chunks. Were this a static, non-live video file the transcoded video could be passed directly to the segmenter and all generated at once, however there are are other, simpler ways to serve on-demand video, using HTML5 players. The segments and playlist file are published to a directory on a web server, and the client reads the playlist file, and uses this to download the chunks listed and play them back to back. Meanwhile the playlist file is continually updated to remove the old files and add new files in.

Encoding

Strm7 does the transcoding for this stream, as well as the (flash) SD version of the stream.

Clientside

For the clients, a simple browser detection script scans to see if the user is on an iPhone or similar, and if they are queries the database for an HLS stream name for that stream. If one is found, it is prepended with the site address (http://ystv.co.uk/ unless on a development server) and presented as a video tag containing an image of the YSTV logo in place of the usual live stream box, linked to the M3U8 playlist. Normally the user's device will then render a play symbol over the top, tapping this will open the phone's native HLS player.