spike(embedded-mpv): auto-detect Homebrew prefix and Node headers for Intel Macs

BREW_PREFIX was hardcoded to /opt/homebrew (Apple Silicon) and NODE_INC to
one nvm version; both now resolve via brew --prefix and the PATH node's
execPath, so the pending Intel Mac run needs no Makefile edits. README gets
a fresh-machine checklist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 committed 2026-07-15 18:20:45 +02:00
1 parent 7a396ac1d3
commit a378414137
2 files changed
+20 -7

No files matched your search

+6 -5
View File
@@ -1,11 +1,12 @@
# mpv frame-copy spike (macOS only for now).
#
# Requires: Homebrew libmpv (brew install mpv) and Node headers for the
# N-API addon. Override NODE_INC if your Node lives elsewhere:
# make NODE_INC=$(node -e 'console.log(process.execPath)')/../../include/node
# Requires: Homebrew libmpv (brew install mpv) and Node >= 18 on PATH (for
# its N-API headers). Both are auto-detected; override BREW_PREFIX/NODE_INC
# if detection picks the wrong one. Works on Apple Silicon (/opt/homebrew)
# and Intel (/usr/local) Homebrew layouts.
BREW_PREFIX ?= /opt/homebrew
NODE_INC ?= $(HOME)/.nvm/versions/node/v22.14.0/include/node
BREW_PREFIX ?= $(shell brew --prefix 2>/dev/null || echo /opt/homebrew)
NODE_INC ?= $(shell node -p "require('path').join(process.execPath, '..', '..', 'include', 'node')" 2>/dev/null)
BUILD := build
+14 -2
View File
@@ -20,8 +20,20 @@ to measure whether the copy pipeline meets the go/no-go gates.
## Build and run
Requires Homebrew `mpv` (libmpv + headers) and Node headers for the addon
build (`NODE_INC` in the Makefile, defaults to nvm's v22.14.0).
Requires Homebrew `mpv` (libmpv + headers) and Node ≥ 18 on `PATH`; the
Makefile auto-detects the Homebrew prefix (Apple Silicon and Intel) and the
Node include dir.
Quick checklist for a fresh machine (e.g. the pending Intel Mac run):
```bash
brew install mpv # libmpv + headers
git clone <repo> && cd <repo>
pnpm install --frozen-lockfile # provides the Electron binary for the viewer
cd spikes/mpv-frame-copy
./run.sh 'av://lavfi:testsrc2=size=1920x1080:rate=60' # sanity
# then the RESULTS.md scenarios (4K synthetic, 4K HEVC hwdec, 50 fps, HDR)
```
```bash
./run.sh /path/to/video.mkv 3840x2160