Transparent WebM

A WebM is a Matroska container holding VP8 or VP9 video. Both of those codecs can carry a fourth value per pixel — how opaque it is — and most trouble comes from that value being dropped between the encoder and the screen. What it is, where it survives, how to check.

What the alpha channel actually is

Ordinary video stores three numbers per pixel: red, green and blue. A transparent WebM stores a fourth, the alpha, running from 0 (fully invisible) to 255 (fully solid). It rides alongside the colour planes in the same bitstream, which is why the codec matters: VP8 and VP9 have an alpha mode, and a WebM written with a codec that does not is just a rectangle.

The values in between are the ones worth caring about. A cut-out that only knows “there” and “gone” is what gives keyed footage its cut-with-scissors outline. This keyer produces a continuous alpha: inside the tolerance band, a pixel’s opacity is proportional to how far its colour sits from the key colour, so hair, motion blur and soft fabric keep a graded edge. The band only exists when the Edge slider is above zero. At zero and below it closes, and every pixel snaps to fully on or fully off.

Three places the alpha gets dropped

  1. At encoding. The encoder has to be asked for a codec with an alpha mode. If it is not, the frames are flattened onto a background before the first byte is written, and nothing downstream can recover what was never stored.
  2. At playback. A player that ignores alpha composites the frames against something, usually black. The file is intact; the player is not reading it.
  3. On upload. Any service that re-encodes to H.264 destroys the alpha on the way in. If a platform does not document an alpha-friendly format, assume the transparency will not survive.

What this tool writes

Exporting a transparent WebM here is a recording, not an encode. The page draws each keyed frame onto a canvas, calls captureStream at 30 fps on that canvas, and hands the stream to MediaRecorder. Concretely, the export:

Without MediaRecorder or captureStream, the WebM button is hidden rather than offering an option that cannot work; the PNG sequence is the fallback. The video page covers the same exports from the shooting side.

The file has no duration, and why that bites

A WebM written by MediaRecorder carries no duration in its header. The browser reports the length as infinity until something forces a scan to the end, and an editor that trusts the header will show an unknown length, refuse to scrub, or import a truncated clip. This is a container artefact, not damaged video.

Remux rather than re-encode: copying the streams into a fresh container leaves the alpha alone, while any re-encode is a chance to lose it. Play the file once in a browser first — that is enough to make the real length appear in most tools that read it afterwards.

How to check whether the transparency survived

  1. Put the file on a page or a canvas with a coloured background. A subject that floats over the colour has alpha; a subject sitting on black does not.
  2. Import it into an editor and drop another clip underneath. Same test, better lighting.
  3. If you have ffprobe, read the pixel format of the video stream. An entry with an alpha component means the channel is there; a plain yuv420p means it is not.

Do the test on the machine and in the version you are actually shipping to. “It played fine for me” on one browser says nothing about the player your client uses.

Where it plays, and where it does not

We have not run a compatibility matrix across players and editors, so this page reports no playback percentages. What follows is the practical shape of the problem, and every third-party entry is something to verify in the version you use:

When this does not work

Where our published numbers come from

The measurements behind the keying claims on this site live in the CSVs of the reference repository on GitHub, and the write-up is archived on Zenodo under DOI 10.5281/zenodo.22916767. Those fixtures are synthetic 320x240 images, not real footage. They measure how well an algorithm separates a subject from a backdrop; they say nothing about containers, codecs or players, which is why this page carries none of those numbers.

To make one, the tool keys the backdrop and records the result entirely in your browser — no upload, no account, no watermark. The transparent video page compares the formats side by side.

Open the tool