Skip to content

Desktop App

The desktop app lives in desktop/ and uses Tauri, Vite, React, TypeScript, and the root Rust crate. It is designed as a local music-generation tool rather than a video editor.

Workflow

  1. Import one local video.
  2. Review detected video metadata and scene moments.
  3. Write one short music direction.
  4. Pick a style preset and intensity.
  5. Generate and review the score waveform.
  6. Export audio-only, replace-video-audio, or mix-with-original output.

Open the workflow tutorial for the full step-by-step walkthrough.

Import and scene analysis workflow
Import a video and inspect scene analysis.
Generate review and export workflow
Generate, review, and export the score.

Run The Frontend Preview

bash
cd desktop
pnpm dev

The browser preview uses mocked native state for the happy path. Real import, generation, artifact reveal, and export run inside the Tauri app.

Run The Tauri App

bash
cd desktop
pnpm tauri dev

Package The App

Prepare redistributable FFmpeg sidecars before a release package:

bash
cd desktop
VIDBGM_FFMPEG=/path/to/ffmpeg \
VIDBGM_FFPROBE=/path/to/ffprobe \
pnpm prepare:ffmpeg-sidecars

Development builds create PATH-forwarding debug wrappers automatically, but release packaging rejects those wrappers. Use LGPL-compatible FFmpeg/FFprobe binaries for release builds and keep license notices with the package.

bash
cd desktop
pnpm package:app

The desktop app calls typed Tauri commands backed by the shared Rust code:

  • probe_video
  • generate_music
  • magenta_status
  • setup_magenta
  • cancel_run
  • open_artifact

Export Modes

ModeResult
Audio onlyWrites a generated WAV.
Replace video audioWrites a movie with generated music replacing the source audio.
Mix with originalWrites a movie with generated music mixed under or over the source audio.

Runtime Dependencies

The desktop app resolves media tools in this order:

  1. VIDBGM_FFMPEG / VIDBGM_FFPROBE environment overrides.
  2. Bundled Tauri sidecars.
  3. ffmpeg / ffprobe on PATH for development.

Magenta model files are not bundled. The app exposes a first-run setup action that downloads the selected model and shared resources into the Tauri app data directory. Generation uses that app-data Magenta cache, so the music-generation path runs locally after setup. Development can still resolve a locally built bridge from the source checkout or VIDBGM_MAGENTA_BRIDGE.

Rust CLI and Tauri desktop docs for adaptive video background music generation.