Registry Mirror
Skip to content

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Extension clips now encode on macOS. Until now each one failed with Unknown encoder 'libopenh264': the macOS ffmpeg bundle is built with VideoToolbox and without openh264, so the inserted word's stretch got no media.

  • macOS: -c:v h264_videotoolbox -allow_sw 1.
  • Windows and Linux: -c:v libopenh264, unchanged.
  • -allow_sw 1 lets VideoToolbox fall back to Apple's software encoder. The M1's hardware one refuses sizes above 4096x2304, and a generated clip copies its source's geometry. At 4K it costs nothing measurable.
  • The rest of the command is unchanged, and the comment that claimed every bundle carries openh264 is corrected.

No released version is affected: insertions are only enabled in dev builds.

Not touched: the macOS export ladder in crates/compositor/src/pipeline_macos.rs also ends on libopenh264 and libkvazaar, which that bundle lacks. It is an export fallback, not this defect.

Related issue

None.

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

No UI change.

Testing

  • Unit: npx vitest --run electron/media/extensionClip.test.ts, 12/12, each platform passed in. Putting libopenh264 back on macOS fails two tests.
  • Checks: both typechecks and npm run lint are green.
  • M1 Mac, macOS 27.0.1, with the ffmpeg bundled in 2.1.2, 2.2.1, 2.2.2-rc.1 and 2.3.0:
    • h264_videotoolbox is its only H.264 encoder;
    • the old command fails, exit 8;
    • the new one decodes back to 108 frames of H.264 1920x1080 and an AAC track;
    • hardware only, 4480x2520 and up fail with -12903. With -allow_sw 1, every size up to 8K encodes.
  • Windows: the bundled ffmpeg has libopenh264 and rejects -allow_sw. A test pins it to macOS.

Not verified: the in-app flow on macOS, and Intel Macs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when creating video clips across macOS, Windows, and Linux.
    • Clip encoding now uses platform-appropriate settings, including a software fallback on macOS, helping ensure clips can be generated consistently across supported systems.

The macOS ffmpeg bundle is built without openh264, so asking it for
libopenh264 failed every extension clip with "Unknown encoder" and left
the inserted word's stretch without media. The encoder is now chosen per
platform: h264_videotoolbox on macOS, with -allow_sw 1 so a size or a
Mac the hardware encoder refuses falls back to Apple's software one, and
libopenh264 on Windows and Linux.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

extensionClipArgs now selects an H.264 encoder based on the platform. ensureExtensionClip passes process.platform, and tests check encoder selection and platform-specific options.

Changes: Extension clip encoding

Layer / File(s) Summary
Platform encoder selection
electron/media/extensionClip.ts, electron/media/extensionClip.test.ts
extensionClipArgs now accepts a platform and selects h264_videotoolbox with -allow_sw 1 on macOS, or libopenh264 on other platforms. ensureExtensionClip passes process.platform. Tests check encoder selection, option values, and the geometry fallback call.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: beetix

Merge Risk: Minimal · up to 8aa7d

Extension clips on macOS now use the VideoToolbox encoder, with software fallback, instead of an encoder missing from the macOS ffmpeg bundle. Windows and Linux behavior is unchanged. No concrete merge risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: extension clips now encode with VideoToolbox on macOS. The changeset selects h264_videotoolbox on macOS and keeps libopenh264 elsewhere, and the title accurately state…
Description check Passed The description follows the template. It has a Summary that explains the macOS and Windows/Linux encoder split, the reason for -allow_sw 1, and the out-of-scope compositor fallback. The Related issue …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: extension clips now encode with VideoToolbox on macOS. The changeset selects h264_videotoolbox on macOS and keeps libopenh264 elsewhere, and the title accurately states the primary fix. The title is concise and uses the conventional fix(media) prefix.

Full details: Description check

Explanation

The description follows the template. It has a Summary that explains the macOS and Windows/Linux encoder split, the reason for -allow_sw 1, and the out-of-scope compositor fallback. The Related issue section says 'None' rather than using the 'Fixes #' form, which is a minor gap. Type of change, release impact, desktop impact, and testing are all filled in with specific commands, results, and platforms. Screenshots is marked as not applicable. Overall the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04a52dc0-70d3-418d-929e-86161a40cf16
Commits

Reviewing files that changed from the base of the PR and between 128ab63 and 8aa7d1f.

Files selected for processing: 2

  • electron/media/extensionClip.test.ts
  • electron/media/extensionClip.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@EtienneLescot
EtienneLescot merged commit 7bf92d3 into main Nov 22, 2026
20 checks passed
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