Public declaration syntax from forge-rs/crates/forge-media/src/video.rs Original source SHA-256: f35c9ead40a7fb460adbdf996b23d715321718cdb6a625fb57a1b5d1b629073e Function bodies and constant values are omitted. This is not the complete implementation. Source line 52 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum VideoFormat { /// MP4 — widely supported video container format (typically H.264/AAC). #[default] Mp4, /// WebM — open video format (typically VP8/VP9/Opus). Webm, } Source line 75 pub fn mime_type(&self) -> &'static str; Source line 92 pub fn extension(&self) -> &'static str; Source line 127 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct VideoOptions { /// Desired width in pixels. pub width: u32, /// Desired height in pixels. pub height: u32, /// Desired video duration in seconds. pub duration_seconds: f64, /// Output video format. pub format: VideoFormat } Source line 170 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct VideoResult { /// The raw video bytes in the format specified by `mime_type`. pub data: Vec, /// The MIME type of the video data (e.g., "video/mp4"). pub mime_type: String, /// The duration of the generated video in seconds. pub duration_seconds: f64, /// The width of the generated video in pixels. pub width: u32, /// The height of the generated video in pixels. pub height: u32 } Source line 225 #[async_trait] pub trait VideoProvider: Send + Sync { /// Returns the model identifier (e.g., "sora-1", "runway-gen2"). fn model_id(&self) -> &str; /// Returns the provider name (e.g., "openai", "runway"). fn provider_name(&self) -> &str; /// Generates a video from a text prompt. /// /// # Arguments /// /// * `prompt` - The text description of the video to generate. /// * `options` - Configuration for output dimensions, duration, and format. /// /// # Returns /// /// A [`VideoResult`] containing the generated video bytes and metadata. /// /// # Errors /// /// * [`ForgeMediaError::VideoFailed`] -- if the provider returns an error. /// * [`ForgeMediaError::UnsupportedFormat`] -- if the requested format is not supported. async fn generate_video( &self, prompt: &str, options: &VideoOptions, ) -> Result; } Source line 294 pub async fn generate_video( provider: &dyn VideoProvider, prompt: &str, options: &VideoOptions, ) -> Result;