Why Transparent WebM Shows a Black Background on iOS Safari (And How to Fix It)
By the Charmotion team · Updated · How we write guides

iOS Safari reportedly ignores the alpha channel in a VP9 WebM, so the transparent pixels are drawn black. Apple documents transparency for HEVC with alpha instead. Serve an HEVC with alpha .mov to Safari first, with a correctly encoded yuva420p WebM after it for other browsers.
Key takeaways
- Safari reportedly ignores the alpha channel in VP9 WebM, so transparent pixels turn black.
- Run ffprobe on the WebM first; pix_fmt yuva420p means the alpha channel survived encoding.
- Encode the WebM with libvpx-vp9, yuva420p and -auto-alt-ref 0.
- Serve an HEVC with alpha .mov to Safari first, with the WebM second.
- Test on a real iPhone, because VP9 alpha support in Safari is reported, not documented by Apple.
Why does a transparent WebM show black on iOS Safari?
The problem is in playback, not in the design. A WebM file encoded with VP8 or VP9 can carry a per-pixel alpha channel, and Chrome added alpha support for WebM video in Chrome 31. Chromium-based browsers and Firefox show that transparency over a web page.
Safari behaves differently. A Svgator guide says Chrome, Edge and Firefox show the alpha channel of a VP8 or VP9 WebM while Safari ignores it. A Rotato guide from 2026 says Safari still does not support VP9 or WebM transparency. Apple's own documentation describes transparent video through HEVC with alpha and does not document VP9 alpha for Safari.
So the file plays, but the transparency does not reach the screen. A player that ignores the alpha layer draws the transparent pixels as an opaque colour, and in this case that colour is black. The same WebM can look correct in desktop Chrome and still show a black rectangle on an iPhone.
That is why transparent WebM video has a black background on iOS Safari even when the encode looks right in an editor. The fix has two parts: confirm the WebM really holds an alpha channel, then give Safari a second file it can render with transparency.
How do you check whether the WebM has an alpha channel?
Start with the file, because a WebM that lost its alpha during encoding shows a solid background in every browser. ffprobe, which ships with FFmpeg, reports the pixel format of the video stream.
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,pix_fmt -of default=nw=1 input.webmA file with alpha reports pix_fmt=yuva420p. If it reports yuv420p, the transparent layer is gone and no browser will show it. Re-encode from the source using the steps below.
Then play the file in desktop Chrome. If the background is transparent there and black only on an iPhone, the file is fine and the problem is Safari's playback path. For a quick look at a clip before you deploy it, use the site's transparent video checker.
How do you encode a transparent WebM that keeps its alpha?
Encode with the libvpx-vp9 encoder and an alpha-capable pixel format. A commonly shared FFmpeg command for a transparent WebM looks like this.
ffmpeg -i input.mov -c:v libvpx-vp9 -pix_fmt yuva420p -auto-alt-ref 0 -b:v 2M output.webm- -c:v libvpx-vp9 selects the VP9 encoder.
- -pix_fmt yuva420p keeps the alpha channel. Without it, the transparent layer is discarded and replaced with black or white.
- -auto-alt-ref 0 turns off alternate reference frames, which can cause rendering glitches or strip the alpha channel.
- -b:v 2M sets a 2 Mbps target. Raise it for detailed art, or lower it for small loops.
Use a source that keeps alpha, such as ProRes 4444 or a PNG sequence. If your source is already a VP9 WebM, FFmpeg's native VP9 decoder can drop the alpha, so select libvpx-vp9 as the decoder before the input:
ffmpeg -c:v libvpx-vp9 -i source.webm -c:v libvpx-vp9 -pix_fmt yuva420p -auto-alt-ref 0 -b:v 2M output.webmThis file should show transparency in Chrome, Edge and Firefox. It will not fix Safari on its own, which is why the next step adds a second file.
How do you give Safari a transparent video it can render?
Apple's route to transparent video in Safari is HEVC with alpha. Apple's WWDC19 session 506 states that Safari in iOS 13 and macOS Catalina supports it. The base and alpha layers sit in a single video track inside a QuickTime movie, and a player that does not understand alpha shows only the base layer. That fallback is why a wrong file looks opaque rather than broken.
On a Mac, FFmpeg 4.4.1 or newer can write HEVC with alpha through the hevc_videotoolbox encoder. The DeNA HEVCPlayerView README gives this command, which uses the hvc1 tag that Apple software looks for.
ffmpeg -i input.mov -c:v hevc_videotoolbox -require_sw 1 -allow_sw 1 -alpha_quality 0.5 -vtag hvc1 hevc.movApple also provides avconvert for the same job, and the AVFoundation preset AVAssetExportPresetHEVC1920x1080WithAlpha exports a 1920 by 1080 movie with HEVC video with alpha and AAC audio. Check avconvert's help on your Mac for its current syntax, since this guide does not document it.
Now put the MOV first and the WebM second. The DeNA README uses a video element with playsinline, muted and a video/quicktime source type for Safari.
<video autoplay loop muted playsinline>
<source src="/media/mascot-alpha.mov" type="video/quicktime">
<source src="/media/mascot-alpha.webm" type="video/webm">
</video>The browser uses the first source it can play, so the order matters. The muted attribute allows autoplay, and playsinline keeps the clip in place on iPhone instead of opening fullscreen. Test the order in each browser, because the fallback only helps if the other browser skips the source it cannot render.
Can you avoid video transparency on iOS altogether?
If you do not need video, the transparency problem goes away. Three routes avoid it.
- Animated GIF. GIF transparency is all or nothing: each pixel is either fully transparent or fully opaque, and a frame uses a palette of up to 256 colours. Anti-aliased edges and soft shadows suffer, so use GIF for small, hard-edged loops.
- Rive. A Rive file is drawn by a runtime on a canvas, so no video alpha is involved. A state machine can switch moods without loading a second file, and Rive's runtimes are open source and play any .riv file.
- Lottie. Lottie is a vector JSON format that a player draws on screen, which also avoids video alpha. Compare the trade-offs in transparent video on websites.
Video still has a place in marketing cuts and social posts, where a transparent MOV and a transparent WebM from one source cover Safari and Chrome. Charmotion exports transparent WebM (VP9 alpha) and transparent MOV (HEVC alpha) from a character's page or with the export_videos MCP tool, in about a minute, and exports do not use credits.
How do you test the fix on iPhone, Chrome and Firefox?
Test each combination before you ship. Use a real iPhone for the Safari rows, since that is the device your readers use.
| Check | What to look for |
|---|---|
| ffprobe on the WebM | pix_fmt=yuva420p |
| Chrome desktop, WebM | Transparent background |
| Firefox, WebM | Transparent background, per the Svgator guide |
| iPhone Safari, MOV first | Transparent background |
| iPhone Safari, WebM only | Black or opaque background, as reported |
| Chrome, MOV first | Expect the WebM fallback; a 2026 Rotato guide says Chrome does not support HEVC with alpha |
If the iPhone row fails with the MOV first, run ffprobe on hevc.mov and confirm the codec and the hvc1 tag before you change the page.
Fix a transparent WebM that shows black on iOS Safari
- Check the WebM's pixel format. Run ffprobe with -show_entries stream=codec_name,pix_fmt on the WebM. A pix_fmt of yuva420p means the alpha channel is present; yuv420p means it was lost.
- Re-encode the WebM with alpha. Encode with -c:v libvpx-vp9, -pix_fmt yuva420p, -auto-alt-ref 0 and a bitrate such as -b:v 2M, from a source that keeps alpha.
- Make an HEVC with alpha MOV on a Mac. Use FFmpeg 4.4.1 or newer with hevc_videotoolbox, -alpha_quality 0.5 and -vtag hvc1 to write a .mov file that Safari can render with transparency.
- Order the sources for Safari. In a video element with muted and playsinline, list the MOV source first and the WebM source second, with the correct type attributes.
- Test on a real iPhone and in other browsers. Confirm a transparent background on iPhone Safari, Chrome desktop and Firefox, and confirm that the fallback takes over where the MOV is skipped.
Frequently asked questions
Does Safari ever play transparent WebM correctly?
Reports disagree, and the documentation is thin. A Svgator guide says Safari ignores the alpha channel in VP8 or VP9 WebM, and a 2026 Rotato guide says Safari still does not support VP9 or WebM transparency. Apple documents transparency for HEVC with alpha and does not document VP9 alpha for Safari, so test on the iPhone models your audience uses before relying on it.
Can a matching background colour hide the black box?
Only on one page with one colour. The box disappears while the page behind the video matches it exactly, so it breaks in dark mode, on gradients and on any page where the colour changes. Treat it as a stopgap and fix the file format instead.
Why not use an animated GIF instead?
GIF transparency is all or nothing: each pixel is either fully transparent or fully opaque, so anti-aliased edges can show a light halo and soft shadows lose their fade. A GIF frame also uses a palette of up to 256 colours. For small, hard-edged loops it works in most places, which makes it a reasonable fallback for simple art.
Does HEVC with alpha work in Chrome?
Apple's documentation describes HEVC with alpha for Safari, and a 2026 Rotato guide says Chrome does not render it. Keep a WebM with alpha as the second source, and test Chrome on your own page before you rely on either file.
Sources
- Using HEVC video with alpha, Apple
- WWDC19 session 506, Apple
- Alpha transparency in Chrome video, Google Chrome team
- HEVCPlayerView README, DeNA (GitHub)
- What is a WebM file?, Svgator
- Transparent videos for the web, Rotato