Output Formats

Hypervideo supports multiple transparent video formats. Each has different trade-offs for file size, browser support, and quality.

Format Comparison

FormatCodecFile SizeBrowser SupportProcessingBest For
WebPWebP + alphaSmall (~1.5MB/6s)All browsersAISmallest files, works everywhere
APNGAnimated PNGMedium (~3-5MB/6s)All browsers (iOS 8+)AIiOS Safari, <img> tag usage
Stacked-AlphaH.264 / AV1Medium (~5-10MB/6s)All via WebGLAICross-platform with player SDK
WebMVP9Small (~1.5MB/6s)Chrome, Firefox, EdgeChromakeyFast processing, Chrome-first
MOVProRes 4444Large (~60MB/6s)Safari, video editorsChromakeyProfessional editing, Safari fallback

Recommendations

Web (general)

Use webp for the smallest files with universal browser support.

bash
curl -F "format=webp" -F "quality=40" ...

iOS / Safari

Use apng for native <img> tag support on iOS Safari. Works without JavaScript or WebGL. Limited to 15fps and 640px max width.

bash
curl -F "format=apng" ...

Cross-platform with SDK Players

Use stacked-alpha with the React, Expo, or Swift player. Standard H.264 video works on every platform; the player SDK handles compositing.

bash
curl -F "format=stacked-alpha" ...

Fast Processing (Green Screen)

Use webm or mov for chromakey-based processing (~10s vs 60s).

bash
curl -F "format=webm" -F 'chromaKey={"r":0,"g":255,"b":0}' ...

Multiple Formats

Request multiple formats in one call:

bash
curl -F 'formats=["webp","stacked-alpha"]' ...

How Stacked-Alpha Works

The stacked-alpha format encodes both color and transparency in a single standard video file:

  • Top half: RGB color frames
  • Bottom half: Grayscale alpha mask

A WebGL shader (or Metal on iOS) composites both halves in real-time for transparent playback. This allows transparent video on platforms that don't natively support it (Safari, iOS, Android).

APNG Constraints

  • Max 15 fps (lower frame rate for smaller files)
  • Max 640px width (auto-scaled)
  • Encoded with apngasm for optimal compression
  • Quality parameter affects quantization (lower = smaller but more dithering)