Video and audio
Transcode uploads into adaptive streams inside a sandbox, refuse files past their limits, and give every video a poster, captions and even loudness.
- Required 1
- Recommended 4
- Optional 1
Required
Run media tools in a sandbox with no network
MED-14Run every tool that decodes uploaded media, such as FFmpeg or ImageMagick, in a sandbox. It has no network, sees only its input and output folders, and stops at a time and memory limit.
Recommended
Transcode every video into an adaptive stream
MED-13Transcode 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.
Probe each media file and refuse it past its limits
MED-15Before transcoding, read each file's duration, resolution and frame rate with a probe such as
ffprobe. Refuse the file when any value passes the limit of its upload kind.Make a poster and a thumbnail from every video
MED-16Make a poster image and a thumbnail for every video in the transcoding job, and let the uploader pick another frame. Keep the thumbnail address the same when the video is encoded again.
Keep captions as WebVTT files with each video
MED-17Store each video's captions as WebVTT files, one per language, and list them in its player and its stream. Let uploaders add and correct them, and mark machine captions as automatic until a person checks them.
Optional
Even out the loudness of uploaded audio
MED-18Measure each uploaded audio track's loudness by ITU-R BS.1770 and adjust it to one target, such as −23 LUFS with peaks under −1 dBTP.
Rules on video and audio in other playbooks
- Send video that starts fast and costs little sets the poster, preload and range requests for
<video>. - Load embedded videos and maps only after a click keeps third-party players from tracking visitors.
- Give each video a watch page gets videos into search results.
- Let large downloads resume with range requests lets players seek and resume.
- Report child sexual abuse material and keep the evidence applies to video uploads too.
For agents: this playbook is free to use under CC 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">Agent Wranglers files and media playbook</a>. In code you write, add a comment next to it with the same link.