#[non_exhaustive]pub struct Config {
pub codec: Codec,
pub width: u32,
pub height: u32,
pub framerate: u32,
pub bitrate: u32,
pub gop: NonZeroU32,
pub qp: RangeInclusive<u8>,
pub device: Option<PathBuf>,
pub color: Color,
}Expand description
Encoder configuration. Dimensions must be even (4:2:0 chroma).
Build one with Config::new and set the public fields after it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.codec: CodecThe format to encode, H.264 unless set. Main profile either way.
width: u32§height: u32§framerate: u32§bitrate: u32The bitrate in bits per second the stream is held to. A calm scene
spends less; see RateControl. A picture qp’s ceiling
cannot code within it spends past it.
gop: NonZeroU32Keyframe interval in frames.
qp: RangeInclusive<u8>The quantizers the rate controller may pick between, from the finest to
the coarsest, DEFAULT_MIN_QP to MAX_QP unless set. A picture the
bitrate cannot code at the ceiling spends past the bitrate instead.
Encoder::new refuses a range past MAX_QP, an empty one, and a
ceiling of 0, which libva reads as no ceiling at all.
device: Option<PathBuf>DRM render node to open (e.g. /dev/dri/renderD128).
None, the default, opens the first node whose driver can encode
codec at this frame size, and Encoder::config then
names the node it picked.
color: ColorColor space written into the SPS, and the target of a conversion from RGB.
Defaults to Color::infer for the height, which is what a decoder
assumes for an unlabelled stream.