#32

record fails on Apple Silicon: downloads x86_64 ffmpeg, dies with EBADARCH (-86)

Openjapanglyopened 3mo ago

On an Apple Silicon Mac, npx webreel record fails on first run with:

Recording: test
Downloading chrome-headless-shell... (one-time setup)
chrome-headless-shell ready.
Downloading ffmpeg... (one-time setup)
spawn Unknown system error -86

Error -86 is EBADARCH — bad CPU type in executable.

Cause

chrome-headless-shell is fetched correctly as mac-arm64, but the bundled ffmpeg is x86_64:

$ uname -m
arm64

$ file ~/.webreel/bin/chrome-headless-shell/chrome-headless-shell-mac-arm64/chrome-headless-shell
Mach-O 64-bit executable arm64

$ file ~/.webreel/bin/ffmpeg/ffmpeg
Mach-O 64-bit executable x86_64

Rosetta 2 is not installed on this machine, so the x86_64 binary cannot execute at all. On a Mac that happens to have Rosetta installed this would presumably work, which may be why it has gone unnoticed.

Workaround

Replacing the binary with a native build fixes it completely — recording then succeeds in 12s and produces a correct MP4:

cp /opt/homebrew/bin/ffmpeg ~/.webreel/bin/ffmpeg/ffmpeg

Suggested fix

Select the ffmpeg build by process.arch, the way the chrome-headless-shell download already does — the arm64 path is clearly already handled correctly for Chrome.

Environment

  • webreel 0.1.4
  • macOS 26.6 (build 25G72), arm64
  • Node v26.0.0
  • Rosetta 2 not installed

Happy to test a fix.

Activity

0

No activity yet.