Skip to content

video/mp4 MIME Type — Meaning, Usage & Examples

video/mp4
Extensions: .mp4, .m4v Class: video Spec: RFC 4337 (IANA registered)
View IANA registration ↗

video/mp4 means: video/mp4 is the registered media type for video in an MP4 container, most commonly H.264 video with AAC audio. It is the most broadly supported web video format, playing natively in every major browser and device, and is the safe default for online video. 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/mp4 in contexts such as web video playback via the video element; progressive download and streaming of h.264 content; social and marketing video distribution. It is commonly associated with the file extension(s) .mp4, .m4v. MP4 is a container; the codecs inside matter for compatibility. H.264/AAC is universally supported, while H.265/HEVC in MP4 is not. Enable byte-range requests (Accept-Ranges: bytes) so players can seek without downloading the whole file.

Advertisement
Ad slot · ref-top

When you'll see video/mp4

  • Web video playback via the video element
  • Progressive download and streaming of H.264 content
  • Social and marketing video distribution

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

MP4 is a container; the codecs inside matter for compatibility. H.264/AAC is universally supported, while H.265/HEVC in MP4 is not. Enable byte-range requests (Accept-Ranges: bytes) so players can seek without downloading the whole file.

Examples

HTTP
HTTP/1.1 200 OK
Content-Type: video/mp4
Accept-Ranges: bytes
Content-Disposition: inline; filename="sample.mp4"

[binary video payload: the encoded bytes of a sample .mp4]
curl
curl -i -H "Accept: video/mp4" https://api.example.com/v1/resource   # inspect the returned Content-Type
JavaScript (fetch)
const res = await fetch("/media/sample.mp4", { headers: { Accept: "video/mp4" } });
const blob = await res.blob();            // blob.type should be "video/mp4"
const url = URL.createObjectURL(blob);    // assign to img.src / audio.src / video.src
// revoke with URL.revokeObjectURL(url) when done to free memory
Python (requests)
import requests

res = requests.get("https://api.example.com/v1/resource",
                   headers={"Accept": "video/mp4"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("video/mp4")
with open("sample.mp4", "wb") as fh:
    fh.write(res.content)   # raw bytes; use stream=True for large files

Frequently asked questions

Which video format works in all browsers?

MP4 with H.264 video and AAC audio (video/mp4) has the broadest native support. WebM (VP9/Opus) is an efficient open alternative; offer both with fallbacks for full coverage.

Why won't my MP4 seek in the browser?

The server likely does not support byte-range requests. Enable Accept-Ranges: bytes and ensure the moov atom is at the file start (faststart) for progressive playback.

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.

Advertisement
Ad slot · ref-in-article

Try the Base64 Encoder

Encode and decode Base64 with UTF-8 and URL-safe options.

Open tool →