From 8d669a1a8a7e69db879ccbd27be372e50e2926a2 Mon Sep 17 00:00:00 2001 From: cottongin Date: Mon, 21 Sep 2026 10:07:58 -0400 Subject: [PATCH] Update spec: add waveform, thumbnail strip, cookie/auth, dependency chain to MVP Co-authored-by: Cursor --- .../specs/2026-09-21-video-clipper-design.md | 144 ++++++++++++++++-- 1 file changed, 129 insertions(+), 15 deletions(-) diff --git a/docs/superpowers/specs/2026-09-21-video-clipper-design.md b/docs/superpowers/specs/2026-09-21-video-clipper-design.md index 7425cb4..423fa07 100644 --- a/docs/superpowers/specs/2026-09-21-video-clipper-design.md +++ b/docs/superpowers/specs/2026-09-21-video-clipper-design.md @@ -31,12 +31,14 @@ Manages all subprocess orchestration, file I/O, and state persistence. Communica | Component | Responsibility | |---|---| -| `DependencyManager` | Check for ffmpeg/yt-dlp on `$PATH`. If missing, offer to install via `brew install`. Shows a modal on startup if dependencies are absent. | +| `DependencyManager` | Check the full dependency chain on `$PATH`: ffmpeg/ffprobe, yt-dlp, a JavaScript runtime (Deno preferred, Node.js fallback), and the `bgutil-ytdlp-pot-provider` yt-dlp plugin. On first launch or when anything is missing, shows a step-by-step **Setup Wizard** that walks the user through installing each dependency one at a time. See the Dependency Chain section. | | `VideoResolver` | Takes a URL, calls `yt-dlp --dump-json ` for metadata and `yt-dlp -g ` for the direct stream URL. Returns a `VideoMetadata` struct. | | `DownloadManager` | Runs `yt-dlp -o ` in the background. Emits progress events to the frontend. Manages temp file lifecycle (cleanup on cancel/error). | | `KeyframeIndex` | After download completes, runs `ffprobe -select_streams v -show_entries frame=pts_time,flags -of csv ` to extract keyframe positions. Returns a sorted list of keyframe timestamps. | | `ClipExporter` | Runs ffmpeg for clip extraction. Supports two modes: lossless (stream copy, keyframe-aligned) and precise (re-encode, exact frames). Handles both individual and merged export. | -| `PreferencesStore` | Persists user preferences (output directory, window geometry) via `tauri-plugin-store`. | +| `WaveformGenerator` | After download completes, extracts audio peak data from the video file via ffmpeg. Computes ~8000 peak samples for the full video duration and sends them to the frontend for Canvas rendering. | +| `ThumbnailExtractor` | After download completes, extracts frames at computed intervals via ffmpeg (1/sec for <10 min, 1/2s for 10–60 min, 1/5s for >60 min). Outputs small JPEGs (160×90px) packed into sprite sheets for efficient rendering. | +| `PreferencesStore` | Persists user preferences (output directory, window geometry, cookie source) via `tauri-plugin-store`. | ### 2. Svelte Frontend @@ -48,18 +50,20 @@ Renders the video player, custom timeline, clip management panel, and export dia |---|---| | `UrlInput` | Text field for URL entry. Detects paste, shows loading spinner during resolution, displays errors. | | `VideoPlayer` | Wraps the HTML5 `