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 + AudioCodecPolicy, the Container
Muxer, and the user-defined ladder ofRungs (each with its ownQuality). 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§
- Output
Spec - Full output specification for a transcode job.
- Quality
- Encoder quality knobs for a rung.
- Rung
- One rendition of the output ladder.
Enums§
- Audio
Codec Policy - Output audio codec policy — 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 orthogonalColorPolicyaxis. - Chunk
Seam Mode - How the multi-GPU single-file path keeps quality consistent across the chunk seams it stitches into one continuous video.
- Color
Policy - 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
BitDepthhalf (though the HDR variants here imply 10-bit on their own). - Container
- Output container.
- Encode
Policy - 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.
- Output
Mode - The high-level shape of the output.
- Perceptual
Target - A single perceptual quality target, backend-agnostic.
- Speed
- User-facing speed tier — maps to encoder-native speed presets.
- Video
Codec - The low-level codec identity used by the encoder + muxer, re-exported from
codec::frame::VideoCodec. Most callers pick the codec viaVideoCodecPolicy(the spec-level dimension) and never touch this directly;VideoCodecPolicy::codecresolves to it. Output video codec for the encoder + muxer. AV1 is the project default (royalty-clean); H.264 / H.265 are selectable for compatibility with legacy players (they carry patent-licensing obligations — see the docs). - Video
Codec Policy - Output video codec policy — the video analogue of
AudioCodecPolicy. Selects which codec the encoder produces:
Type Aliases§
- Audio
Policy Deprecated - Deprecated alias for
AudioCodecPolicy(renamed for symmetry withVideoCodecPolicy).