.mp4 MIME type
MP4 videovideo
video/mp4The most widely supported video container, usually holding H.264 or H.265 video with AAC audio.
| MIME type | video/mp4 |
|---|---|
| Extensions | .mp4, .m4v |
| Content-Type | video/mp4 |
| Compress in transit? | No — already compressed |
| File signature | 66 74 79 70 (ftyp) at offset 4 an ISO base media file; the brand after ftyp is typically isom or mp42 |
Good to know
- Browsers need
Accept-Ranges: bytesand 206 Partial Content responses to seek; static file servers and CDNs handle this automatically. - For fast start, the
moovindex must be at the beginning of the file (ffmpeg -movflags +faststart). - The MIME type doesn't say which codec is inside;
<source type='video/mp4; codecs="avc1.42E01E"'>can.
Serve .mp4 files with the right type
The response header to send:
Content-Type: video/mp4
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
video/mp4 mp4 m4v;
AddType video/mp4 .mp4 .m4v
res.set("Content-Type", "video/mp4");import mimetypes
mimetypes.add_type("video/mp4", ".mp4")
mimetypes.add_type("video/mp4", ".m4v")<input type="file" accept=".mp4,.m4v,video/mp4">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.mp4 | grep -i '^content-type:' file --mime-type file.mp4
Frequently asked questions
What is the MIME type for .mp4 files?
video/mp4. The same type covers .m4v.
What Content-Type header should a .mp4 file be served with?
Content-Type: video/mp4. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .mp4?
Check its bytes rather than the extension: MP4 files contain 66 74 79 70 (ftyp) at byte offset 4 — an ISO base media file; the brand after ftyp is typically isom or mp42. On the command line, file --mime-type name.mp4 does this for you.
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options