Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8d3766b
chore: establish 5.1.4 build baseline and fix emulated-build OOM
asoulliereHT Jul 4, 2026
bc80279
build: bump emsdk to 6.0.2 (native arm64) and drop x265
asoulliereHT Jul 4, 2026
8634391
wip: port fftools to FFmpeg 7.1.5 — MT core builds (runtime WIP)
asoulliereHT Jul 4, 2026
f77730f
wip: MT 7.1.5 core loads + transcodes (runtime fixes)
asoulliereHT Jul 4, 2026
9d490fb
fix: cap auto thread count + pool sizing (fixes re-entrancy race)
asoulliereHT Jul 4, 2026
3cb5bc9
test: reuse a single FFmpeg instance across suites
asoulliereHT Jul 4, 2026
3af4400
feat: re-add progress + timeout bridges for 7.x — MT suite 10/10
asoulliereHT Jul 4, 2026
5784308
build: drop theora/vorbis/ogg (lean codec set)
asoulliereHT Jul 4, 2026
3cbc59d
build: drop libass + freetype/fribidi/harfbuzz (no subtitles/text)
asoulliereHT Jul 4, 2026
837d02a
fix(test): replace broken serve script with a COI-capable server
asoulliereHT Jul 4, 2026
602a955
test: cover clip-editor ops (lossless cut + concat)
asoulliereHT Jul 4, 2026
bab9ab3
build: pin floating lib branches to SHAs + bump zlib to 1.3.1
asoulliereHT Jul 4, 2026
03d8ef0
ci: modernize workflow (MT-only) + tag-release artifacts for vendoring
asoulliereHT Jul 4, 2026
5550c76
docs: add FORK.md — fork overview, capabilities, headers, vendoring
asoulliereHT Jul 4, 2026
d1b80bc
ci: trigger workflow on v* tags so the release job runs
asoulliereHT Jul 4, 2026
ee0ff88
ci: run headless Chrome with --no-sandbox (required on CI as root)
asoulliereHT Jul 4, 2026
ba022b6
ci: use npm install (lockfile drift in apps/*) + Node 22
asoulliereHT Jul 4, 2026
3757191
feat(ffmpeg)!: upgrade FFmpeg 7.1.5 → 8.1.2
asoulliereHT Jul 5, 2026
e963926
refactor(build): parameterize codec set by FFMPEG_VARIANT (default full)
asoulliereHT Jul 5, 2026
2c995be
feat(build): add slim MT variant (prd-mt-slim, x264+zlib only)
asoulliereHT Jul 5, 2026
be88ab4
ci: build + attach both full and slim cores to the release
asoulliereHT Jul 5, 2026
9dc5f79
docs(fork): document slim/full release variants and sizes
asoulliereHT Jul 5, 2026
a03b759
feat(build)!: slim = --disable-everything + app allowlist (~6 MB)
asoulliereHT Jul 5, 2026
eb9bc5f
docs(adr): record MT-only core decision (no ST build on 8.x)
asoulliereHT Jul 8, 2026
06ee3ba
feat(build): add ST 5.1.10 cores (full + copy) with non-COI vetting lane
asoulliereHT Aug 13, 2026
e0c8a74
fixup(review): address PR #3 panel findings
asoulliereHT Aug 13, 2026
c911f92
ci: build, test, and release the ST copy core
asoulliereHT Aug 14, 2026
7c2ad5b
fix(ci): check out the testdata submodule in the ST job
asoulliereHT Aug 14, 2026
73cf6d3
test: gate the copy core's GPL-free property in the cliptool suite
asoulliereHT Aug 14, 2026
c021267
Merge pull request #3 from flocasts/feat/st-5.1.10-core
asoulliereHT Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 156 additions & 163 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,186 +2,179 @@ name: CI

on:
push:
branches:
- main
branches: [main]
tags: ["v*"]
pull_request:
branches:
- main
branches: [main]

# Least-privilege default; the release job below opts into write explicitly.
permissions:
contents: read

jobs:
build-core:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Update pkg-config database
run: sudo ldconfig
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache build
id: cache-build
uses: actions/cache@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Build the multithreaded core (emsdk 6.0.2 is multi-arch, so this builds
# natively on the amd64 runner). 6.0+ fftools require threads, so the MT
# cores are 8.x; the single-threaded cores are 5.1 (st-build-and-test).
- name: Build ffmpeg-core-mt
run: |
make prd-mt EXTRA_ARGS="--cache-from=type=gha,scope=core-mt --cache-to=type=gha,mode=max,scope=core-mt"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: build-cache-st
key: build-cache-st-v1-${{ hashFiles('Dockerfile', 'Makefile', 'build/*') }}
restore-keys: |
build-cache-st-v1-
- name: Build ffmpeg-core
run: make prd EXTRA_ARGS="--cache-from=type=local,src=build-cache-st --cache-to=type=local,dest=build-cache-st,mode=max"
- name: Upload core
node-version: 22

- name: Install dependencies
run: npm install --no-audit --no-fund

# Build the JS packages (@ffmpeg/ffmpeg, @ffmpeg/util). npm install --no-audit --no-fund also fetches
# the headless Chromium that mocha-headless-chrome (puppeteer) drives.
- name: Build JS packages
run: npm run build

- name: Run MT test suite
run: npx start-server-and-test "npm run serve" 3000 "npm run test:browser:ffmpeg:mt"

- name: Upload core-mt artifact
uses: actions/upload-artifact@v4
with:
name: ffmpeg-core
path: packages/core/dist/*
build-core-mt:
name: ffmpeg-core-mt
path: packages/core-mt/dist/*

# Slim variant gate (parallel with build-and-test — no added wall-clock). Builds
# the ~6 MB slim core and runs the slim app-ops suite (copy cut/concat, single-
# input libx264 re-encode, re-encode stitch). The generic MT suite can't gate
# slim: its mp4->avi transcode needs the avi muxer/mpeg4 encoder slim drops.
slim-build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Cache build
id: cache-build
uses: actions/cache@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build ffmpeg-core-mt-slim
run: |
make prd-mt-slim EXTRA_ARGS="--cache-from=type=gha,scope=core-mt-slim --cache-to=type=gha,mode=max,scope=core-mt-slim"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: build-cache-mt
key: build-cache-mt-v1-${{ hashFiles('Dockerfile', 'Makefile', 'build/*') }}
restore-keys: |
build-cache-v1-
- name: Build ffmpet-core-mt
run: make prd-mt EXTRA_ARGS="--cache-from=type=local,src=build-cache-mt --cache-to=type=local,dest=build-cache-mt,mode=max"
- name: Upload core-mt
node-version: 22

- name: Install dependencies
run: npm install --no-audit --no-fund

- name: Build JS packages
run: npm run build

- name: Run slim app-ops suite
run: npx start-server-and-test "npm run serve" 3000 "npm run test:browser:ffmpeg:slim"

- name: Upload core-mt-slim artifact
uses: actions/upload-artifact@v4
with:
name: ffmpeg-core-mt
path: packages/core-mt/dist/*
tests:
name: ffmpeg-core-mt-slim
path: packages/core-mt-slim/dist/*

# ST gate (parallel with the MT jobs). Builds BOTH 5.1.10 ST cores — the
# full core doubles as the input synthesizer for the cliptool suite (the
# copy core has no encoders by design) — then runs the ST suite and the
# verbatim clipping-tool-ui commands against the copy core, both on the
# non-COI server (the whole point of ST is running without COOP/COEP; the
# pages assert crossOriginIsolated === false).
st-build-and-test:
runs-on: ubuntu-latest
needs:
- build-core
- build-core-mt
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Download ffmpeg-core
uses: actions/download-artifact@v4
with:
name: ffmpeg-core
path: packages/core/dist
- name: Download ffmpeg-core-mt
uses: actions/download-artifact@v4
# submodules: the cliptool suite fetches testdata/audio-1s.wav, and
# testdata is a git submodule — without this the directory is empty in
# CI and the fixture fetch 404s. The MT jobs use only embedded fixtures.
- name: Checkout
uses: actions/checkout@v4
with:
name: ffmpeg-core-mt
path: packages/core-mt/dist
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v4
submodules: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build ffmpeg-core (ST full) + ffmpeg-core-copy
run: |
make prd EXTRA_ARGS="--cache-from=type=gha,scope=core-st --cache-to=type=gha,mode=max,scope=core-st"
make prd-st-copy EXTRA_ARGS="--cache-from=type=gha,scope=core-st-copy --cache-to=type=gha,mode=max,scope=core-st-copy"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
node-modules-
node-version: 22

- name: Install dependencies
run: npm install
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
run: npm install --no-audit --no-fund

- name: Build JS packages
run: npm run build

- name: Run ST suite (non-isolated)
run: npx start-server-and-test "npm run serve:no-coi" 3001 "npm run test:browser:ffmpeg:st"

- name: Run cliptool suite against the copy core (non-isolated)
run: npx start-server-and-test "npm run serve:no-coi" 3001 "npm run test:browser:cliptool:copy"

- name: Upload core-copy artifact
uses: actions/upload-artifact@v4
with:
chrome-version: stable
- name: Run tests
env:
CHROME_HEADLESS: 1
CHROME_PATH: chrome
CHROME_FLAGS: "--headless --disable-gpu --no-sandbox --enable-features=SharedArrayBuffer,CrossOriginIsolation"
HEADERS: '{"Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp"}'
name: ffmpeg-core-copy
path: packages/core-copy/dist/*

# On a version tag, publish the vendorable artifacts (core + wrapper) as a
# GitHub Release, so downstream apps can vendor from a targeted release.
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build-and-test, slim-build-and-test, st-build-and-test]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build core + JS packages
run: |
make prd-mt EXTRA_ARGS="--cache-from=type=gha,scope=core-mt --cache-to=type=gha,mode=max,scope=core-mt"
make prd-mt-slim EXTRA_ARGS="--cache-from=type=gha,scope=core-mt-slim --cache-to=type=gha,mode=max,scope=core-mt-slim"
make prd-st-copy EXTRA_ARGS="--cache-from=type=gha,scope=core-st-copy --cache-to=type=gha,mode=max,scope=core-st-copy"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install + build JS packages
run: |
npm install --no-audit --no-fund
npm run build

- name: Package vendorable artifacts
run: |
# Start test server with proper headers for all tests
npm run serve -- --headers "$HEADERS" &

# Increase wait time to ensure server is ready
sleep 15

# Verify headers and isolation status
echo "Checking security headers and isolation status..."
curl -v http://localhost:3000/tests/ffmpeg-core-st.test.html 2>&1 | grep -i "cross-origin"

# Run verification script first
echo "Verifying browser environment..."
cat << EOF > verify-browser.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin">
<meta http-equiv="Cross-Origin-Embedder-Policy" content="require-corp">
</head>
<body>
<script>
console.log('SharedArrayBuffer available:', typeof SharedArrayBuffer !== 'undefined');
console.log('crossOriginIsolated:', window.crossOriginIsolated);
if (!window.crossOriginIsolated || typeof SharedArrayBuffer === 'undefined') {
throw new Error('Browser environment not properly configured for SharedArrayBuffer');
}
</script>
</body>
</html>
EOF

# Run single-threaded tests first
echo "Running single-threaded tests..."
npx mocha-headless-chrome \
--args="$CHROME_FLAGS" \
-a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-core-st.test.html 2>&1 | tee st-core-test.log

npx mocha-headless-chrome \
--args="$CHROME_FLAGS" \
-a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-st.test.html 2>&1 | tee st-test.log

# Run multi-threaded tests
echo "Running multi-threaded tests..."
# Create a test script to verify browser environment
cat << EOF > verify-browser.html
<!DOCTYPE html>
<html>
<head>
<title>Browser Environment Test</title>
</head>
<body>
<script>
console.log('SharedArrayBuffer available:', typeof SharedArrayBuffer !== 'undefined');
console.log('crossOriginIsolated:', window.crossOriginIsolated);
</script>
</body>
</html>
EOF

# Run the verification in Chrome
echo "Verifying browser environment..."
npx mocha-headless-chrome \
--args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \
-f http://localhost:3000/verify-browser.html

# Run MT tests with verified configuration
npx mocha-headless-chrome \
--args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-core-mt.test.html 2>&1 | tee mt-core-test.log

npx mocha-headless-chrome \
--args="$CHROME_FLAGS --enable-features=SharedArrayBuffer,CrossOriginIsolation" \
-a no-sandbox \
-f http://localhost:3000/tests/ffmpeg-mt.test.html 2>&1 | tee mt-test.log

# Display all logs for debugging
echo "=== Test Logs ==="
for log in *-test.log; do
echo "Contents of $log:"
cat $log
done
mkdir -p dist-release
tar -C packages/core-mt/dist -czf "dist-release/ffmpeg-core-mt-${GITHUB_REF_NAME}.tgz" .
tar -C packages/core-mt-slim/dist -czf "dist-release/ffmpeg-core-mt-slim-${GITHUB_REF_NAME}.tgz" .
tar -C packages/core-copy/dist -czf "dist-release/ffmpeg-core-st-copy-${GITHUB_REF_NAME}.tgz" .
tar -C packages/ffmpeg/dist -czf "dist-release/ffmpeg-wasm-${GITHUB_REF_NAME}.tgz" .

- name: Attach artifacts to release
uses: softprops/action-gh-release@v2
with:
files: dist-release/*.tgz
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ dist
/.nyc_output
.DS_Store

# local buildx cache (see Makefile EXTRA_ARGS / CI cache steps)
build-cache-st/
build-cache-mt/

# ide
.idea/

Expand Down
Loading
Loading