Skip to content

Export edited media as video (MP4/WebM) via mediabunny #292

@maboa

Description

@maboa

Background

For video sources, the current export drops the video track entirely — the output is a mono WAV. That makes the redaction and gap-removal features much less useful on video content. Mediabunny can read and write real video containers (MP4, WebM, MKV) via WebCodecs, so we can produce a video file with the cuts applied.

Proposed change

When the source media has a video track, the export modal exposes video output options:

  • MP4 (H.264/AAC, broad compatibility).
  • WebM (VP9/Opus, smaller, open).

The export pipeline:

  1. Read source frames (audio + video) via mediabunny's Input.
  2. For each section in audioDataArray, copy frames whose timestamps fall within the section.
  3. Write to a mediabunny Output in the chosen container/codec.
  4. Audio and video tracks remain in sync.

Acceptance criteria

  • Modal detects whether the source has a video track and conditionally shows video format options.
  • Exported video is a valid file, plays in browsers and standard players.
  • Audio and video stay aligned after cuts.
  • Section boundaries are honored — either by aligning cuts to keyframes, or by re-encoding the GOP around the cut.

Open questions / risks

  • Pure remux (no re-encode) is fast but only frame-accurate at keyframes. Re-encoding the boundary GOP gives accurate cuts but is slower and may lose quality. Default behavior needs to be decided.
  • Some codec/container combinations may not be supported by every browser. Need to pick safe defaults and surface limitations.

Out of scope

  • Bitrate / codec advanced controls (separate issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions