pub struct EncodeConfig {
pub frames_dir: PathBuf,
pub output: PathBuf,
pub fps: f64,
pub crf: u32,
pub preset: String,
pub codec: String,
pub pixel_format: String,
pub width: Option<u32>,
pub height: Option<u32>,
pub movflags: String,
pub cleanup_after_encode: bool,
}Expand description
Configuration for the encoding step.
Fields§
§frames_dir: PathBufDirectory containing frame_%06d.png files.
output: PathBufOutput video file path.
fps: f64Frames per second.
crf: u32CRF quality (lower = better; 0–51 for H.264).
preset: StringFFmpeg preset (e.g., "fast", "medium", "ultrafast").
codec: StringVideo codec string for FFmpeg (e.g., "libx264").
pixel_format: StringPixel format string for FFmpeg (e.g., "yuv420p").
width: Option<u32>Video width in pixels (optional).
height: Option<u32>Video height in pixels (optional).
movflags: StringMP4 container flags for web optimization (e.g., "+faststart").
cleanup_after_encode: boolAutomatically remove temporary frame directory after encoding succeeds.
Implementations§
Source§impl EncodeConfig
impl EncodeConfig
Sourcepub fn h264(
frames_dir: impl Into<PathBuf>,
output: impl Into<PathBuf>,
fps: f64,
) -> Self
pub fn h264( frames_dir: impl Into<PathBuf>, output: impl Into<PathBuf>, fps: f64, ) -> Self
Create an H.264 config with sensible defaults.
Sourcepub fn with_resolution(self, width: u32, height: u32) -> Self
pub fn with_resolution(self, width: u32, height: u32) -> Self
Set video resolution width and height.
Sourcepub fn with_preset(self, preset: impl Into<String>) -> Self
pub fn with_preset(self, preset: impl Into<String>) -> Self
Set encoding preset.
Sourcepub fn with_cleanup(self, cleanup: bool) -> Self
pub fn with_cleanup(self, cleanup: bool) -> Self
Enable or disable cleanup of frame directory after encoding.
Trait Implementations§
Source§impl Clone for EncodeConfig
impl Clone for EncodeConfig
Source§fn clone(&self) -> EncodeConfig
fn clone(&self) -> EncodeConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncodeConfig
impl RefUnwindSafe for EncodeConfig
impl Send for EncodeConfig
impl Sync for EncodeConfig
impl Unpin for EncodeConfig
impl UnsafeUnpin for EncodeConfig
impl UnwindSafe for EncodeConfig
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