#[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.
Auto Trait Implementations§
impl Freeze for EncoderConfig
impl RefUnwindSafe for EncoderConfig
impl Send for EncoderConfig
impl Sync for EncoderConfig
impl Unpin for EncoderConfig
impl UnsafeUnpin for EncoderConfig
impl UnwindSafe for EncoderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more