Files
autoclip/src-tauri
周小舟 73fa9b3257 fix: bundle self-contained ffmpeg+ffprobe and wire backend to use them
The desktop build started the backend fine on the build machine but would
fail on any clean Mac: video processing needs ffmpeg/ffprobe and neither was
usable for distribution.

Three compounding bugs, all fixed:

1. backend_manager.rs never set AUTOCLIP_FFMPEG_PATH, so the backend fell
   back to `shutil.which("ffmpeg")` — i.e. the build machine's homebrew
   ffmpeg. Now the launcher exports AUTOCLIP_FFMPEG_PATH / AUTOCLIP_FFPROBE_PATH
   pointing at the bundled binaries (resources/ffmpeg/{ffmpeg,ffprobe}).

2. The build bundled only ffmpeg, not ffprobe (the backend needs both).

3. The bundled ffmpeg was homebrew's dynamic build (412KB, 57 /opt/homebrew
   dylib deps) — dead on any machine without homebrew. The build now downloads
   the STATIC arm64 ffmpeg+ffprobe (48MB each, zero non-system deps) from
   osxexperts.net, cached under build/ffmpeg-cache, with a build-time assert
   that fails if any homebrew dep reappears.

Also exclude stray *.rdb from the bundled backend source.

Verified end-to-end: full build → App+DMG; app launches with /opt/homebrew
stripped from PATH (clean-machine sim), backend starts, HTTP server responds;
bundled ffmpeg/ffprobe run under an empty environment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 13:45:57 +08:00
..