pub struct RenderConfig {
pub width: u32,
pub height: u32,
pub fps: u32,
pub output_path: String,
pub audio_tracks: Vec<AudioTrack>,
pub video_codec: Option<String>,
pub audio_codec: Option<String>,
pub preset: Option<String>,
pub crf: Option<u32>,
pub pix_fmt: Option<String>,
pub subtitle_style: Option<String>,
pub extra_output_args: Vec<String>,
}Expand description
Configuration for video rendering.
Fields§
§width: u32Output width in pixels. Default: 1920.
height: u32Output height in pixels. Default: 1080.
fps: u32Frames per second. Default: 30.
output_path: StringOutput file path. Default: "output.mp4".
audio_tracks: Vec<AudioTrack>Background audio tracks to mix with the narration.
video_codec: Option<String>Video codec (-c:v). Default: "libx264".
audio_codec: Option<String>Audio codec (-c:a). Default: "aac".
preset: Option<String>Encoder preset (-preset). Default: "fast".
crf: Option<u32>Constant Rate Factor (-crf) for quality control. Lower = better quality.
When None, ffmpeg uses its own default (typically 23 for libx264).
pix_fmt: Option<String>Pixel format (-pix_fmt), e.g. "yuv420p" for broad player compatibility.
subtitle_style: Option<String>ASS/SSA subtitle force_style string. Default: "FontSize=24,PrimaryColour=&HFFFFFF&".
extra_output_args: Vec<String>Extra ffmpeg arguments inserted before the output path. Use this as a catch-all for flags not covered above.
Implementations§
Source§impl RenderConfig
impl RenderConfig
Sourcepub fn video_codec(self, codec: impl Into<String>) -> Self
pub fn video_codec(self, codec: impl Into<String>) -> Self
Set the video codec (-c:v), e.g. "libx265", "h264_nvenc".
Sourcepub fn audio_codec(self, codec: impl Into<String>) -> Self
pub fn audio_codec(self, codec: impl Into<String>) -> Self
Set the audio codec (-c:a), e.g. "libopus", "libmp3lame".
Sourcepub fn preset(self, preset: impl Into<String>) -> Self
pub fn preset(self, preset: impl Into<String>) -> Self
Set the encoder preset (-preset), e.g. "ultrafast", "slow".
Sourcepub fn pix_fmt(self, fmt: impl Into<String>) -> Self
pub fn pix_fmt(self, fmt: impl Into<String>) -> Self
Set the pixel format (-pix_fmt), e.g. "yuv420p".
Sourcepub fn subtitle_style(self, style: impl Into<String>) -> Self
pub fn subtitle_style(self, style: impl Into<String>) -> Self
Set a custom subtitle style (ASS force_style string).
Sourcepub fn extra_output_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn extra_output_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add extra ffmpeg arguments before the output path.
Trait Implementations§
Source§impl Clone for RenderConfig
impl Clone for RenderConfig
Source§fn clone(&self) -> RenderConfig
fn clone(&self) -> RenderConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more