Expand description
Just-in-time live transcoding for hang broadcasts.
run consumes a source broadcast and fills a derivative broadcast: a
catalog advertising lower renditions (rungs) of the source video plus
references back to the source renditions, and one output video track per
rung. The catalog is published immediately and deterministically (codec
strings are computed from the ladder, not the bitstream), but nothing is
encoded until a subscriber actually asks:
- Subscribing to a rung attaches it to a shared live decode of the source (one subscription and one decoder per source, no matter how many rungs are active); each rung resizes and encodes its own copy, group for group, stopping when the last subscriber leaves.
- Fetching a specific group fetches that same group from the source and transcodes just that group. Output groups mirror source sequence numbers 1:1, so group N of every rung is the same content as source group N.
The codec work is moq-video: hardware where available (NVDEC + NVENC on
Linux, VideoToolbox on macOS, Media Foundation on Windows), with the default
openh264 feature providing H.264 software fallback. On an NVIDIA GPU the whole pipeline is
GPU-resident: NVDEC decodes and scales in hardware and NVENC encodes the
CUDA frame in place, with no CPU copies. macOS and Windows also resize on
the GPU; set Config::resize’s output to Output::Cpu to decode to CPU
pixels and resize there.
Re-exports§
Modules§
- active
- Which renditions are encoding, and how much each has produced.
- ladder
- Validated output renditions in ascending bitrate and height order.
Structs§
- Config
- Transcoder configuration for
run. - Transcoder
- A transcoder, split from the future that drives it.
Enums§
- Error
- Errors returned by
moq-transcode.
Functions§
- run
- Transcode
sourceintooutputuntil the source broadcast ends.