# Video Clipper — Brainstorming & Implementation Plan **Date:** 2026-09-21 10:22 **Task:** Brainstormed the design and wrote a comprehensive implementation plan for a macOS GUI video clipper app. ## Task Description Designed and planned a macOS GUI app ("Video Clipper") that lets users paste a YouTube URL, scrub a timeline, mark clip boundaries, and export clips — without manually downloading the video first. Like LosslessCut, but for online videos. ## Changes Made ### Design Spec (`docs/superpowers/specs/2026-09-21-video-clipper-design.md`) - Brainstormed tech approach: chose **Tauri v2 + Svelte 5** over Swift/SwiftUI and Python/Qt - Defined architecture: Rust backend (subprocess orchestration), Svelte frontend (Canvas timeline), external CLI tools (ffmpeg, yt-dlp) - Designed hybrid playback: stream immediately for preview, download in background for export - Designed 4-layer Canvas timeline: thumbnails → waveform → clip markers → controls - Researched YouTube 2026 auth landscape: cookies + PO Token + JS runtime required - Added three features to MVP during review: waveform visualization, thumbnail strip, cookie/auth support - Defined complete data model, keyboard shortcuts (NLE-style), export flow, edge cases ### Implementation Plan (`docs/superpowers/plans/2026-09-21-video-clipper.md`) 12 tasks with TDD approach, exact file paths, complete code, and test code: 1. **Project Scaffolding** — Tauri v2 + Svelte 5 scaffold, plugins, layout shell, utility functions 2. **Dependency Manager + Setup Wizard** — Check ffmpeg/yt-dlp/deno/PO-token-plugin, guided install 3. **Preferences Store** — Cookie source (Firefox default), output directory, persistence 4. **Video Resolver + URL Input + Video Player** — yt-dlp metadata/stream URL, paste-to-play pipeline 5. **Download Manager + Status Bar** — Background yt-dlp download with progress channel 6. **Timeline Core** — Canvas renderer, coordinate mapping, playhead, scrub, zoom 7. **Clip Management** — I/O marking, clip CRUD store, timeline markers, draggable handles, ClipList 8. **Transport Controls + Keyboard Shortcuts** — All playback controls, J/K/L shuttle, all hotkeys 9. **Keyframe Index** — ffprobe extraction, keyframe/frame navigation 10. **Waveform** — ffmpeg audio peak extraction, Canvas rendering with zoom aggregation 11. **Thumbnails** — ffmpeg frame extraction, sprite sheets, adaptive-density Canvas rendering 12. **Clip Export + Export Dialog** — Lossless/precise/merged ffmpeg pipeline, full export UI ## Key Decisions - **Tauri v2 + Svelte 5** chosen over Swift/SwiftUI for natural Canvas/timeline UI building - **Firefox cookies default** — only browser where `--cookies-from-browser` reliably works in 2026 - **bgutil-ytdlp-pot-provider** plugin required for YouTube PO Token generation - **Tauri Channels** (not events) for streaming progress data — strongly typed, optimized for throughput - **Static placeholder** for waveform/thumbnails before download completes (not progressive) - **Sprite sheet** approach for thumbnails to minimize image load overhead ## Lessons Learned - YouTube in 2026 requires a 3-part auth chain: cookies + PO Token provider plugin + JS runtime. Just `--cookies-from-browser` alone is insufficient. - Chrome 127+ broke cookie decryption for external tools — Firefox is the only reliable browser for `--cookies-from-browser`. - Tauri v2 Channels (`tauri::ipc::Channel`) are the recommended way to stream data from Rust→frontend, not the event system (which is JSON-only and not designed for throughput). - `yt-dlp -v` with a URL shows `[debug] Extractor Plugins: GetPOT` to verify the PO token plugin is installed — there's no dedicated `--list-plugins` flag. ## Follow-up Items - Stream URL re-resolution on playback error (noted in plan self-review but not a dedicated task) - Future features documented in spec: local file support, quality selection, save/load projects, batch processing, cross-platform