3.9 KiB
3.9 KiB
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:
- Project Scaffolding — Tauri v2 + Svelte 5 scaffold, plugins, layout shell, utility functions
- Dependency Manager + Setup Wizard — Check ffmpeg/yt-dlp/deno/PO-token-plugin, guided install
- Preferences Store — Cookie source (Firefox default), output directory, persistence
- Video Resolver + URL Input + Video Player — yt-dlp metadata/stream URL, paste-to-play pipeline
- Download Manager + Status Bar — Background yt-dlp download with progress channel
- Timeline Core — Canvas renderer, coordinate mapping, playhead, scrub, zoom
- Clip Management — I/O marking, clip CRUD store, timeline markers, draggable handles, ClipList
- Transport Controls + Keyboard Shortcuts — All playback controls, J/K/L shuttle, all hotkeys
- Keyframe Index — ffprobe extraction, keyframe/frame navigation
- Waveform — ffmpeg audio peak extraction, Canvas rendering with zoom aggregation
- Thumbnails — ffmpeg frame extraction, sprite sheets, adaptive-density Canvas rendering
- 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-browserreliably 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-browseralone 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 -vwith a URL shows[debug] Extractor Plugins: GetPOTto verify the PO token plugin is installed — there's no dedicated--list-pluginsflag.
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