Skip to content

fix(engine): support current FFmpeg filter scripts#2324

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/ffmpeg-filter-script-compat
Open

fix(engine): support current FFmpeg filter scripts#2324
miguel-heygen wants to merge 1 commit into
mainfrom
fix/ffmpeg-filter-script-compat

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Audio mixing now works on current FFmpeg nightlies without giving up compatibility with older stable installations or reintroducing Windows command-line overflow for large track counts.

Why

FFmpeg removed the deprecated -filter_complex_script alias from nightly builds. HyperFrames therefore emitted a video-only fallback even though the same filter graph is valid through FFmpeg's replacement -/filter_complex <file> syntax. Older FFmpeg builds do not recognize that replacement, so switching unconditionally would break existing users.

How

The mixer keeps the legacy file-valued option as its first attempt and retries with -/filter_complex only when stderr explicitly reports that filter_complex_script is unavailable. Both paths use the same temporary graph file, keeping 100+ track graphs off argv, and cleanup still runs after either attempt.

Test plan

  • Reproduced Unrecognized option 'filter_complex_script' on FFmpeg nightly N-125551
  • Verified -/filter_complex succeeds on the identical nightly graph
  • Verified local FFmpeg 4.2 rejects -/filter_complex, exercising the backward-compatibility requirement
  • bun run --cwd packages/engine test -- audioMixer.test.ts (12/12)
  • bun run --cwd packages/engine typecheck
  • bunx oxlint and bunx oxfmt --check on changed files
  • Pre-commit hooks, including typecheck and tracked-artifact checks

Compound Engineering
GPT-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant