Architecture
The extension follows a layered architecture that separates concerns between UI and processing:Components
Extension Metadata
Defined inpackage.json:
- Name: camera-workflow
- Title: Camera Workflow
- Description: Prepare your camera library for cloud backup: shrink files, organize by date, keep originals safe
- Categories: Productivity, Developer Tools
- License: MIT
Commands
The extension provides a single command: Prepare Library for Backup (convert-media.tsx)
- Single-command guided flow from source selection to completion report
- View mode with real-time progress updates
- Comprehensive dependency validation before execution
Source Files
convert-media.tsx
convert-media.tsx
Main command entry point that orchestrates the workflow:
- Dependency checking: Validates system binaries and embedded converter
- Source detection: Automatically detects mounted volumes (SD cards, cameras)
- Source analysis: Scans selected directory for images and videos, calculates total size
- Destination setup: Auto-generates timestamped folder on Desktop or manual selection
- Preset management: Applies conversion presets or custom settings
- Form validation: Ensures paths exist and are writable
conversion-run.tsx
conversion-run.tsx
Execution view that runs the conversion process:
- Process spawning: Launches embedded binary with proper environment
- Live output: Captures and displays stdout/stderr in real-time
- Progress tracking: Updates UI with conversion status
- Report parsing: Extracts key metrics from log output
- Quick actions: Opens log file and destination folder
Embedded Binary Strategy
The extension embeds platform-specific Go binaries inassets/bin/:
media-converter-darwin-arm64(Apple Silicon)media-converter-darwin-amd64(Intel Mac)
Benefits
Zero Installation
Users don’t need to install or configure the converter separately.
Version Lock
Extension and converter versions are synchronized automatically.
PATH Independence
No reliance on user’s shell configuration or PATH setup.
Distribution
Single package contains everything needed to run.
Resolution Process
The extension resolves the converter binary using this logic:- Detect platform and architecture (
embeddedBinaryName()) - Resolve embedded binary from
environment.assetsPath/bin/ - Development fallback (optional): If
CAMERA_WORKFLOW_ALLOW_PATH_FALLBACK=1is set and running in development mode, falls back tomedia-converterin PATH
Production builds always use the embedded binary. PATH fallback is only available in development mode with explicit environment variable.
System Dependencies
While the converter is embedded, it relies on external system tools:| Dependency | Purpose | Detection |
|---|---|---|
ffmpeg | Video conversion and encoding | Resolved from PATH |
ffprobe | Video metadata extraction | Resolved from PATH |
magick | Image conversion (ImageMagick) | Resolved from PATH |
- Current process
PATH - Login shell
PATH(via$SHELL -lc) - macOS
path_helperoutput - Common installation locations (
/opt/homebrew/bin,/usr/local/bin, etc.)
Conversion Presets
The extension offers four preset configurations:Google Photos (Recommended)
- Photo format: AVIF at quality 78
- Video codec: H.265 at CRF 28
- Optimized for Google Photos free tier storage limits
High Quality
- Photo format: AVIF at quality 90
- Video codec: H.265 at CRF 23
- Prioritizes visual quality with moderate compression
Max Compression
- Photo format: AVIF at quality 70
- Video codec: AV1 at CRF 33
- Maximum space savings with acceptable quality loss
Custom
- All settings manually configurable
- Full control over format, codec, and quality parameters
Platform Support
Currently supports macOS only:- macOS on Apple Silicon (arm64)
- macOS on Intel (amd64)
The Go converter engine supports Linux and Windows, but Raycast extension binaries are currently built for macOS only. To use on other platforms, use the CLI interface instead.
Next Steps
Setup Guide
Install and configure the extension
Workflow Guide
Learn the guided conversion workflow