Skip to content

OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.

TypeScript
3.7 KB
Raw Blame

Browser export validation

Use the normal editor and export dialog. The harness creates local, synthetic media and checks bytes delivered by the browser. It does not inject an editor state, expose a test route, or drive a browser from a command line.

Generate fixtures from the repository root (requires local FFmpeg and ffprobe):

node apps/web/scripts/validate-browser-export.mjs fixtures

Fixtures are written to .codex-audit/browser-export/fixtures. For each case, create a fresh project, set its canvas and frame rate, import the fixture, and add it to the timeline. Open Export, keep Download to this device, and export. Use Custom Settings for WebM / VP9. Wait for the browser's download to finish and verify the actual downloaded file:

node apps/web/scripts/validate-browser-export.mjs verify landscape-mp4 /absolute/path/to/download.mp4
Case Fixture Output Expected
landscape-mp4 landscape-av.mp4 MP4 / H.264 640×360, 24fps, 2s, audio
landscape-webm landscape-av.mp4 WebM / VP9 640×360, 24fps, 2s, audio
portrait-60 portrait-av.mp4 MP4 / H.264 360×640, 60fps, 2s, audio
silent-webm silent.webm WebM / VP9 640×360, 30fps, 2s
trimmed-mixed Both MP4 fixtures MP4 / H.264 640×360, 24fps, 3s, audio
proxy-originals /tmp/openreel-next-proxy-source.mp4 MP4 / H.264 1920×1080, 24fps, 2s, audio

For trimmed-mixed, trim the landscape clip to 1s, then place the 2s portrait clip at 1s. Add a title across the cut. Inspect the exported cut and title visually as well as running the verifier. Enable proxy playback before exporting this case; the export must still use the originals. Proxies never replace originals in the project media library.

For proxy-originals, generate the additional 1080p fixture:

ffmpeg -f lavfi -i testsrc2=size=1920x1080:rate=24:duration=2 -f lavfi -i sine=frequency=440:sample_rate=48000:duration=2 -c:v libx264 -pix_fmt yuv420p -c:a aac -shortest /tmp/openreel-next-proxy-source.mp4

Create its 540p preview proxy, enable it for playback, then export at 1920×1080 / 24fps. This separately checks that choosing a smaller preview proxy does not reduce export dimensions. The fixture is not generated by the harness.

The verifier checks video codec, dimensions, frame rate, duration, required audio, and decodes the entire output. It writes <downloaded-file>.validation.json. A passing fixture file generated by FFmpeg is only a harness sanity check; it is not evidence of browser export success. Record browser export results only for files actually delivered by the editor.

Also exercise:

  • Cancel during rendering: no partial download and no later success status. Retry after cancellation settles.
  • Choose a file location: cancelling the picker creates no fallback download. A permission/write failure is shown and may be retried.
  • Unsupported codec: the dialog explains the browser limitation; do not silently encode a different codec. Select another supported format.
  • ProRes/high bit depth: browser export requires explicit H.264 fallback; acknowledged output is MP4 with an .mp4 filename. Desktop retains native options.
  • Missing original: relink the original before exporting. A preview proxy alone cannot authorize full-quality export.

Encoder availability differs by browser and operating system. Capability checks query the selected codec/container and output size. Unavailable HEVC, AV1, ProRes, or audio encoders must be reported honestly rather than presented as completed exports.

References: Mediabunny codec compatibility and capability queries, Writing media files.