Two Container Formats Solving Different Problems
WebM is Google's open-source video container, designed for web delivery without patent licensing. It pairs with VP9 (or VP8 for older content) for video and Vorbis or Opus for audio.
MP4 with H.264 is the universal container, designed by MPEG with patent royalties. It works everywhere from iPhone 4S to modern smart TVs.
The choice between them depends on your delivery context, audience, and bandwidth budget. This post covers the practical decision matrix in 2026.
For broader codec context, see HEVC to H.264 for Premiere and AV1 Encoding.
File Size Comparison
For a 60-second 1080p video at similar visual quality:
| Format | File size | Bitrate |
|---|---|---|
| MP4 H.264 (CRF 22) | 12 MB | 1.6 Mbps |
| WebM VP9 (CRF 30) | 8 MB | 1.1 Mbps |
| WebM AV1 (CRF 30) | 6 MB | 0.8 Mbps |
| MP4 HEVC (CRF 24) | 7 MB | 0.9 Mbps |
WebM with VP9 is roughly 30% smaller than equivalent MP4/H.264. WebM with AV1 is 50% smaller. For bandwidth-conscious delivery, WebM saves real money at scale.
Browser Support in 2026
| Browser | MP4 H.264 | WebM VP9 | WebM AV1 |
|---|---|---|---|
| Chrome | Yes | Yes | Yes |
| Firefox | Yes | Yes | Yes |
| Safari | Yes | Limited | Limited |
| Edge | Yes | Yes | Yes |
| Mobile Safari (iOS) | Yes | Limited | No |
| Android Chrome | Yes | Yes | Yes |
| Android Firefox | Yes | Yes | Yes |
The outlier is Safari/iOS. Apple resisted VP9 for years, finally added partial support in Safari 14. AV1 in Safari is iPhone 15+/macOS Sonoma+ only.
For broadest reach including iOS users: MP4/H.264 (or HEVC) primary. WebM as alternative for non-iOS users.
Hardware Decoder Support
| Decoder | H.264 | VP9 | AV1 |
|---|---|---|---|
| Modern smart TVs | Yes | Yes | Recent only |
| Set-top boxes (Roku, Apple TV) | Yes | Limited | Recent only |
| Mobile chipsets (post-2018) | Yes | Yes | Recent (iPhone 15+) |
| Desktop CPUs (post-2014) | Yes | Yes | Software-only often |
| Game consoles | Yes | PS5/Xbox Series only | New only |
H.264 has the deepest hardware support. VP9 covers most modern devices. AV1 hardware decode is still spreading.
When to Pick MP4 with H.264
Use MP4/H.264 when:
- Audience includes any iOS users
- Delivery to set-top boxes, smart TVs, game consoles
- Email attachments, MMS, embed in PowerPoint
- Maximum compatibility is non-negotiable
- File size isn't the primary constraint
For most consumer-facing content in 2026: MP4/H.264 remains the safe default.
When to Pick WebM with VP9
Use WebM/VP9 when:
- Audience is web-only (no iOS app required)
- Bandwidth costs scale with delivery (savings compound)
- You serve via the
<picture>or<video>element with fallback - Open-source preference (no patent licensing concerns)
For cost-conscious web delivery to non-iOS audiences: WebM/VP9 saves bandwidth.
When to Pick WebM with AV1
Use WebM/AV1 when:
- Audience is overwhelmingly modern devices (post-2023)
- You can serve multiple formats via
<source>fallback chain - Bandwidth efficiency matters at scale
- You can absorb 5-10x slower encoding cost
For premium streaming with cutting-edge codec adoption: WebM/AV1 leads on bandwidth.
For deeper AV1 specifics, see AV1 Encoding in 2026.
The <source> Fallback Pattern
For maximum reach with bandwidth optimization:
<video controls>
<source src="video.webm" type="video/webm" />
<source src="video.mp4" type="video/mp4" />
Your browser does not support video.
</video>
The browser picks the first format it supports. Modern browsers serve WebM, older browsers fall back to MP4. The size penalty is having both formats stored.
For HLS adaptive streaming, see DASH vs HLS Streaming.
Encoding to WebM
For WebM/VP9:
ffmpeg -i input.mp4 \
-c:v libvpx-vp9 -b:v 0 -crf 30 \
-c:a libopus -b:a 128k \
-movflags faststart \
output.webm
Note: -b:v 0 enables CRF mode. Without it, the encoder uses constant bitrate (less efficient).
For WebM/AV1 (slower but better):
ffmpeg -i input.mp4 \
-c:v libsvtav1 -preset 6 -crf 30 \
-c:a libopus -b:a 128k \
output.webm
Encoding speed difference: VP9 encoding is 2-3x slower than H.264. AV1 encoding is 10-20x slower.
Audio Codec Choices
WebM supports two audio codecs:
| Codec | Use case |
|---|---|
| Vorbis | Legacy WebM (pre-2013) |
| Opus | Modern WebM (default) |
Opus is dramatically more efficient than Vorbis. For new content, always use Opus. Bitrate guidance:
- Voice/podcast: 64-96 kbps
- Music: 96-128 kbps
- High-quality audio: 192-256 kbps
For comparison with MP3, see Audio Bitrate Quality Guide.
Streaming Considerations
For HLS streaming (Apple's adaptive bitrate):
- HLS supports MP4 (CMAF) primarily
- HLS does not natively support WebM
- For Safari iOS streaming: MP4 only
For DASH streaming:
- DASH supports both MP4 and WebM
- Better browser flexibility on non-Apple platforms
For broader CDN context, see Cloudflare Stream vs Mux vs Bunny.
Common Issues
WebM won't play in Safari: VP9 in Safari is partial; some content fails. Provide MP4 fallback.
File size larger than expected: VP9 needs CRF mode; constant bitrate is less efficient.
Browser plays MP4 instead of WebM: source order in HTML matters; place WebM first.
Audio out of sync after encoding: VP9 keyframe interval mismatch with audio. Set -g 240 for keyframe alignment.
Mobile playback stutters: hardware decoder absent for VP9 on older mobile chipsets. Provide MP4 H.264 fallback.
For broader iOS-specific issues, see iPhone Cinematic Mode Export.
Frequently Asked Questions
Is WebM open-source?
WebM is BSD-licensed (open source). VP9 is royalty-free. AV1 is royalty-free under AOMedia. No patent payments for either.
Why doesn't Safari support VP9 fully?
Apple's strategic position: HEVC and AV1 over VP9. Safari has partial VP9 support but not full hardware decode on all iOS devices.
Should I serve MP4 and WebM?
For broadest reach with bandwidth savings: yes. Use <source> element fallback. Storage cost roughly doubles, but you save bandwidth on the majority of users.
Can WebM contain HEVC?
No. WebM container is restricted to VP8, VP9, and AV1 video. For HEVC: use MP4.
What about VP10?
VP10 was the codec being developed when AOMedia formed. AV1 is the AOMedia continuation, drawing from VP10 work plus Daala and Cisco's Thor. VP10 was never released as standalone.
Does YouTube use WebM?
YouTube serves WebM/VP9 to compatible browsers and MP4/H.264 as fallback. The mix depends on the viewer's browser and device.
Related Reading
Bottom Line
For maximum compatibility: MP4 with H.264. For bandwidth optimization to non-iOS audiences: WebM with VP9. For premium streaming with modern devices: WebM with AV1. Use <source> fallback chain for the best of both. Our video compressor handles MP4/H.264 conversions.



