This specification document is tailored for an AI Agent (like Roo Code, Claude, or a custom team of coding agents) to ingest and build out the system.
It uses Tauri (v2) for the cross-platform shell because it handles multi-threading beautifully, maintains a minimal memory footprint, and allows us to ship native sidecar binaries (yt-dlp, ffmpeg, whisper.cpp) directly for Windows, macOS, and Linux without forcing the end user to install them manually.
Target Execution Environment: Cross-Platform Desktop (Windows x64, macOS Apple Silicon/Intel, Linux x64)
Development Philosophy: Local-first, native performance, agentic-friendly modular design.
To ensure painless cross-platform compilation and zero external system prerequisites, the application architecture relies on a Tauri (Rust) Core wrapping a React/TypeScript UI, communicating natively with bundled sidecar utilities.
The build process must compile or bundle the platform-specific binaries into the src-tauri/binaries/ directory matching Tauri's naming convention ([binary]-[target-triple]).
yt-dlp: Handles link extraction and multi-resolution fetching.ffmpeg/ffprobe: Handles rapid audio demuxing and frame-perfect video re-encoding.whisper-cli(whisper.cpp): Handles CPU-bound local transcription via GGML models. Compiled with cross-platform baseline CPU extensions (AVX2 for x86, Neon for ARM).
[User Paste URL]
│
├──► Task 1: Spawns `yt-dlp` -> Fetches 720p Preview MP4
│ │
│ └──► Spawns `ffmpeg` -> Extracts 16kHz Mono WAV
│ │
│ └──► Spawns `whisper-cli` -> Generates `transcript.vtt`
│
└──► Task 2 (Parallel): Spawns `yt-dlp` -> Fetches Target Master Res MP4 (Cached in background)
When the user triggers a clip export, the frontend passes millisecond time boundaries to the Rust backend. The backend executes an explicit re-encoding pass against the high-resolution master asset:
ffmpeg -ss [In_Timestamp_ms] -to [Out_Timestamp_ms] -i [path_to_master_video] -c:v libx264 -preset ultrafast -crf 18 -c:a aac -b:a 192k [output_destination.mp4]
interface AppState {
currentVideo: {
id: string;
previewPath: string;
masterPath: string;
resolution: '720p' | '1080p' | '4k';
status: 'idle' | 'downloading' | 'transcribing' | 'ready' | 'error';
progress: number; // Combined extraction percentage
};
search: {
query: string;
results: SearchResultInstance[];
selectedInstanceIdx: number | null;
};
timeline: {
currentTime: number; // in milliseconds
inMarker: number; // in milliseconds
outMarker: number; // in milliseconds
zoomWindow: {
min: number; // Expandable lower bound view boundary
max: number; // Expandable upper bound view boundary
};
};
}
interface SearchResultInstance {
startTime: number; // Milliseconds from start
endTime: number; // Milliseconds from start
text: string; // Matching phrase slice
}┌────────────────────────────────────────────────────────┐
│ [ Video Player ] │
└────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────┐
│ Search Transcript: [ solar flare ] (3 hits)│
│ ► 02:14 "...caused a major solar flare that disrupted"│
│ ► 14:05 "...monitoring the solar flare activity..." │
└────────────────────────────────────────────────────────┘
◀── [Extensible Lower Bound] [Extensible Upper Bound] ──▶
┌────────────────────────────────────────────────────────┐
│ Timeline Zoom (Anchor: 02:14) │
│ ───[======█===========================█===========]─── │
│ In-Marker Out-Marker │
└────────────────────────────────────────────────────────┘
For the AI Agent: Execute these blocks sequentially. Validate file outputs at each stage.
- Initialize a Tauri v2 project with a React + TS frontend (
pnpm). - Create a clean directory layout for system assets:
src-tauri/binaries/andsrc-tauri/models/. - Configure the Tauri permissions manifest (
capabilities/main.json) to allow child-process execution for the sidecars and write access to the user's temporary/cache directories.
- Implement the Rust backend module
src-tauri/src/downloader.rsutilizingtauri::process::Commandto invokeyt-dlp. - Implement parsing logic to grab the
-fflag programmatically based on user resolution configurations. - Implement the
src-tauri/src/transcriber.rsmodule. It must verify the existence of theggml-tiny.binorggml-base.binmodel in the app cache folder. If missing, fetch it from Hugging Face's mirror via native HTTP request and provide a progress bar hook. - Write the execution hook to point
whisper-clito a 16kHz audio stream extracted viaffmpeg.
- Build a Web Worker utility in the frontend that takes the
.vtt/.srtoutputs from the whisper background run and maps them into a structural token object array. - Integrate a text lookup client (
Fuse.jsor standard substring array matching) capable of extracting matching context strings with their respective microsecond timestamps.
- Create the primary application window splitting Search Results on the left and Media controls on the right.
- Write the timeline engine. When an instance is clicked, update
zoomWindow.min = Math.max(0, matchStart - 5000)andzoomWindow.max = Math.min(duration, matchEnd + 5000). - Bind the In/Out scrub handles to track positions inside the absolute master timeline using a clean millisecond tracker to prevent frame-rate shifting bugs entirely.
- Expose a backend Tauri command
export_slice(master_path, out_path, start_ms, end_ms). - Build the process watcher that monitors
ffmpegprogress indicators out ofstderrand maps it back to an export loading state on the screen.
- Platform Abstraction: Always ensure path constructions use
std::path::PathBufin Rust to maintain native code compliance across\(Windows) and/(Unix) environments. - No Frame-Locking: Under no circumstances should the cut ranges map directly to frame indexes. The UI must strictly pipe string timestamps to
ffmpegformatted exactly asHH:MM:SS.mmm.