Install ffmpeg via brew for screen recording (#781)

macos-15 GitHub runners don't have ffmpeg pre-installed.
This commit is contained in:
Lawrence Chen 2026-03-02 22:45:22 -08:00 committed by GitHub
parent 3cb101f1c8
commit 63e7cc7faa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,12 +97,21 @@ jobs:
echo "=== Display after ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "(none)"
- name: Install ffmpeg
if: ${{ inputs.record_video }}
run: |
brew install --quiet ffmpeg
FFMPEG_PATH=$(which ffmpeg)
echo "ffmpeg: $FFMPEG_PATH"
ffmpeg -version | head -1
echo "FFMPEG_PATH=$FFMPEG_PATH" >> "$GITHUB_ENV"
- name: Grant TCC screen recording permission
continue-on-error: true
run: |
TCC_DB="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
if [ -f "$TCC_DB" ]; then
for client in /usr/sbin/screencapture /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg; do
for client in /usr/sbin/screencapture "${FFMPEG_PATH:-/opt/homebrew/bin/ffmpeg}" /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg; do
sqlite3 "$TCC_DB" "INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version) VALUES ('kTCCServiceScreenCapture', '$client', 1, 2, 4, 1);" 2>/dev/null || true
done
fi