Reading note

A viewer request is what starts the encoder.

On-demand encode means a track stays quiet until you ask for it. MoQ Boy shows this. Encode stays off until a viewer subscribes, per track.

SI (Super Intelligence) tracks work the same way. Captions or a smaller picture run only while you watch them.

This site is not an encoder.

The demo path is /on-demand-encode. The alias /learn/on-demand-encode on colorbars.dev is the same page.

From a viewer intent to a sleeping track

  1. 01 · IntentViewer SUBSCRIBE
  2. 02 · MergeOne publisher subscription
  3. 03 · WakeEncode while subscribed
  4. 04 · SleepIdle tracks stop

SUBSCRIBE · per track

You ask for one track, not the whole show.

A player that wants picture, sound, or captions sends SUBSCRIBE for that track. SUBSCRIBE means you ask to watch that track. In MoQ Boy, the browser does this per track. It sends UNSUBSCRIBE when the picture leaves the view. The catalog can name a track before any frame exists. Asking is what makes the work worth doing.

Relay · fan-in

Many viewers become one job for the publisher.

The relay gathers every request for the same track. It shows the publisher one subscription. A hundred viewers can still mean one encode. The app chooses which requests to follow. The relay only shares the track. It does not make that choice.

N viewers → SUBSCRIBE one track
relay     → 1 publisher subscription
encode    → only while that sub is live

Publisher · on demand

The costly work starts when someone is watching.

A publisher sends a track only while a subscription is active. It can wait to encode until then. MoQ Boy turns video encode off when nobody wants video. It turns audio encode off when nobody wants audio. If neither is subscribed, the source can sleep. An SI publisher uses the same rule. Captions run only while you have captions on. A smaller detection picture can run while the full picture stays idle.

no video sub  →  video encoder sleeps
no audio sub  →  audio encoder sleeps
neither       →  source can sleep
captions sub  →  that rendition runs

Idle · unsubscribe

When the last viewer leaves, the track sleeps.

The publisher subscription ends with the last viewer. Idle tracks do not keep spending encode. If you do not ask for captions, that job does not run. If you do not ask for another codec, that transcode does not run. A full-size track can stay dark until you ask for it.

What the sources are for

MoQ Boy

Encode only while someone is watching

The open demo at moq.dev/boy is the readable version of on-demand encode. Nothing is encoded until at least one viewer subscribes, per track.

Merged intents

One subscription, however many viewers

Viewer SUBSCRIBE requests for a track collapse before they reach the publisher. The encode side sees demand, not one socket per viewer.

Idle sleep

An empty track is a stopped track

If nobody wants audio, the audio encoder sleeps. If nobody wants video, the video encoder sleeps. If neither is on, the source can sleep. Leaving the view sends UNSUBSCRIBE. If everyone leaves, the work stops.

SI renditions

SI tracks have their own audience

An SI publisher runs captions only while you have them on. Object detection can read a smaller picture. The full-size track can stay idle. Another codec is another subscription. If you do not want it, it is not made.

Catalog first

Name the track before the frames exist

A catalog can name a track that has not been encoded yet. Frames move only after a subscription.

The bench

colorbars.dev has the live demo

This page is the reading note. The live demo is colorbars.dev/on-demand-encode. The path is /on-demand-encode. The alias /learn/on-demand-encode is the same page.

Partners

The open stack is at moq.dev. moq.pro is a separate host. We build our own tools on top of their work. We don't run those sites.

Sources

  • MoQ Boy. On-demand emulation and encode, per track, on the open stack. moq.dev/boy
  • kixelated, “MoqBoy,” moq.dev, 16 April 2026. SUBSCRIBE merges at the relay; encoders and the emulator sleep without an audience. moq.dev/blog/moq-boy
  • "MoQ for AI" on doc.moq.dev, their guide to running SI tracks only while someone watches.
  • Open implementation, libraries, and self-hosted relay: moq.dev.
  • Interactive bench for the same story, owned and served live by colorbars.dev. Canonical path colorbars.dev/on-demand-encode. The alias /learn/on-demand-encode on that host is the same page.