pub struct EncoderConfig {
pub codec: CodecId,
pub width: u32,
pub height: u32,
pub pixel_format: PixelFormat,
pub framerate: Rational,
pub bitrate: BitrateMode,
pub preset: EncoderPreset,
pub profile: Option<String>,
pub keyint: u32,
pub threads: usize,
pub timebase: Rational,
}Expand description
Encoder configuration.
Fields§
§codec: CodecIdTarget codec.
width: u32Frame width.
height: u32Frame height.
pixel_format: PixelFormatInput pixel format.
framerate: RationalFrame rate.
bitrate: BitrateModeBitrate mode.
preset: EncoderPresetEncoder preset.
profile: Option<String>Profile (codec-specific).
keyint: u32Keyframe interval.
threads: usizeNumber of encoder threads (0 = auto).
timebase: RationalTimebase for output packets.
Implementations§
Source§impl EncoderConfig
impl EncoderConfig
Sourcepub fn with_bitrate(self, bitrate: u64) -> Self
pub fn with_bitrate(self, bitrate: u64) -> Self
Set target bitrate.
Sourcepub fn with_preset(self, preset: EncoderPreset) -> Self
pub fn with_preset(self, preset: EncoderPreset) -> Self
Set encoder preset.
Trait Implementations§
Source§impl Clone for EncoderConfig
impl Clone for EncoderConfig
Source§fn clone(&self) -> EncoderConfig
fn clone(&self) -> EncoderConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncoderConfig
impl Debug for EncoderConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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