Skip to content

Check encoder support before export instead of failing after the render #32

Open

Description

@blixvip

exportPreview() (public/demo.mjs:282) checks only that VideoEncoder and requestVideoFrameCallback exist. It never checks whether the actual codec settings are supported:

  • the video settings at demo.mjs:302 (avc1.640033, 1920 wide, 24 Mbps)
  • the audio settings at demo.mjs:264 (mp4a.40.2, 192 kbps, at the decoded rate and channel count)

WebCodecs H.264 and AAC encoding support varies by platform and build. When AAC is missing, the whole film still renders frame by frame. Then encodeAudio fails at "Adding sound…", the catch at demo.mjs:353 shows "Export failed", and minutes of work are thrown away.

Expected: unsupported settings are caught before rendering, and a video-only file is still produced when only audio is unsupported.

Fix direction: before creating the hidden film, call VideoEncoder.isConfigSupported(...). Once the audio buffer is decoded, call AudioEncoder.isConfigSupported(...). If video is unsupported, show a specific label. If only AAC is unsupported, build the muxer without an audio track and say so afterwards.

Related to #10, but about Chrome/Edge builds, not new browsers.

Done when forcing AudioEncoder.isConfigSupported to return { supported: false } in DevTools produces a silent MP4 right away instead of "Export failed" after the render.

Activity

  1. added
    help wantedExtra attention is needed
    platformmacOS, Linux, or Windows specific
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededplatformmacOS, Linux, or Windows specific

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions