# .mpeg MIME Type: video/mpeg

> MPEG-1 and MPEG-2 video, the formats of Video CDs and DVDs.

- MIME type: `video/mpeg`
- Extensions: .mpeg, .mpg, .mpe
- Content-Type header: `video/mpeg`
- Compress in transit: no (already compressed)
- File signature: `00 00 01 BA` (an MPEG program stream pack header; raw MPEG video streams start with 00 00 01 B3)

## Good to know

- Browsers don't play MPEG-1 or MPEG-2 in `<video>`. Transcode to H.264 MP4: `ffmpeg -i in.mpg -c:v libx264 -c:a aac out.mp4`.
- MPEG-2 transport streams are a different container — see [.ts](https://www.devkult.com/mime/ts.md).

## Server configuration

### nginx (inside the types block in mime.types)

```
video/mpeg mpeg mpg mpe;
```

### Apache (.htaccess or server config)

```
AddType video/mpeg .mpeg .mpg .mpe
```

### Express

```
res.set("Content-Type", "video/mpeg");
```

### Python

```
import mimetypes

mimetypes.add_type("video/mpeg", ".mpeg")
mimetypes.add_type("video/mpeg", ".mpg")
mimetypes.add_type("video/mpeg", ".mpe")
```

### HTML file input

```
<input type="file" accept=".mpeg,.mpg,.mpe,video/mpeg">
```

## FAQ

### What is the MIME type for .mpeg files?

`video/mpeg`. The same type covers .mpg, .mpe.

### What Content-Type header should a .mpeg file be served with?

`Content-Type: video/mpeg`. It's already compressed, so servers shouldn't gzip it.

### How can I tell if a file is really a .mpeg?

Check its bytes rather than the extension: MPEG files start with `00 00 01 BA` — an MPEG program stream pack header; raw MPEG video streams start with 00 00 01 B3. On the command line, `file --mime-type name.mpeg` does this for you.

## Related types

- [.mp4 — video/mp4](https://www.devkult.com/mime/mp4.md)
- [.ts — video/mp2t](https://www.devkult.com/mime/ts.md)
- [.avi — video/x-msvideo](https://www.devkult.com/mime/avi.md)

Open the interactive page: https://www.devkult.com/mime/mpeg