Skip to main content

Module spec

Module spec 

Source
Expand description

Output specification — how a job should be transcoded.

A job is described by an OutputSpec: the OutputMode (single file vs segmented HLS), the VideoCodec + AudioPolicy, the Container

  • Muxer, and the user-defined ladder of Rungs (each with its own Quality). Nothing about the output is hard-coded — the caller decides the shape, the codec, the quality, and the renditions.
use rivet::spec::{OutputSpec, Rung, Quality};

// A 3-rung HLS ladder with 4-second segments.
let spec = OutputSpec::hls(
    vec![Rung::new(1920, 1080), Rung::new(1280, 720), Rung::new(640, 360)],
    4.0,
);
assert!(spec.validate().is_ok());

Structs§

OutputSpec
Full output specification for a transcode job.
Quality
Encoder quality knobs for a rung.
Rung
One rendition of the output ladder.

Enums§

AudioPolicy
How the source audio track is handled.
BitDepth
Output bit depth — bits per sample. The on-disk pixel format is derived from this (the encoder is always AV1 4:2:0, the web-safe chroma subsampling): 8-bit → yuv420p, 10-bit → yuv420p10le (le = little-endian 16-bit words holding 10 valid bits). Bit depth is one axis; gamut + SDR/HDR transfer is the orthogonal ColorPolicy axis.
ChunkSeamMode
How the multi-GPU single-file path keeps quality consistent across the chunk seams it stitches into one continuous video.
ColorPolicy
Output color policy — the gamut (which colors are representable) and the transfer curve (SDR vs HDR), plus whether to tonemap an HDR source down. This is the color half of the decision; bit depth is the separate BitDepth half (though the HDR variants here imply 10-bit on their own).
Container
Output container.
EncodePolicy
Selects how a job’s encode work is distributed across the host’s GPUs.
GpuFamily
A GPU vendor family, for constraining encode to one vendor’s devices.
Muxer
Muxer — how the container bytes are assembled.
OutputMode
The high-level shape of the output.
PerceptualTarget
A single perceptual quality target, backend-agnostic.
Speed
User-facing speed tier — maps to encoder-native speed presets.
VideoCodec
Output video codec.