pub struct OutputSpec {Show 14 fields
pub mode: OutputMode,
pub video_codec: VideoCodec,
pub audio: AudioPolicy,
pub container: Container,
pub muxer: Muxer,
pub rungs: Vec<Rung>,
pub max_frame_rate: Option<f64>,
pub gpu_index: Option<u32>,
pub encode_policy: EncodePolicy,
pub decode_gpu: Option<u32>,
pub color: ColorPolicy,
pub bit_depth: BitDepth,
pub chunk_seam_mode: ChunkSeamMode,
pub filters: Vec<VideoFilter>,
}Expand description
Full output specification for a transcode job.
Fields§
§mode: OutputModeOutput shape.
video_codec: VideoCodecVideo codec (AV1 only today).
audio: AudioPolicyAudio handling.
container: ContainerContainer format.
muxer: MuxerMuxer.
rungs: Vec<Rung>The ladder. Order is preserved; the first rung is treated as the “primary” for single-file callers that only want one output.
max_frame_rate: Option<f64>Cap the output frame rate (the encoder’s signalled fps is clamped to
this; the source cadence is otherwise preserved). None = source fps.
gpu_index: Option<u32>Pin hardware encode/decode to this GPU index on multi-GPU hosts.
Kept in sync with encode_policy (SingleGpu(idx) ⇒ gpu_index = idx).
encode_policy: EncodePolicyHow to spread encode work across GPUs. See EncodePolicy.
decode_gpu: Option<u32>Decode-pump GPU override. None (default) pins the decode pump to a GPU
consistent with encode_policy (the first device of the selected
family/set, round-robin for per-rung pumps). Some(i) forces decode
onto GPU i — e.g. decode on an iGPU while the dGPUs encode.
color: ColorPolicyOutput color / tonemap policy. See ColorPolicy.
bit_depth: BitDepthOutput bit depth. See BitDepth.
chunk_seam_mode: ChunkSeamModeHow the multi-GPU single-file path keeps quality consistent across
the chunk seams it stitches. See ChunkSeamMode.
filters: Vec<VideoFilter>Video filters applied per-frame before per-rung scaling (crop, pad,
flip, rotate, grayscale). Empty = none. See codec::filter.
Implementations§
Source§impl OutputSpec
impl OutputSpec
Sourcepub fn single_file(rungs: Vec<Rung>) -> Self
pub fn single_file(rungs: Vec<Rung>) -> Self
One self-contained MP4 per rung (AV1 + Opus/passthrough audio).
Sourcepub fn hls(rungs: Vec<Rung>, segment_seconds: f32) -> Self
pub fn hls(rungs: Vec<Rung>, segment_seconds: f32) -> Self
A segmented CMAF + HLS package with the given rungs and segment length.
Sourcepub fn with_audio(self, audio: AudioPolicy) -> Self
pub fn with_audio(self, audio: AudioPolicy) -> Self
Set the audio policy.
Sourcepub fn with_max_frame_rate(self, fps: f64) -> Self
pub fn with_max_frame_rate(self, fps: f64) -> Self
Cap output frame rate.
Sourcepub fn with_gpu_index(self, idx: u32) -> Self
pub fn with_gpu_index(self, idx: u32) -> Self
Pin to a GPU index. Implies EncodePolicy::SingleGpu(Some(idx)).
Sourcepub fn encode_policy(self, policy: EncodePolicy) -> Self
pub fn encode_policy(self, policy: EncodePolicy) -> Self
Select the GPU encode policy: a single (optionally pinned) GPU, or all GPUs (the multi-GPU engine).
// chunk-encode across every GPU and stitch:
let _ = OutputSpec::single_file(rungs.clone()).encode_policy(EncodePolicy::AllGpus);
// serial encode, pinned to GPU 1:
let _ = OutputSpec::single_file(rungs).encode_policy(EncodePolicy::SingleGpu(Some(1)));Sourcepub fn decode_gpu(self, idx: Option<u32>) -> Self
pub fn decode_gpu(self, idx: Option<u32>) -> Self
Pin the decode pump to a specific GPU index, independent of the encode
policy. None (the default) follows encode_policy. Useful to decode on
an integrated GPU while discrete GPUs encode, or to keep decode on one
device while encode chunks across several.
Sourcepub fn with_color(self, color: ColorPolicy) -> Self
pub fn with_color(self, color: ColorPolicy) -> Self
Set the output color / tonemap policy (SDR tonemap vs HDR passthrough).
Sourcepub fn with_bit_depth(self, depth: BitDepth) -> Self
pub fn with_bit_depth(self, depth: BitDepth) -> Self
Set the output bit depth (Auto / EightBit / TenBit). Sets bits
per sample only — the gamut/SDR-HDR choice is Self::with_color. For
HDR you usually don’t need this (the HDR ColorPolicy implies 10-bit).
Sourcepub fn web_sdr(self) -> Self
pub fn web_sdr(self) -> Self
Web-safe SDR (the default): BT.709 8-bit, tonemapping any HDR source
down. Plays everywhere. Same as .with_color(TonemapToSdr) .with_bit_depth(EightBit).
Sourcepub fn hdr10(self) -> Self
pub fn hdr10(self) -> Self
HDR10: BT.2020 wide gamut + PQ transfer, 10-bit, no tonemap. Needs a
10-bit HDR encoder (nvidia / amd / qsv / ffmpeg). Same as
.with_color(Hdr10) — the policy already implies 10-bit.
Sourcepub fn hlg(self) -> Self
pub fn hlg(self) -> Self
HLG: BT.2020 wide gamut + HLG transfer, 10-bit, no tonemap. Same as
.with_color(Hlg).
Sourcepub fn passthrough(self) -> Self
pub fn passthrough(self) -> Self
Passthrough: keep the source’s gamut, transfer, and bit depth
verbatim. Same as .with_color(Passthrough).
Sourcepub fn chunk_seam_mode(self, mode: ChunkSeamMode) -> Self
pub fn chunk_seam_mode(self, mode: ChunkSeamMode) -> Self
Set how the multi-GPU single-file path handles chunk seams
(Parallel fastest / ParallelConstQp seam-flat / Serial seam-free).
Sourcepub fn with_filters(self, filters: Vec<VideoFilter>) -> Self
pub fn with_filters(self, filters: Vec<VideoFilter>) -> Self
Set the per-frame video filter chain (crop / pad / flip / rotate /
grayscale), applied before per-rung scaling. See codec::filter.
Sourcepub fn tonemaps(&self) -> bool
pub fn tonemaps(&self) -> bool
Whether the decode pump tonemaps HDR→SDR for this spec (policy-driven — the pump never decides on its own).
Sourcepub fn resolve_output(
&self,
source_color: ColorMetadata,
source_pixel_format: PixelFormat,
) -> (ColorMetadata, PixelFormat)
pub fn resolve_output( &self, source_color: ColorMetadata, source_pixel_format: PixelFormat, ) -> (ColorMetadata, PixelFormat)
Resolve the encoder’s input (color_metadata, pixel_format) for a given
source. The default (TonemapToSdr + Auto) reproduces the legacy
source-driven fold: HDR sources collapse to 8-bit SDR; SDR sources keep
their own bit depth and color. Hdr10/Hlg force BT.2020 10-bit;
Passthrough keeps the source; pixel_format overrides the bit depth.
Trait Implementations§
Source§impl Clone for OutputSpec
impl Clone for OutputSpec
Source§fn clone(&self) -> OutputSpec
fn clone(&self) -> OutputSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more