Export: fall back to VP9/AV1 when H.264 unavailable and warn about software encoding

Firefox on Linux exposes VideoEncoder but reports every avc1.* config as
unsupported (OpenH264 is decode-only), so pickVideoConfig returned null and
export threw "no supported H.264 configuration found". Probe VP9/AV1 families
after H.264 and pick the first profile that isConfigSupported and does not
reorder (B-frame) — same 12-frame ordering test. Map the chosen family to
mp4-muxer's video codec (avc/vp9/av1).

Before any rendering, probe the codec for the chosen preset and show a
modal when we fell off H.264 onto a software VP9/AV1 path — that's what the
user felt as "super slow". The modal names the codec, explains render vs
encode cost, suggests Chromium/Chrome for hardware H.264 (or 720p/lower
preset), and offers Continue anyway / Cancel (Esc/backdrop also cancel) plus
"Don't warn again this session". Injected pick is threaded through
Exporter.export({ videoPick }) and exportSegment so we don't probe twice.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Dejvino
2026-08-29 18:17:53 +02:00
co-authored by Claude
parent b2c9497bae
commit e5484c9c38
7 changed files with 487 additions and 36 deletions
+12
View File
@@ -21,6 +21,18 @@
</div>
<div id="hud" hidden></div>
<div id="toast" hidden></div>
<div id="export-warn" hidden>
<div class="ew-backdrop"></div>
<div class="ew-box" role="dialog" aria-modal="true" aria-labelledby="ew-title">
<div id="ew-title" class="ew-title">Software encoding — export will be slow</div>
<div id="ew-body" class="ew-body"></div>
<div class="ew-actions">
<button id="ew-cancel">Cancel</button>
<button id="ew-continue" class="primary">Continue anyway</button>
</div>
<label class="ew-opt"><input type="checkbox" id="ew-dontask"> Don't warn again this session</label>
</div>
</div>
</div>
<div id="transport">