Flashback’s non-destructive clip editor is backed by a set of Tauri commands that handle the heavy lifting on the Rust side — demuxing, waveform extraction, frame-level seeking, re-encoding, and progress reporting — while the SvelteKit frontend (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CaramelHQ/Flashback/llms.txt
Use this file to discover all available pages before exploring further.
src/lib/editor.svelte.ts) drives the interaction model. Every original clip is left untouched; exported clips are written to a separate Clips-Edit directory. This page documents all editor commands, the shared type definitions they use, and working TypeScript examples drawn from the real frontend code.
All editor commands that call into Media Foundation are Windows-only. On other platforms they return an error string.
load_clip_edit / save_clip_edit and edit_dest are platform-independent.Shared Types
The following types are used across multiple editor commands. They are defined insrc-tauri/src/editor.rs and serialised as JSON.
ClipEdit
The complete state of a non-destructive edit. Persisted to an edits.json index in the app-data directory (never as a sidecar next to the clip) so it survives file renames.
Segment
A single kept range of source video.
MixerState
Per-track volume and mute settings applied during export. Defaults to sys_vol: 1.0, sys_muted: false, mic_vol: 1.0, mic_muted: false.
Audio Preparation
prepare_clip_audio
Extracts audio tracks from an MP4 clip and writes them as WAV files to the app-data audio/ directory. Also computes reduced-resolution peak arrays for waveform display in the editor timeline. Extraction is cached: if WAV files already exist for the clip they are reused, making subsequent opens instantaneous.
Clips recorded with a microphone contain two AAC audio streams (system loopback on stream 1, microphone on stream 0). Single-stream clips return null path fields and only populate mix_peaks.
Absolute path to the source MP4 clip.
Result<ClipAudio, string>
Edit Persistence
load_clip_edit
Loads the persisted ClipEdit for a clip from the app-data edit index. If no edit exists for this path a default is returned (empty segments, default mixer). Transparently migrates legacy per-clip .edit.json sidecar files to the central index on first access.
Absolute path to the source MP4 clip.
Result<ClipEdit, string>
save_clip_edit
Persists a ClipEdit for a clip to the central edit index. The original MP4 is never modified. Flashback calls this automatically after a short debounce whenever the user makes a change in the editor.
Absolute path to the source MP4 clip — used as the index key.
The complete current edit state to persist.
Result<void, string>
Frame & Timing Information
keyframe_times
Returns the presentation timestamp of every H.264 IDR (keyframe) in the clip, in milliseconds, in ascending order. Use this list to snap the trim handle to the nearest keyframe, which allows exact cuts without re-encoding in seek-based workflows.
Absolute path to the source MP4 clip.
Result<number[], string> — array of keyframe timestamps in milliseconds.
frame_times
Returns the presentation timestamp of every video frame in the clip, in milliseconds. Because Flashback uses WGC (which delivers frames only when screen content changes), clips are variable frame rate. This list lets the editor advance or rewind exactly one frame at a time regardless of the actual cadence.
Absolute path to the source MP4 clip.
Result<number[], string> — array of all frame timestamps in milliseconds, sorted ascending.
clip_fps
Returns the nominal frame rate of the clip as stored in its Media Foundation media type. This is the rate declared at capture time (e.g. 60), not the actual delivered rate (which is variable with WGC).
Absolute path to the source MP4 clip.
Result<number, string> — detected frame rate as an integer.
Thumbnails & Frames
clip_thumbnail
Returns the path to a cached JPEG thumbnail for the clip (generated from frame 0). The thumbnail is written to the app-data thumbs/ directory the first time it is requested; subsequent calls return instantly from cache.
Absolute path to the source MP4 clip.
Result<string, string> — absolute path to the cached JPEG file.
capture_frame
Extracts a single video frame at a specific timestamp and saves it as a PNG to the Screenshots directory (Videos\Flashback\Screenshots). The filename encodes the clip stem and timestamp (e.g. myclip_4200.png).
Absolute path to the source MP4 clip.
Timestamp of the frame to extract, in milliseconds.
Result<string, string> — absolute path of the saved PNG file.
Export
edit_dest
Computes the destination path for an exported clip without writing anything. Exported clips always go to the dedicated Clips-Edit subdirectory (Videos\Flashback\Clips-Edit) so they are kept separate from originals but still appear in the library. The output filename is <stem>_edit.mp4.
Absolute path to the source MP4 clip.
string — the absolute destination path.
export_clip
Re-encodes the clip according to the provided ClipEdit, writing the result to dst. Each enabled segment is decoded, re-timed, and written through a single H.264 hardware encoder pass (software fallback if no GPU encoder is available). Audio is either remixed (system + mic with mixer volumes) or passed through with gain applied.
This is an async command that runs on a blocking thread. While running it emits export-progress events on the Tauri event bus so the UI can show a progress bar.
Absolute path to the source MP4 clip.
Absolute path for the output file. Use
edit_dest to compute the canonical destination.The edit to apply. Disabled segments are automatically excluded.
Result<void, string> — resolves when the export is complete and the MP4 has been finalised.
export-progress event
While export_clip is running the backend emits progress updates via the Tauri event bus.
| Field | Type | Description |
|---|---|---|
payload | number | Export progress from 0.0 to 1.0. The final 1.0 event is emitted after Finalize() completes. |
Related pages
Clip Editor
User-facing guide to the non-destructive clip editor.
Audio Pipeline
How system loopback and mic tracks are structured in the MP4.
Capture Pipeline
How clips are produced by the capture engine.
Library Commands
Commands for listing and managing clips.
Capture Commands
Commands for starting and stopping recordings.
Architecture
High-level overview of the Flashback Tauri architecture.