Flashback exposes its capture subsystem to the SvelteKit frontend through a set of Tauri commands registered inDocumentation 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-tauri/src/lib.rs. All capture work runs on dedicated background threads using Windows Graphics Capture (WGC) and Media Foundation — the frontend simply calls invoke() to start, stop, and query these pipelines. This page documents every capture-related command, the shapes of the data they return, and shows working TypeScript examples for the most common patterns.
All capture and replay commands are Windows-only. On non-Windows platforms the commands resolve immediately:
list_monitors and list_audio_inputs return empty arrays, start_capture and start_replay return an error string, and stop_capture / save_replay return null.Monitors & Audio
list_monitors
Returns metadata for every display currently attached to the system, including a base64-encoded thumbnail of its current content. Use this list to populate the capture-target picker.
Returns MonitorInfo[]
list_audio_inputs
Returns all audio capture (microphone) devices registered with Windows. Device enumeration is performed via WinRT DeviceInformation and does not require the microphone privacy permission.
Returns AudioInput[]
Recording
start_capture
Starts a manual recording session. Flashback opens a WGC capture session on the requested target, builds a Media Foundation IMFSinkWriter pipeline with an H.264 hardware encoder (NVENC / AMF / Quick Sync, with software fallback), and begins writing an MP4 file to the configured clips directory. The command returns as soon as the pipeline is confirmed ready; if the encoder or WGC session fails to open the promise rejects with an error string.
Only one recording or replay session can be active at a time. Calling
start_capture while already recording is a no-op (returns Ok(())). Stop the current session with stop_capture before starting a new one.The capture target. Pass a
MonitorInfo.id value from list_monitors to capture a specific display, or "window" to capture the active game window detected by the overlay (used internally; prefer monitor IDs from user-facing UI).Target frame rate. Clamped internally to a safe range (e.g. 1–240). Typical values:
30, 60.Bitrate quality preset. Accepted values:
"low", "medium", "high", "ultra". Controls a bitrate multiplier applied on top of the bitrate parameter.Output vertical resolution in pixels (e.g.
720, 1080, 1440). The capture always happens at native resolution; the encoder downscales to this target using the GPU video processor.Base target video bitrate in bits per second (e.g.
50_000_000 for 50 Mbps). The quality multiplier is applied on top of this value.Whether to capture a microphone track alongside the system audio loopback.
The
AudioInput.id of the microphone to capture. Pass an empty string when mic is false.Result<void, string> — resolves when the pipeline is ready; rejects with a human-readable error message on failure.
stop_capture
Signals the capture pipeline to stop, flushes and finalises the MP4 muxer, and returns the path of the saved file. Call this to end a recording started with start_capture.
Returns string | null — the absolute Windows path of the saved MP4, or null if no recording was active or if the muxer could not be finalised.
capture_status
Returns a snapshot of the currently active recording pipeline. Poll this (e.g. every second) to update a live recording indicator.
Returns CaptureStatus
Instant Replay
start_replay
Starts a continuous background encoding loop that keeps the last seconds seconds of gameplay in an in-memory ring buffer. Frames are encoded to H.264 in real time so that saving a replay requires only a fast mux — no re-encoding. The function returns once the WGC session and encoder pipeline are confirmed ready.
In window mode (
target: "window") the replay arms itself even if the game is not yet running or is minimised. It will reconnect automatically when the game window becomes capturable. In monitor mode a startup error is fatal.Capture target — a
MonitorInfo.id or "window" for game-window mode.Size of the replay ring buffer in seconds (e.g.
30, 60, 120).Encoding frame rate for the replay buffer.
Bitrate quality preset (
"low", "medium", "high", "ultra").Output vertical resolution in pixels.
Base target video bitrate in bits per second.
Whether to include a microphone track in the replay.
AudioInput.id of the microphone, or an empty string if mic is false.Result<void, string>
stop_replay
Tears down the replay pipeline and discards the ring buffer. Any unsaved replay data is lost.
Returns void
save_replay
Muxes the current ring buffer contents into an MP4 file, starting from the most recent keyframe at the beginning of the buffer window. This operation is fast (no re-encoding) and runs on a dedicated MTA thread so it does not block the UI.
The game or capture source name (e.g. the value from
detect_game().name). This string is embedded into the MP4 as metadata so the clip appears under the correct game label in the library. Pass an empty string to omit the metadata.string | null — absolute path of the saved MP4, or null on failure.
replay_active
Returns whether the instant-replay pipeline is currently running.
Returns boolean
Game Detection
detect_game
Checks whether a known game is currently the foreground application. Detection uses a combination of window title matching and Steam AppID resolution.
Returns DetectedGame | null
get_seen_games
Returns the list of all games that Flashback has detected at least once, sorted by most-recently-seen. Useful for building game-history pickers.
Returns SeenGame[]
get_disabled_games
Returns the list of game names for which automatic game detection has been disabled by the user.
Returns string[]
set_disabled_games
Persists a new list of game names for which automatic detection should be suppressed. Replace the entire list on each call.
Array of canonical game names to disable. Pass an empty array to re-enable detection for all games.
Result<void, string>
Artwork
Flashback fetches game artwork from Steam’s CDN and caches it locally. Both commands return a base64-encoded data URL that can be set directly as an<img src>.
game_hero
Returns the hero / banner image for a game (the wide banner used on Steam store pages and in the Flashback library header).
Canonical game name.
Steam AppID, or
null for non-Steam games.string | null — base64 data URL of the image, or null if unavailable.
game_icon
Returns the small square icon for a game (used in clip cards and list rows).
Canonical game name.
Steam AppID, or
null for non-Steam games.string | null — base64 data URL of the icon, or null if unavailable.
Encoder
get_encoder
Returns the user’s current hardware encoder preference.
Returns string — one of "Auto", "NVENC", "AMF", "Quick Sync", or "Software".
set_encoder
Persists the hardware encoder preference. Takes effect on the next start_capture or start_replay call.
Encoder preference. Must be one of
"Auto", "NVENC", "AMF", "Quick Sync", or "Software".Result<void, string>
Notifications
toast
Displays a brief notification in the Flashback overlay window (the always-on-top, click-through transparent window used during gameplay). The overlay window repositions itself to the top-right corner of the primary monitor on each call. The overlay is non-activatable so it never steals focus from a game.
The notification message to display (e.g.
"Replay saved").Visual style hint. Typical values:
"success", "error", "info".Result<void, string>
dismiss_toast
Hides the overlay notification window immediately, without waiting for the auto-dismiss timer in the overlay’s web content.
Returns void
Related pages
Capture Pipeline
Deep-dive into WGC frame delivery, CFR pacing, and the Media Foundation encoder chain.
Audio Pipeline
How system loopback and microphone tracks are captured, encoded, and muxed.
Manual Recording
User-facing guide to starting and stopping recordings.
Instant Replay
User-facing guide to the instant-replay feature.
Encoder Configuration
How to choose and configure the hardware encoder.
Editor Commands
Commands for editing captured clips.