Architecture
Frame’s backend is built with Rust and Tauri, providing a high-performance media conversion engine. The backend communicates with the frontend through Tauri’s Inter-Process Communication (IPC) system, exposing commands that can be invoked from JavaScript/TypeScript.Available Tauri Commands
The following commands are registered in the Tauri application (lib.rs:156-167):Conversion Commands
- queue_conversion - Queue a media conversion task
- pause_conversion - Pause a running conversion
- resume_conversion - Resume a paused conversion
- cancel_conversion - Cancel a conversion task
- probe_media - Probe media file metadata
- get_max_concurrency - Get current maximum concurrent conversions
- set_max_concurrency - Update maximum concurrent conversions
System Commands
- get_available_encoders - Query available hardware encoders
- open_native_file_dialog - Open native file picker
- ask_native_dialog - Display native confirmation dialog
- close_splash - Close splash screen window
IPC Communication Model
Frame uses Tauri’s command system for synchronous request-response patterns and event emission for asynchronous updates.Command Invocation (Frontend)
Event Listening (Frontend)
Event Types
The backend emits the following events:- conversion-started - Task has started processing
- conversion-progress - Progress update (0-100)
- conversion-completed - Task completed successfully
- conversion-error - Task failed with error
- conversion-log - FFmpeg log output
Error Handling
All commands returnResult<T, ConversionError> types. The ConversionError enum (error.rs:4-22) defines all possible error types:
ConversionError Types
Shell command execution failed. Contains the error message from the failed command.
I/O operation failed (file read/write, directory access, etc.).
JSON parsing or serialization failed (typically during FFprobe output parsing).
Internal channel communication error between manager and workers.
Media file probing failed. Contains stderr output from FFprobe.
FFmpeg worker process error during conversion.
Invalid input parameters or configuration. Contains specific validation error message.
Attempted to pause/resume/cancel a task that doesn’t exist or isn’t running.
Error Serialization
Errors are automatically serialized to strings when sent to the frontend:Type System
All types useserde for serialization with camelCase field names when communicating with the frontend:
State Management
The backend maintains aConversionManager as managed state throughout the application lifecycle:
tauri::State: