Skip to content
19 changes: 6 additions & 13 deletions doc/lib/js/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,12 @@ broken media automatically.

A video rendition encoded with intra refresh has no keyframes, and its catalog
`warmup` says how long a decoder takes to clean up after joining. The player
decodes such a rendition twice: one decoder holds your delay and may show
refresh stripes after a join or a skip, while a second starts one group earlier
and tolerates `warmup` more lateness, so its picture is clean. The clean
picture shows whenever it has caught up. Each decoder costs its own CPU and
decoder memory, and both share one subscription. A rendition without `warmup`
uses one decoder.

An H.264 group of such a rendition opens on a recovery point that is not an
IDR. Chromium's WebCodecs refuses to open a decoder on that picture: it wants
an IDR or a recovery point that counts zero frames. So when a decoder opens on
one, the player inserts a second recovery point with a zero count before its
first slice. The slices are untouched; the stripes clear as the sweep
completes.
joins such a rendition that much earlier and decodes from the group start, but
shows nothing until the warmup has passed, after a join and after each skip.
An H.264 group opens on a recovery point that is not an IDR, which Chromium's
WebCodecs refuses unless it counts zero frames, so the player inserts one that
does before the first slice. Firefox and Safari are untested, and Chromium
refuses an H.265 group that opens without an IDR.

`el.broadcast.out.status` is `connecting`, `offline`, `loading`, `live`, `error`, or `unsupported`.
It reads `connecting` until a session could have announced the broadcast: while the
Expand Down
2 changes: 1 addition & 1 deletion js/hang/src/container/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface ConsumerProps {
/**
* How much further than the min delay the start reaches, in milliseconds (default: 0), so a
* decoder that needs that much media before its output is clean starts early enough, such as an
* Opus decoder or the max-delay decoder of an intra-refresh rendition. Pass the catalog
* Opus decoder or an intra-refresh video decoder. Pass the catalog
* rendition's `warmup`. Mirrors Rust's `container::Playout`.
*
* Put the max delay plus the warmup on the subscription, since the publisher skips what falls
Expand Down
3 changes: 2 additions & 1 deletion js/watch/src/video/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type * as Catalog from "@moq/hang/catalog";
/** The catalog fields that determine the demuxer and WebCodecs decoder instance. */
export type DecoderConfig = Pick<
Catalog.VideoConfig,
"codec" | "container" | "description" | "displayAspectWidth" | "displayAspectHeight"
"codec" | "container" | "description" | "displayAspectWidth" | "displayAspectHeight" | "warmup"
> & {
optimizeForLatency: boolean;
interlaced: boolean;
Expand Down Expand Up @@ -31,6 +31,7 @@ export function playbackIdentity(config: Catalog.VideoConfig): PlaybackIdentity
displayAspectHeight: config.displayAspectHeight,
optimizeForLatency: config.optimizeForLatency ?? true,
interlaced: config.interlaced ?? false,
warmup: config.warmup,
},
};
}
Expand Down
Loading