#[non_exhaustive]pub struct EncoderConfig {
pub video_codec: VideoCodec,
pub audio_codec: AudioCodec,
pub bitrate_mode: BitrateMode,
pub resolution: Option<(u32, u32)>,
pub framerate: Option<f64>,
pub hardware: Option<HwAccel>,
}Expand description
Codec and quality configuration for the pipeline output.
Passed to PipelineBuilder::output alongside the output path.
Construct via EncoderConfig::builder.
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.video_codec: VideoCodecVideo codec to use for the output stream.
audio_codec: AudioCodecAudio codec to use for the output stream.
bitrate_mode: BitrateModeBitrate control mode (CBR, VBR, or CRF).
resolution: Option<(u32, u32)>Output resolution as (width, height) in pixels.
Resolution precedence in Pipeline::run:
- This field when
Some— explicit value always wins. - The output dimensions of a
scalefilter, inferred automatically. - The source video’s native resolution.
When a scale filter is used via PipelineBuilder::filter you
typically do not need to set this field; the pipeline infers the
encoder dimensions from the filter. Set it explicitly only to override
the filter’s output size or to resize without a filter.
framerate: Option<f64>Output frame rate in frames per second.
None preserves the source frame rate.
hardware: Option<HwAccel>Hardware acceleration device to use during encoding.
None uses software (CPU) encoding.
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Sourcepub fn builder() -> EncoderConfigBuilder
pub fn builder() -> EncoderConfigBuilder
Returns an EncoderConfigBuilder with sensible defaults:
H.264 video, AAC audio, CRF 23, no resolution/framerate override, software encoding.