Repository navigation
Done
Description
Summary
Turn uploaded videos into HLS streams with adaptive bitrate, so playback starts fast and adjusts to the viewer's connection.
Part of Phase 1 of #247. Depends on Phase 0 (#257).
Inspiration: https://x.com/steve_tenuto/status/1854919704483434763
Settings
Two new media settings (see #247):
videoStreaming: "off" | "hls" | "mp4"("mp4"is covered in Video step: MP4 optimized for web playback #264)"hls"by default for new apps."off"for apps that existed before this change, so their processing and storage use don't change without notice.
hlsRenditions: which renditions to make, e.g.["1080p", "720p", "480p"].- Default:
["1080p", "720p", "480p"]. - Values are checked against a fixed list (e.g.
2160p,1440p,1080p,720p,480p,360p). Users can't set raw bitrates or ffmpeg arguments.
- Default:
Like the other media settings, both are managed through the REST API, MCP tools, CLI and the dashboard, and changing them affects new uploads only.
Behavior
- When
videoStreamingis"hls", a video upload queues an HLS job. The upload response doesn't wait for it. - The job reads the video from S3 and makes every rendition in one ffmpeg run (one decode, several outputs). It writes the segments and a master playlist under the media's prefix.
- No upscaling. Renditions larger than the source are skipped, using the metadata from Read media metadata (duration, resolution, codecs) #267. A 720p upload with the default settings gets 720p and 480p.
- The output is stored as the
hlsderivative (Store processing outputs as derivatives and track processing status #261). Clients playmedia.derivatives.hls.url. - When the job finishes or fails, the media's processing status changes and a webhook fires (Webhooks when media processing finishes or fails #198).
- The original file is kept.
Open questions
- Segment length and codec settings (e.g. 6-second segments, H.264 and AAC) for the widest player support.
- How private media is signed: one CloudFront signed cookie or policy for the whole prefix instead of one signature per segment URL. HLS with AES-128 encryption and a key endpoint #271 needs the same thing.
- Player support in
@medialit/react(hls.js, with native HLS on Safari). - Storage and metering: segments count toward storage, and encoding counts toward processing minutes (Pipelines #247).
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
s3rot0n1n commentedon Nov 28, 2026
Delivered in #291 (pipelines phase 1, step 5): HLS with adaptive bitrate, turned on with
videoStreaming: "hls". Closing; the PR didn't use a closing keyword.