Transparent video backgrounds on the web: WebM alpha vs HEVC alpha
Updated
No single video file is transparent in every browser. Chrome, Edge and Firefox play WebM (VP9) with an alpha channel, while Safari on Mac, iPhone and iPad ignores WebM's alpha and needs HEVC with alpha instead. Ship both files and choose one per browser.
The same transparent loop on two backgrounds, live.
Which browser plays which
| Browser | Transparent format | Notes |
|---|---|---|
| Chrome, Edge (desktop and Android) | WebM, VP9 with alpha | Long-standing support. Chrome can also decode HEVC on many devices, but not its alpha. |
| Firefox | WebM, VP9 with alpha | Supported since Firefox 53. |
| Safari (Mac), every browser on iPhone and iPad | HEVC with alpha (.mov / .mp4, tagged hvc1) | Since macOS Catalina and iOS 13. Safari plays WebM (16+ on Mac, 17.4+ on iOS) but drops its transparency. |
On iPhone and iPad, Chrome and Firefox use Apple's WebKit engine, so they behave like Safari and need the HEVC file.
Serve the right file
The usual <source> fallback list doesn't work here, because a browser can play the wrong file without its alpha and show a solid or black background. Pick the file in a few lines of JavaScript instead:
<video id="hero-video" autoplay muted loop playsinline
poster="/loop-poster.webp" aria-hidden="true"></video>
<script>
// Safari (and every browser on iPhone/iPad) needs HEVC alpha;
// Chrome, Edge and Firefox need WebM alpha. Don't rely on <source> order:
// each browser may "play" the other file but drop its transparency.
const ua = navigator.userAgent;
const appleWebKit = /iP(hone|ad|od)/.test(ua)
|| (/Macintosh/.test(ua) && navigator.maxTouchPoints > 1)
|| (/Safari\//.test(ua) && !/Chrome|Chromium|Edg\/|OPR\/|Firefox/.test(ua));
document.getElementById("hero-video").src =
appleWebKit ? "/loop.alpha.mov" : "/loop.alpha.webm";
</script>Make the two files
Start from an image sequence with real alpha (16-bit PNG from Blender, After Effects or similar), not a green-screen key, especially for glass or smoke, where the alpha is partial.
# from a PNG sequence with alpha (f_0001.png, f_0002.png, ...)
# WebM, VP9 with alpha: Chrome, Edge, Firefox
ffmpeg -framerate 30 -i f_%04d.png -c:v libvpx-vp9 -pix_fmt yuva420p \
-b:v 0 -crf 32 -row-mt 1 -auto-alt-ref 0 loop.alpha.webm
# HEVC with alpha: Safari, iPhone, iPad (needs a Mac: Apple's VideoToolbox encoder)
ffmpeg -framerate 30 -i f_%04d.png -c:v hevc_videotoolbox -allow_sw 1 \
-alpha_quality 0.8 -b:v 5000k -tag:v hvc1 loop.alpha.mov- Apple's HEVC encoder ignores quality settings like
-q:vfor alpha video; set a bitrate (-b:v) or files can come out several times too large. - Keep
-auto-alt-ref 0for VP9 alpha; alt-ref frames and alpha don't mix in libvpx. - Check the result over a bright and a dark background before you ship it. Edges that look clean on white can fringe on black.
What it costs
| File | Size (8 s, 1080p) | Plays in |
|---|---|---|
| Opaque AV1 (WebM) | 2.6 MB | Modern browsers |
| Opaque H.264 (MP4) | 3.3 MB | Everything |
| VP9 alpha (WebM) | 4.4 MB | Chrome, Edge, Firefox |
| HEVC alpha (MOV) | 6.0 MB | Safari, iPhone, iPad |
Transparency costs roughly 1.5 to 2 times the bytes. If your background is a fixed colour, render the loop opaque on that colour instead: it's smaller and plays everywhere.
Rendering glass for alpha in Blender
In Cycles, turn on Film → Transparent and Transparent Glass, and raise the roughness threshold if your glass is frosted; otherwise rough glass renders opaque in the alpha channel and shows up as a grey slab.
Skip the setup
Every Edgeloop loop ships pre-encoded (AV1, H.264 and both transparent formats) with a player that picks the right file, shows a poster, pauses off-screen and respects reduced motion.
<script src="https://edgeloop.studio/hero-loop.js" defer></script>
<hero-loop src="/loops/your-loop/" focus="right center"></hero-loop>Collection 01 opens soon. Join the waitlist for 3 free loops.
Questions
Does Safari support transparent WebM video?
Not as of late 2026. Safari plays WebM files but ignores the alpha channel, so use HEVC with alpha for Safari, iPhone and iPad.
Why is my transparent video black in Chrome?
Usually Chrome picked an HEVC file it can decode but whose alpha it ignores, or the WebM was encoded without yuva420p. Serve WebM VP9 alpha to Chrome and check the pixel format.
Can I use a GIF or animated WebP instead?
GIF has only on/off transparency and 256 colours, so soft edges and glass look poor. Animated WebP and APNG keep full colour and alpha but are usually much larger than video for the same loop.