Bundle the ffmpeg sidecar (#117) #118
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!118
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-117-ffmpeg-sidecar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #117.
Ships ffmpeg as a Tauri sidecar, so posters, joined Voice clips, master stamping and proxies no longer depend on the ffmpeg on
PATH.The build
The comment on #117 named gyan.dev 9.0.2. However, gyan.dev builds are all GPLv3, and neither the essentials nor the full build has
libopenh264. That conflicts with the issue's "unmodified LGPL build" and with the OpenH264 proxy fallback. After discussion, this uses an LGPL build of the same version:ffmpeg-n9.0.2-17-g2a571b6068-win64-lgpl-9.0.zip, from releaseautobuild-2026-09-30-13-08. BtbN keeps month-end autobuilds and prunes the daily ones.--enable-version3(LGPLv3), without--enable-gplor--enable-nonfree.libopenh264andh264_nvenc(checked by a new test).Changes
scripts/fetch-ffmpeg.mjsdownloads the pinned zip and checks the zip's SHA-256 andffmpeg.exe's SHA-256. It then writessrc-tauri/binaries/ffmpeg-x86_64-pc-windows-msvc.exe, which is gitignored. If the sidecar already matches, the script exits in about 0.15 s. It has a small zip reader, so it needs no systemunzip/tar(Bun tests infetch-ffmpeg.test.mjs).src-tauri/build.rsruns the script beforetauri_build::build(). Sotauri dev,tauri buildandcargo test --workspacefetch it on a fresh checkout. It runs again when the script (and so the pin) changes or the sidecar is missing. The first build needsnodeand network access.tauri.conf.json:bundle.externalBin: ["binaries/ffmpeg"], andbundle.resourcesforlicenses/ffmpeg/.Ffmpeg::locate: in debug builds, if nothing is found beside the exe, it tries the fetched sidecar in the checkout beforePATH. The order is nowAI_STUDIO_FFMPEG, beside the exe, the fetched sidecar (debug only),PATH.Ffmpeg::locate()instead of readingAI_STUDIO_FFMPEGor falling back to"ffmpeg", so they run the same binary.src-tauri/licenses/ffmpeg/: the LGPLv3 and GPLv3 texts andNOTICE.md. The notice names the build, both hashes, the FFmpeg source commit and the BtbN build-recipe commit. It also says the binary is used unmodified and can be replaced.run-ai-studioskill: how the sidecar is fetched for development.Verification
PATH:cargo test --workspace --all-featurespasses, including the two proxy tests from the issue. This machine's ownPATHffmpeg lackslibopenh264and used to fail them.bun run tauri buildproduced the MSI and NSIS installers. An administrative extract of the MSI putsffmpeg.exenext toai-studio.exe, with the licence files underlicenses/ffmpeg/.src-tauri/binaries/and rebuilding fetches the sidecar again.bun test src scriptsandbun run checkpass. Clippy shows only warnings that were already onmain.detect_proxy_encoderis unchanged.the_encoder_the_startup_check_finds_makes_a_proxypasses on an RTX 5090.Open points
NOTICE.mdpoints to the build recipe, which lists them, but does not reproduce their licence texts. If you want full attribution in the bundle, that is a follow-up.ffmpeg.rsand the issue both cite ADR-0003 for the sidecar, but ADR-0003 ("A Rust core owns the domain") doesn't mention ffmpeg. This decision may deserve its own ADR.cargo test -p studio-corealone doesn't buildsrc-tauri, so on a fresh checkout runnode scripts/fetch-ffmpeg.mjsfirst. The skill says so.