Using Apple’s HTTP Live Streaming (HLS) Tools
Segment your video stream and create media playlists for successful transmission with Apple’s provided tools.
Overview
Apple provides HLS Tools to help you set up an HLS service. HLS Tools update frequently; you can download the current versions from the Apple Developer Downloads website. To access them, sign in with the Apple ID associated with your developer account.
Download the tools
The download package contains the following tools:
Media File Segmenter (
mediafilesegmenter) divides a transport stream input or file — such as an MOV, MP4, M4V, M4A, or MP3 — into media segments, creates a media playlist, and can also perform segment encryption. You can deploy the media playlist and media segments using almost any web server infrastructure for streaming to iOS, macOS, and tvOS. The Media File Segmenter only produces Video-on-Demand (VOD) streams.Media Subtitle Segmenter (
mediasubtitlesegmenter) converts subtitle tracks from a QuickTime file with tx3g-formatted subtitle tracks or SRT files into WebVTT, then segments them for deployment using HLS. It also segments WebVTT files.Media Stream Segmenter (
mediastreamsegmenter) receives an MPEG-2 transport stream over a UDP network connection or an input stream on a local port and packages it for HLS. It writes a single live Media Playlist with its corresponding Media Segments (including Partial Segments in Low-Latency mode) and can also perform segment encryption. The Media Stream Segmenter writes its output to the local file system or a WebDAV endpoint. You can deploy the live Media Playlist and Segments using almost any web server infrastructure for streaming to iOS, macOS, and tvOS. The Media Stream Segmenter produces either live or VOD streams.Variant Playlist Creator (
variantplaylistcreator) works with Media File Segmenter to create a multivariant playlist from multiple VOD streams.Media Stream Validator (
mediastreamvalidator) simulates an HLS session and verifies that the media playlist and media segments conform to the HLS specification. This tool can validate local files and HTTP URLs.HLS Report (
hlsreport) uses the JSON file generated by Media Stream Validator to create a report for the validated stream.ID3 Tag Generator (
id3taggenerator) creates ID3 tags as metadata for the Media File Segmenter or sends them over the network to the Media Stream Segmenter.TS Recompressor (
tsrecompressor) uses a file or standard input to produce and encode up to four continuous audio and video streams at different bit rates. It multicasts them as MPEG-2 Transport Streams to local UDP ports. The tool can produce content programmatically, or capture video from the system camera and microphone. In programmatic mode, it creates a test pattern stream that features burnt-in timecode video and linear timecode audio. Both presentations use real-time Society of Motion Picture and Television Engineers (SMPTE) timecodes derived from the system clock.Low-Latency HLS Golang script (
ll-hls-origin-example.go) implements the HLS Origin API for a Low-Latency HLS media playlist.Low-Latency HLS PHP script (
lowLatencyHLS.php) implements the HLS Origin API for a Low-Latency HLS media playlist. It can be used as an alternative to the Low-Latency HLS Golang script.
When creating your own tools or using a third-party tool, ensure that the tool output conforms to Apple’s standards.