---
title: "Transcode every video into an adaptive · Agent Wranglers"
url: https://agentwranglers.se/playbook/files-and-media/video-and-audio/adaptive-streaming
id: MED-13
level: Recommended
updated: 2026-10-22
tokens: 829
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Transcode every video into an adaptive stream

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Video and audio](https://agentwranglers.se/playbook/files-and-media/video-and-audio.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: MED-13
- Level: Recommended
- Chapter: [Video and audio](https://agentwranglers.se/playbook/files-and-media/video-and-audio.md)
- Rule: Transcode every uploaded video in a background job into an HLS or DASH stream with three or more renditions, and play that stream. Never play the uploaded original.
- Check: Upload a 1080p test video. The job writes a multivariant playlist with three or more renditions, and no segment is longer than 6.5 seconds. A request for the original without a signature answers 403.
- How: A video straight from a phone is large and uses whatever codec the phone chose. An adaptive stream splits each rendition into short segments, so the player switches quality as the connection changes. HLS is described in RFC 8216, and DASH is ISO/IEC 23009-1. Write fragmented MP4 segments, so one set of files can serve both. Apple's HLS authoring specification sets a target segment length of 6 seconds and a keyframe every 2 seconds. It asks for some H.264 renditions for older devices, and an I-frame playlist for scrubbing. Its example ladder starts at 416 by 234 pixels and 145 kbit/s. Keep the original private, so you can encode it again when codecs change. Mark the video ready only when every rendition exists. Run the job in the sandbox from [Run media tools in a sandbox with no network](https://agentwranglers.se/playbook/files-and-media/video-and-audio/media-tool-sandbox.md). Short clips may play as plain MP4 instead, as [Send video that starts fast and costs little](https://agentwranglers.se/playbook/website/performance/video-delivery.md) says.

## Sources

- [RFC 8216 (HTTP Live Streaming)](https://www.rfc-editor.org/rfc/rfc8216)
- [Apple HLS authoring specification for Apple devices](https://developer.apple.com/documentation/http-live-streaming/hls-authoring-specification-for-apple-devices)

## Related rules

- MED-14 [Run media tools in a sandbox with no network](https://agentwranglers.se/playbook/files-and-media/video-and-audio/media-tool-sandbox.md) in Files and media
- WEB-59 [Send video that starts fast and costs little](https://agentwranglers.se/playbook/website/performance/video-delivery.md) in Website
- MED-16 [Make a poster and a thumbnail from every video](https://agentwranglers.se/playbook/files-and-media/video-and-audio/video-posters.md) in Files and media

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/files-and-media/video-and-audio/adaptive-streaming">Agent Wranglers files and media playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Run media tools in a sandbox with no network](https://agentwranglers.se/playbook/files-and-media/video-and-audio/media-tool-sandbox.md)
- [Video and audio](https://agentwranglers.se/playbook/files-and-media/video-and-audio.md)
