openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Vendored CEF lacks proprietary codec support — Gmeet dynamic video backgrounds fail with FFmpegDemuxer error

Open oxoxDev opened this issue 6 months ago • 1 comments

Summary

Vendored tauri-cef ships the standard CEF binary distribution which omits proprietary codecs (H.264, AAC). Google Meet's dynamic (video) virtual backgrounds — the gstatic-hosted .mp4 clips — fail at the Chromium media-pipeline demuxer with MEDIA_ERR_SRC_NOT_SUPPORTED: PipelineStatus::DEMUXER_ERROR_NO_SUPPORTED_STREAMS: FFmpegDemuxer: no supported streams. Static effects (blur, classroom, library, plain images) work end-to-end because they don't hit the video decode path.

Problem

What happened: In an embedded Gmeet call (post #1054 perm-grant fix so cam works, post PR #1222 routing reliability fixes so cold-add reaches Meet), open the Effects panel → pick a dynamic / animated / video background (e.g. "Dog office", any of the looping clips). Cam turns off, Gmeet displays the generic "something went wrong" toast in the bottom-left. Static backgrounds (blur, library, classroom — image-only or shader-only paths) apply normally.

What we expected: All Meet bg-effect picks work, matching the experience in stock Chrome on the same account.

Impact: Gmeet feature-parity gap. Users see a confusing failure on a fairly prominent feature. The picker UI does not distinguish "this dynamic effect won't work in OpenHuman" from a legitimate failure.

Steps to reproduce:

  1. pnpm dev:app from any build at/after PR #1222 merge (so Gmeet cold-add lands properly).
  2. Add a Google Meet account, sign in, start an instant meeting.
  3. Open the Effects / Backgrounds picker on the call surface.
  4. Click any of the looping/dynamic backgrounds (icons that show video preview rather than a flat image).
  5. Observe: cam tile goes dark, "something went wrong" toast bottom-left.
  6. Click Effects → pick blur or a static image. Observe: applies normally.

Environment: macOS, dev:app build verified 2026-05-05 on PR #1222 branch (tip 4007103c). Vendored tauri-cef submodule on feat/cef at c10bc0f7. Reproducible on any platform — codec absence is a binary distribution choice, not platform-specific.

Evidence (Phase A diagnostic, 2026-05-05):

Probed via scripts/diagnose-cef-runtime.mjs (added in PR #1222). Capability gates inside an active Meet call:

{
  \"crossOriginIsolated\": false,
  \"hasSAB\": true,
  \"hasInsertableStreams\": true,
  \"hasWebGL2\": true,
  \"hasWebGPU\": true,
  \"hasAtomics\": true,
  \"href\": \"https://meet.google.com/fzp-mcgz-ayr#openhuman-account-...\"
}

SharedArrayBuffer, MediaStreamTrackProcessor / MediaStreamTrackGenerator (insertable streams), WebGL2, WebGPU, Atomics — all present. Original #1053 hypothesis (MediaPipe segmentation / cross-origin isolation / runtime feature gates) disproved. Pipeline is healthy; failure is purely at the demuxer layer.

Network.responseReceived capture during the bg-pick click:

204 https://meet.google.com/_/MeetingsUi/jserror?
    error=Error loading video from
      https://www.gstatic.com/video_effects/assets/dog_office_background_c6ba144bf6f55727684e7c31a262b720.mp4 ;
      crossOrigin: anonymous;
      error: MEDIA_ERR_SRC_NOT_SUPPORTED:
             PipelineStatus::DEMUXER_ERROR_NO_SUPPORTED_STREAMS:
             FFmpegDemuxer: no supported streams

Meet's own jserror endpoint logs the demuxer failure verbatim. The .mp4 asset uses H.264-in-MP4; vendored CEF's FFmpegDemuxer rejects it because the H.264 stream parser was compiled out of the standard distribution.

Solution

Root cause. CEF (the upstream Chromium Embedded Framework) splits its prebuilt binary distributions:

  • Standard Distribution — what tauri-cef currently vendors. Omits H.264, AAC, and other licensed codecs to avoid royalty obligations.
  • Spotify / Chrome-branded Distribution — includes the proprietary codec set. Available via the same cef-builds.spotifycdn.com host (different artifact name) and used by Chrome-derivative apps that have separately licensed H.264.

Chromium's FFmpegDemuxer is gated by the proprietary_codecs and ffmpeg_branding = \"Chrome\" build flags. Without those, an .mp4 with H.264 video falls into the path that emits DEMUXER_ERROR_NO_SUPPORTED_STREAMS — exactly the error Meet reports.

Recommended fix. Switch the vendored tauri-cef CEF binary fetch to the Chrome-branded distribution AND get clearance on the H.264 license obligations for OpenHuman's distribution model. The actual file change in tauri-cef is small (a one-line constant in the binary download script + a checksum bump). The hard part is the legal review.

Investigation tasks:

  1. Identify the exact CEF binary fetch script in vendored tauri-cef (likely under crates/tauri-runtime-cef/build.rs or a sibling shell script). Compare current artifact URL to the Chrome-branded variant — confirm the Chrome-branded archive exists and is fetchable for the same CEF version we're pinned at.
  2. Build tauri-cef against the Chrome-branded artifact in a dev branch. Verify (via the diagnostic harness) that FFmpegDemuxer accepts H.264 in a smoke test.
  3. Re-run the dynamic-bg flow in OpenHuman dev:app — confirm the .mp4 asset loads and the bg pipeline runs end-to-end.
  4. Legal: confirm OpenHuman's distribution license model is compatible with H.264 royalty obligations OR document this as won't-fix and surface the limitation in the Effects picker UI (grey out dynamic options with a tooltip).

Smaller alternative (UI-only). Detect H.264 / AAC absence at startup (e.g. via MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E\"') from the embedded webview) and inject a CSS rule into the Effects picker that hides or disables dynamic-bg options for meet.google.com. Closes the user-visible UX gap without the legal/build work but loses the feature entirely. Per CLAUDE.md "no new JS injection into CEF child webviews" rule this would have to be done via CDP Emulation.setUserAgentOverride to a UA that reports limited codec support — not all of Meet honours that signal.

Larger / orthogonal. Build CEF from source with proprietary_codecs = true; ffmpeg_branding = \"Chrome\" and ship the resulting binary ourselves. Avoids the Chrome-branded distribution entirely but adds a multi-hour CI build step + binary hosting cost.

Files likely to touch:

File Change
app/src-tauri/vendor/tauri-cef/crates/tauri-runtime-cef/build.rs (or sibling fetch script) Switch CEF binary URL/checksum from standard → Chrome-branded distribution
.gitmodules / submodule pin in app/src-tauri/vendor/tauri-cef Bump tauri-cef pin to a fork branch carrying the codec-enabled fetch
docs/qa/GMEET-PARITY.md row 15 ⚠️→✅ once verified
feedback_cef_runtime_gaps.md gap #3 Mark RESOLVED
Possibly app/src-tauri/Cargo.lock Regen if the new tauri-cef tip shifts dep tree

Acceptance criteria

  • [ ] Repro gone — Picking any dynamic bg in Gmeet inside dev:app applies the effect; cam stays on; no "something went wrong" toast.
  • [ ] Static path unchanged — Blur, classroom, library, and any other static bg continue to work (no regression in the path that already passes today).
  • [ ] No leak into bundle size beyond expectation — Chrome-branded CEF binary is larger than standard; document the size delta and confirm it's acceptable for distribution.
  • [ ] License posture clear — H.264 / AAC obligations for OpenHuman's distribution channels reviewed and documented (in docs/ or a comment beside the build flag).
  • [ ] Regression safety — scripts/diagnose-cef-runtime.mjs probe rerun captures MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E\"') === true post-fix as a one-shot smoke artefact.
  • [ ] Diff coverage ≥ 80% — .github/workflows/coverage.yml gate satisfied (most of this work is build-config; coverage applies to any Rust glue code added).

Related

  • Parent: #1053 — Gmeet background effects fail in CEF. This issue carries the actual codec-gap follow-up after PR #1222 reclassified row 15 to ⚠️ partial.
  • Diagnostic harness: scripts/diagnose-cef-runtime.mjs (added in PR #1222) — reuse for verification.
  • Adjacent CEF runtime gaps tracked in memory feedback_cef_runtime_gaps.md: Web Push (#1, gmail-poll workaround), BrowserChannel long-poll (#2, same workaround surface). Both unrelated to codec demux but live in the same vendored-tree fix-or-flag-around territory.
  • PR #1222 — surfaced + diagnosed this issue while shipping the gmeet cold-add routing-reliability fixes.

oxoxDev avatar May 05 '26 12:05 oxoxDev

Phase A follow-up — codec support matrix confirmed empirically

Ran direct CDP probe via MediaSource.isTypeSupported + HTMLVideoElement.canPlayType against the live meet.google.com target inside the embedded webview (vendored CEF cef_binary_146.0.9+g3ca6a87+chromium-146.0.7680.165_macosarm64_minimal):

Codec / MIME Supported
video/mp4; codecs="avc1.42E01E" (H.264 baseline) ❌ false
video/mp4; codecs="avc1.4D4028" (H.264 main) ❌ false
video/mp4; codecs="avc1.640028" (H.264 high) ❌ false
video/mp4; codecs="hev1.1.6.L93.B0" (HEVC) ❌ false
audio/mp4; codecs="mp4a.40.2" (AAC-LC) ❌ false
video/mp4 (any) ❌ false
video/webm; codecs="vp8" ✅ true
video/webm; codecs="vp9" ✅ true
video/mp4; codecs="av01.0.05M.08" (AV1) ✅ true
audio/webm; codecs="opus" ✅ true
audio/mpeg (MP3) ✅ true
<video>.canPlayType('video/mp4; codecs="avc1.42E01E"') "" (cannot play)

So both proprietary_codecs AND ffmpeg_branding = "Chrome" are off in the Spotify CDN CEF builds — applies to both standard and minimal flavors (Spotify CDN ships open-source-only by default, contrary to my earlier guess in the issue body).

Path C (UA spoof / webm fallback) ruled out

Probed gstatic for a webm sibling of the failing dog-office .mp4:

curl -sLI "https://www.gstatic.com/video_effects/assets/dog_office_background_c6ba144bf6f55727684e7c31a262b720.webm"
# HTTP/2 404
curl -sLI "https://www.gstatic.com/video_effects/assets/dog_office_background_c6ba144bf6f55727684e7c31a262b720.vp9.webm"
# HTTP/2 404

Meet only ships H.264-in-MP4 for the dynamic-bg asset library. There is no webm/VP9 fallback path to negotiate to. UA spoof + MediaSource.isTypeSupported lie wouldn't help — Meet would still try the .mp4.

Practical paths narrowed

Path Verdict
A — Self-compile CEF with proprietary_codecs=true; ffmpeg_branding="Chrome" Real fix. Multi-day work: build infra, MPEG-LA AVC pool license review, binary hosting.
B — Pull a third-party Chrome-branded CEF distribution Couldn't locate a publicly-hosted one for CEF 146.0.9. May not exist.
C — UA spoof to negotiate webm fallback Ruled out — no webm assets exist on gstatic.
D — Surface limitation in UI / GMEET-PARITY doc, leave dynamic bg failing as-is Honest stopgap. No code change. User clicks dynamic bg → "something went wrong" toast → user learns it's not supported. Static effects continue to work.

Recommendation: ship D as an immediate doc-only update (already partially done in PR #1222 GMEET-PARITY row 15 reclassification), and triage A as a separate epic with a license-review milestone before any code work begins. The vendored-CEF rebuild lives outside the openhuman codebase and shouldn't block any user-facing PR.

Per CLAUDE.md no-injection rule: do NOT add JS / CSS injection into the gmeet webview to hide dynamic-bg picker buttons. The audit doc + this issue's status are the user-facing surface.

oxoxDev avatar May 05 '26 12:05 oxoxDev