feat(captions): extend data model with font, shadow, dimmed color, bg toggle fields

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 10:29:22 -04:00
parent e6e3fcb5b4
commit cc0ca95846
4 changed files with 256 additions and 11 deletions

View File

@@ -9,6 +9,10 @@ pub struct VideoMetadata {
pub fps: f64,
pub thumbnail_url: Option<String>,
pub stream_url: String,
/// Whether English captions are available (manual or auto-generated)
pub has_captions: bool,
/// True if the available captions are auto-generated (lower quality)
pub captions_are_auto: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -84,6 +88,28 @@ pub enum ExportScope {
Merged,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CaptionStyle {
pub font_family: String,
pub font_size: u32,
pub text_color: String,
pub bold: bool,
pub outline_color: String,
pub background_enabled: bool,
pub background_opacity: f64,
pub background_color: String,
pub text_outline: bool,
pub shadow_enabled: bool,
pub shadow_depth: u32,
pub shadow_color: String,
pub dimmed_color_mode: String,
pub dimmed_opacity: f64,
pub dimmed_color: String,
pub position: String,
pub word_highlight: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExportConfig {
@@ -93,6 +119,25 @@ pub struct ExportConfig {
pub output_directory: String,
pub video_title: String,
pub source_file_path: String,
/// Whether to include captions in the export
pub include_captions: bool,
/// Whether to burn subtitles into the video (requires re-encoding)
pub burn_in_captions: bool,
/// Path to the VTT caption file (if available)
pub caption_file_path: Option<String>,
/// Style settings for burned-in captions
pub caption_style: Option<CaptionStyle>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct WaveformTiers {
/// ~2,000 peaks — overview for full-duration view
pub tier0: Vec<f64>,
/// ~10,000 peaks — moderate zoom
pub tier1: Vec<f64>,
/// All extracted peaks — deep zoom
pub tier2: Vec<f64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]