video/webm video/webm means: video/webm is the media type for video in a WebM container, typically VP8/VP9 video with Vorbis/Opus audio. WebM is an open, royalty-free format optimized for the web, offering efficient compression and broad support in Chromium and Firefox. Video media types describe moving-image containers, which bundle video, audio and subtitle streams. The subtype drives player selection and streaming behavior; modern delivery often pairs a container type with adaptive streaming manifests. Declaring the correct video type is essential for inline playback, poster frames and hardware-accelerated decoding. You will encounter video/webm in contexts such as open-format web video delivery; vp9/opus video for efficient streaming; mediarecorder api video capture output. It is commonly associated with the file extension(s) .webm. Safari's WebM support has historically been partial, so provide an MP4 fallback for universal playback. The MediaRecorder API commonly outputs video/webm in Chromium; check isTypeSupported() before relying on it across browsers.
When you'll see video/webm
- Open-format web video delivery
- VP9/Opus video for efficient streaming
- MediaRecorder API video capture output
How to handle it
When delivering video, choose a container and codec combination your audience supports, enable byte-range requests for progressive playback, and use adaptive streaming manifests for varying bandwidth. Provide a poster image and captions track where relevant. Always declare the exact video type on segments and manifests; a mismatch is a common cause of players that load but never start. As a final checklist for video types: enable faststart and byte-range requests, provide adaptive streaming for variable bandwidth, include captions and a poster frame, match the declared type to the real container and codec, and test playback on the devices your audience actually uses.
Notes & gotchas
Safari's WebM support has historically been partial, so provide an MP4 fallback for universal playback. The MediaRecorder API commonly outputs video/webm in Chromium; check isTypeSupported() before relying on it across browsers.
Examples
HTTP/1.1 200 OK
Content-Type: video/webm
Accept-Ranges: bytes
Content-Disposition: inline; filename="sample.webm"
[binary video payload: the encoded bytes of a sample .webm] curl -i -H "Accept: video/webm" https://api.example.com/v1/resource # inspect the returned Content-Type const res = await fetch("/media/sample.webm", { headers: { Accept: "video/webm" } });
const blob = await res.blob(); // blob.type should be "video/webm"
const url = URL.createObjectURL(blob); // assign to img.src / audio.src / video.src
// revoke with URL.revokeObjectURL(url) when done to free memory import requests
res = requests.get("https://api.example.com/v1/resource",
headers={"Accept": "video/webm"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("video/webm")
with open("sample.webm", "wb") as fh:
fh.write(res.content) # raw bytes; use stream=True for large files Frequently asked questions
Is WebM better than MP4?
WebM (VP9) often compresses better than H.264 MP4 and is royalty-free, but MP4/H.264 has wider device support. Offer WebM with an MP4 fallback to balance efficiency and compatibility.
What does MediaRecorder produce for video?
Usually video/webm; codecs=vp9,opus or vp8,vorbis in Chromium. Verify support and provide a transcoding path if you need MP4 output for compatibility.
Which video MIME type should I serve for the web?
video/mp4 (H.264/AAC) has the broadest support; video/webm (VP9/Opus) is efficient and open. For adaptive streaming use application/vnd.apple.mpegurl (HLS) or application/dash+xml. Match the type to the actual container.
Can I stream video with a plain video/mp4 type?
Yes for progressive download with byte-range requests (Accept-Ranges: bytes). For adaptive bitrate streaming you need a manifest type (HLS/DASH) plus segment types; the player switches quality based on bandwidth.
Why does my video download fully before playing?
The moov atom is likely at the end of the file and the server lacks byte-range support. Re-mux with faststart (moov at the front) and enable Accept-Ranges: bytes for progressive playback.
Try the Base64 Encoder
Encode and decode Base64 with UTF-8 and URL-safe options.