Video transcoding and adaptive playback 00:00:01 One film must cross a changing connection The lecture freezes as the train leaves station Wi-Fi. Six seconds of video are buffered, and the cellular link now delivers two megabits per second. Can the player predict the stall before it happens? Imagine two encodings. The high rendition uses four megabits per second and the low rendition uses one. Bitrate and pixel dimensions are separate choices. Both renditions follow the same four-second segment boundaries. At constant illustrative rates, the high segment carries sixteen megabits, or two decimal megabytes. The low segment carries four megabits, or half a megabyte. Think of the renditions as two editions of the same concert. Both carry the next four seconds of the performance. One sends more bits to represent those seconds, often buying detail in movement or texture. 00:00:52 Encode for the same time interval The player estimates available throughput and checks its buffer. If it requests the lower encoding for the next four seconds of the lecture, how long will the network transfer take? Divide four megabits by two megabits per second. The answer is two seconds, before protocol overhead or variability. Playback can continue during that download using media already present. When the low rendition arrives, the viewer has heard exactly the next part of the lecture. The player has changed the representation of those moments without jumping forward or backward. Start with six seconds of playable media. The low rendition arrives after two seconds, leaving four in the buffer, then adds four. Eight seconds are now available for playback. 00:01:37 Make the pieces interchangeable To make that switch work, the encoder and packager align time ranges and decoder entry points. Segment boundaries chosen independently across encodings can make transitions difficult. Check timestamps as well as the duration printed on a segment. A player should resume the same presentation time in the new rendition, with corresponding audio remaining in sync. The player needs an addressable media sequence for its chosen rendition. A playlist can also identify initialization data that the decoder needs before it can use the next segment. In H L S, a multivariant playlist describes the choices. Their media playlists locate the pieces. For this package each switchable segment starts at a decodable random-access point on a common presentation timeline. 00:02:25 Buffer a weak radio link Now request the high encoding with the same six seconds buffered. Sixteen megabits divided by two megabits per second takes eight seconds to download. The buffer reaches zero after six seconds. The high segment is still two seconds away. In this simplified whole-segment model the viewer waits two seconds, then receives four more seconds of media. Real segment sizes and bandwidth vary. The estimate can be wrong, network overhead consumes time and a player can have additional buffering rules. Leave a safety margin when selecting a rendition. Count bits divided by bits per second to obtain seconds on the network. Count seconds of media separately. A four-second segment can take eight seconds to download, and its duration remains four seconds. 00:03:14 Choose a ladder for the audience Adding intermediate variants gives the player a finer tradeoff between quality and protection against a sudden bandwidth drop. Each extra variant also costs encoding, validation, storage and sometimes cache efficiency. A player may step back up after sustained favorable measurements. Immediate switches after every noisy sample can cause visible quality oscillations even when playback itself never stops. For this train ride, low is the safe choice on the measured link. It completes in two seconds and grows the buffer. High takes eight seconds and drains it. For a recording, the viewer can often tolerate a larger reservoir. Live viewers also care how far they trail the event. Both players still have to choose a rendition that arrives before their useful buffer runs out.