Skip to content

Introducing Appwrite Videos: adaptive video streaming

Appwrite Videos turns video files in Storage into adaptive HLS, DASH, and CMAF streams, with encoding profiles, captions, thumbnails, and an embeddable player.

6 min read

Putting an MP4 in a bucket and pointing a <video> tag at it works until someone watches on a train. The viewer downloads one large file at one quality, the player stops to buffer when the connection dips, and anyone who leaves after a minute still pulled bytes they never watched. Streaming fixes that, but it takes encoding, packaging, manifests, captions, and thumbnails, usually from a separate service with its own access rules.

Today we are launching Appwrite Videos, adaptive video streaming built into your Appwrite project. Create a video from a file already in Storage, encode it into a ladder of renditions, and stream it as HLS, DASH, or CMAF to any player, or embed the hosted Appwrite player with one <iframe>. Captions, scrubbing thumbnails, and per-video permissions come with it.

What Appwrite Videos gives you

  • Streams from your Storage files: Create a video from a file in any bucket. The source stays where it is, untouched, and can stay private.
  • An encoding ladder you control: Encoding profiles set the resolution and bitrate of each rendition, and players switch between renditions as the connection changes.
  • HLS, DASH, and CMAF: CMAF encodes once and serves both an HLS and a DASH manifest, so one ladder plays in every common player.
  • Captions and thumbnails: Upload WebVTT or SubRip tracks, or write them in the caption editor. Scrubbing thumbnails are generated for every video.
  • A player you can embed: Every video has a hosted player for any website, and its master manifest works in hls.js, Shaka Player, AVPlayer, ExoPlayer, and more.
  • An inspector for every stream: Watch time to first frame, rebuffering, bitrate, and every segment request while a video plays.

From a Storage file to a stream

A video in Appwrite points at a source file in a Storage bucket. Treat that file as your master copy: players never download it. Appwrite probes it for duration, resolution, and codecs, then encodes renditions from it, each split into segments of up to 4 seconds.

Each rendition is one encode of the video against one encoding profile, packaged for one output. Players load the output's master manifest first, then follow it to the renditions, captions, and segments.

Text
Storage file ──> Video ──> Renditions (profile × output) ──> Master manifest ──> Player
                   ├──> Captions
                   └──> Timeline (sprites + WebVTT)

With a server SDK, a file becomes a stream in two calls:

JavaScript
import { Client, ID, Videos, VideoOutput, Permission, Role } from 'node-appwrite';

const client = new Client()
    .setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
    .setProject('<PROJECT_ID>')
    .setKey('<API_KEY>');

const videos = new Videos(client);

const video = await videos.create({
    videoId: ID.unique(),
    bucketId: '<BUCKET_ID>',
    fileId: '<FILE_ID>',
    permissions: [Permission.read(Role.any())]
});

await videos.createRendition({
    videoId: video.$id,
    profileId: '<PROFILE_ID>',
    output: VideoOutput.Cmaf
});

Call createRendition once for each profile. Encoding runs in the background, and each rendition reports its status and progress until it is Ready. In the Console, the Create video wizard does the same in one step: upload a file or pick one from Storage, keep the suggested profiles, and click Create video.

Encoding profiles for your ladder

Two numbers decide how a rendition looks: its resolution and its bitrate. An encoding profile sets both, along with the audio bitrate and the codec, and you create profiles once per project. The Console has presets from 360p to 2160p. Some of them:

PresetResolutionVideo bitrate
360p640 × 360800 kbps
720p1280 × 7202,800 kbps
1080p1920 × 10805,000 kbps
2160p3840 × 216016,000 kbps

Three to five profiles cover most viewers, from a weak mobile connection to a fast desktop one. Start with a rung around 360p, so viewers on a poor connection play instead of buffering. The Console marks profiles larger than the source as Upscale and leaves them out by default, since upscaling adds size without adding detail. Profiles encode H.264 today.

HLS, DASH, and CMAF from one encode

Every rendition is packaged for one output:

  • HLS uses MPEG-TS segments. It plays natively on Safari, iOS, and tvOS, and with hls.js everywhere else.
  • DASH uses fMP4 segments. It plays in dash.js, Shaka Player, ExoPlayer, and most smart TVs.
  • CMAF encodes fMP4 segments once and serves both an HLS and a DASH master manifest for them.

CMAF is the default, because you get both formats for the encoding time and storage of one. Choose HLS or DASH only when a player you support needs it. You can add another output later without touching the renditions you have.

Captions and scrubbing thumbnails

Upload captions as WebVTT or SubRip files, and Appwrite converts them to WebVTT, segments them, and lists them in the master manifest, so players show them with no extra code. Text subtitle tracks embedded in the source are extracted automatically, and one caption per video can be the default that players turn on by themselves.

The Console also has a caption editor, with the player, the list of cues, and a timeline to retime them. It flags cues that overlap, run past the end of the video, or read faster than 20 characters per second.

Every video also gets a timeline: sprite sheets of thumbnails with a WebVTT index, generated when you create the video. Players use it to show a preview as viewers scrub, without hundreds of image requests.

Embed the player, or bring your own

Every video comes with a hosted player. Embed it on any website with an <iframe>:

HTML
<iframe
  src="https://appwrite.io/player/<VIDEO_ID>?project=<PROJECT_ID>"
  title="Product demo"
  allow="autoplay; fullscreen; picture-in-picture"
  allowfullscreen
  style="width:100%;aspect-ratio:16/9;border:0;"
></iframe>

Viewers get adaptive streaming, captions and audio tracks, playback speed from 0.5× to 2×, picture in picture, keyboard shortcuts, and double tap to seek on phones. URL options set the start time, autoplay, looping, controls, and an accent color, and the Preview panel in the Console lets you try them before you copy the code.

To build playback into your own app, give the master manifest URL to a standard player. There is no Appwrite SDK to add for playback. The Install page of each video gives you setup code for the web, Apple platforms, Android, Flutter, and React Native with your stream URL filled in, and Copy prompt hands the same setup to an AI coding agent.

See how every stream plays

The inspector shows what the player is doing while a video plays: an experience score for the session, time to first frame, rebuffering, average bitrate, quality switches, and dropped frames. Its other sections list the bitrate ladder the player parsed, every segment request in a waterfall, and the manifests it loaded.

Use it to test a ladder before you roll it out: throttle the network in your browser, play the video, and see which renditions the player picked. The inspector can also open in its own window, next to the video or on another screen.

Permissions for every video

Each video has its own permissions, separate from the file it was made from. Playback checks the video's read permission, so the source can stay private in its bucket while the stream is public.

  • Public videos: Grant Read to Role.any() for a video on a website or in an app.
  • Members-only videos: Grant Read to Role.users(), a team, or a team role, for example for a paid course.
  • Private playback on the web: Send a JWT for the signed-in user with each request, or serve Appwrite from a custom domain that shares your app's domain.

Automate every upload with Functions

To turn every upload into a stream without opening the Console, run a function on the buckets.<BUCKET_ID>.files.*.create event. The event fires once the whole file is uploaded, and the function creates the video and a rendition for each of your profiles.

Keep titles, owners, and visibility in your own database next to the video ID, and build the manifest URL from it when your app shows the video.

Get started with Appwrite Videos

Appwrite Videos is available today on Appwrite Cloud. Open Videos in your project, create a few encoding profiles from the presets, and turn your first file into a stream. To try it without a file of your own, choose Demo as the source and pick one of the Blender open movies.

Appwrite Videos turns video and audio files in Appwrite Storage into adaptive streams. You create a video from a file in a bucket, encode it into a ladder of renditions, and play the master manifest in any HLS or DASH player, or embed the hosted Appwrite player. See the Videos docs.

HLS, DASH, and CMAF. HLS uses MPEG-TS segments and a master.m3u8 manifest, DASH uses fMP4 segments and a master.mpd manifest, and CMAF encodes fMP4 segments once and serves both manifests. CMAF is the default in the Console. See Outputs.

No. Each video has its own permissions, and playback checks the video's read permission, not the file's. The source file can stay private in its bucket while the stream is public. See Permissions.

Upload a WebVTT or SubRip file to Storage and attach it to the video with a name and a language code, or write a track in the caption editor in the Console. Text subtitle tracks embedded in the source are extracted automatically. Ready captions are listed in the master manifest, so players show them without extra code. See Captions.

Yes. Every video comes with a hosted player that you embed with an <iframe>, with options for start time, autoplay, looping, controls, and accent color. Public videos play for anyone. See Embed the video player.

H.264 today. A profile sets the resolution, video and audio bitrate, and codec of its renditions, and videos.listCodecs() lists the codecs you can use. See Encoding profiles.

Read next