Transcoding and adaptive streaming
Transcoding turns one uploaded video into several renditions at different bitrates and resolutions; adaptive streaming cuts each into short segments listed in a manifest, so the player can switch quality as the network changes.
What it is
Transcoding is an umbrella term for decoding a media file, processing it and encoding it again, so that the result has a different codec, resolution or bitrate from the original. A streaming service does this because devices and their bandwidth vary widely, and one source file can be turned into versions at several resolutions and bitrates to suit them. Adaptive streaming is what makes those renditions useful: the media is split into short chunks, with several quality levels available at each point in time, and the player picks a level per chunk. More quality levels and finer chunks give the player more room to adapt, at the cost of encoding time and storage, so the number of renditions is a deliberate trade-off rather than a default. Because the output is a set of files fetched over HTTP, no special streaming server is needed; a conventional web server is enough.
HLS, Apple's format, describes a presentation with two kinds of text playlist. A multivariant playlist lists variant streams, each a different version of the same content, and each variant points at a media playlist encoded at one bitrate, format and resolution. A media playlist lists the media segments in order, each with its duration, under a target duration that gives the approximate upper bound on segment length. The client downloads the playlist, then fetches and plays the segments in sequence; for a live stream it reloads the media playlist to discover segments that were added since. Variants exist for the player to switch between as network conditions change; renditions, such as audio in another language or a second camera angle, are chosen by user preference instead. The HLS specification draft I read is the second edition (draft 17, protocol version 12).
MPEG-DASH does the same job with an XML manifest, the media presentation description (MPD). It records each stream, the bandwidth it needs, its MIME type and codec string, and where its pieces live, including byte ranges when the pieces are ranges inside one file. Audio and video can be published as separate representations so the player fetches and prioritizes them independently. In a browser, DASH playback runs through JavaScript (dash.js) on top of Media Source Extensions, while HLS is built into iOS and macOS and plays on Safari and most Android devices; the two together cover most modern browsers, which is why they're the usual pair to publish.
# multivariant playlist (illustrative): one entry per variant stream
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
360p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720
720p/index.m3u8
# 360p/index.m3u8, a media playlist: the segments in order
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXTINF:6.0,
seg-000.m4s
#EXTINF:6.0,
seg-001.m4sKeyframes decide where a switch can happen. The HLS draft asks that any segment with H.264 video contain an IDR frame, the kind of frame a decoder can start from, and warns that frames ahead of the first IDR get downloaded but may be thrown away. Our advice for the transcoder: force a keyframe at each segment boundary, use the same boundaries in each rendition, and keep segment durations equal across renditions, so when the player jumps from 360p to 720p the next segment starts on a frame it can decode.
Containers and low latency. The segment formats HLS defines include MPEG-2 transport streams, fragmented MP4 and packed audio; a fragmented MP4 segment relies on a separate initialization section, signaled with an EXT-X-MAP tag, that holds the decoder setup but no samples. HLS media is commonly H.264 video with AAC audio. The low-latency mode combines partial segments, a playlist reload that blocks until new media exists, and preload hints so a live viewer sits closer to the live edge than whole-segment delivery allows.
When to use it
Reach for a transcoding pipeline and adaptive delivery when the audience's devices and networks vary and the content is longer than a short clip: a video-on-demand catalog, a live event, user uploads watched by strangers. The HLS design goal is exactly this, to keep playback uninterrupted at the best quality the current connection allows, and to do it through ordinary large-scale HTTP caching so a big audience is served from caches rather than from the origin. That makes a CDN the natural front for the segments.
The shape we'd propose in a round: the upload lands in blob storage and the request returns at once; a message on a job queue tells a pool of workers to transcode; the workers write each rendition's segments and the manifests to an output bucket; the player fetches everything through the CDN. Name segments by rendition and sequence number and treat them as immutable, which lets the CDN keep them for a long time. For live, the media playlist keeps changing as segments are appended, so it gets a short cache lifetime while the segments it points at keep a long one.
When not to
A single progressive MP4 is often the better answer. For a short clip, a small internal tool, or a known set of devices on a good network, one well-encoded file given to the player as a plain video source plays fine and costs one encode and one object. The adaptive setup adds a manifest, several renditions, more encoding time and more storage, which is wasted when there is nothing to adapt to.
Segment-based delivery is also the wrong fit for a conversation. The player fetches segments, or in low-latency mode partial segments, and plays them in turn, and the format's own low-latency mode promises reduced delay rather than none. A video call or a remote-control feed needs a transport built for real-time exchange, where the trade is the other way around: drop frames rather than wait for them. In a round, say which kind of latency the product needs before picking the delivery path.
And if the team is small, don't spend the round designing the encoder farm. Running your own transcoding hardware is costly and hard to scale, and file-based transcoding services exist that take an input and return outputs with no infrastructure for you to manage. Our advice: say you'd buy that part where you can, and spend the interview time on what is specific to your product: how jobs are queued and retried, how outputs are laid out in storage, which cache lifetimes the CDN applies, and what the player does when a rendition fails to load.
Compared
| Delivery option | How the player gets video | Pick it when | What it costs you |
|---|---|---|---|
One progressive file | Plays one MP4 file straight from a plain video source, as the non-adaptive fallback does | Short clips, few viewers, known devices on a good network | One quality for everyone; a slow link stalls rather than downgrades |
HLS | Fetches | Apple devices matter, native playback on iOS, macOS and Safari | Text playlists to generate, and to keep updating for live; several renditions to encode and store |
MPEG-DASH | Reads an XML MPD, then segments or byte ranges | Browser playback via dash.js and Media Source Extensions; the MPD declares each stream's codec | Needs a JavaScript player in browsers; pairing it with HLS is what reaches most of them |
Low-latency HLS | Partial segments, blocking playlist reloads, preload hints | Live events where viewers react to what they see | Many more requests per minute and a more demanding origin and CDN |
In a picture
Step 1 of 3
Upload lands
The uploader writes the source file to blob storage and gets its response immediately. A job message tells the transcode workers there is new work; nothing heavy happens inside the request.