Skip to main content

Crate moq_transcode

Crate moq_transcode 

Source
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 openh264 as the 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. Other decoders scale on the CPU.

Structs§

Config
Transcoder configuration for run.
Rung
One candidate output rendition: a target resolution (by height) and bitrate.

Enums§

Error
Errors returned by moq-transcode.

Functions§

run
Transcode source into output until the source broadcast ends.