Utilo

AVI MIME Type – Free, Online, Private

video/x-msvideo is the type static servers send for an AVI file. The bytes are a RIFF container with form type AVI.

What .avi is

AVI is a RIFF file. It starts with RIFF and the form type AVI , with a trailing space in the fourcc. A hdrl list holds the main header and stream headers. movi holds the chunks. idx1, when present, is an index that makes seeking possible. Codecs are FourCCs such as MJPG, H264, or a vendor code a browser has never heard of. The type nginx and Apache ship is video/x-msvideo. IANA's historic WAVE and AVI registry, RFC 2361, talks about video/vnd.avi; codec=XXX. That is not the header a typical download client is matching.

Servers send video/x-msvideo for AVI. RFC 2361's historic registry uses video/vnd.avi with a codec parameter. The current IANA media-type list does not register video/x-msvideo. The media type is video/x-msvideo. Extensions that use it on this page: .avi. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.

What sends video/x-msvideo

What sends video/x-msvideo: Send video/x-msvideo for a .avi download. Do not expect a video element to play it. Transcode to video/mp4 or video/webm for playback and keep AVI only if a tool asked for it. The file can contain multiple streams, including audio. The type does not list them. If you need the client to know the codec, say it in your API, not by inventing a parameter on video/x-msvideo. Enable ranges for large masters. Do not add a charset. The file on disk is still .avi. Once the response exists, a client trusts video/x-msvideo, not the filename. Treat AVI as an interchange format for older tools, not as a web playback format. When you transcode, delete or unlink the public AVI URL if it was temporary. A CDN will keep serving video/x-msvideo from cache after you change the origin unless you version the path.

Content-Type for .avi

Send video/x-msvideo and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.

Content-TypeContent-Type: video/x-msvideo

nginx, Apache, and Express

These snippets map .avi to video/x-msvideo. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .avi so a stale mime database in the framework cannot disagree with the type on this page.

nginx# /etc/nginx/mime.types, inside the types { } block
video/x-msvideo             avi;
ApacheAddType video/x-msvideo .avi
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".avi")) {
      res.setHeader("Content-Type", "video/x-msvideo");
    }
  },
}));

Pitfalls for video/x-msvideo

Pitfalls that show up for video/x-msvideo, and not for a neighboring type with a similar extension: An OpenDML AVI larger than 2 GB uses an AVIX list and a different index. A reader that stops at the first RIFF size reports a truncated file. Another trap is a missing idx1, which forces a linear scan to seek. A third is serving AVI as video/mp4 because the pipeline 'always outputs MP4' and this job did not. Check RIFF versus ftyp. A fourth is an uncompressed AVI that fills the disk. Reject or transcode at upload if the codec FourCC is a raw format you do not intend to store.

  • video/avi and video/msvideo are unofficial spellings. The types file value is video/x-msvideo.
  • video/vnd.avi is the historic registry form. Browsers are not looking for it on a .avi URL.
  • A file that starts with RIFF....AVI is AVI even if someone named it .mp4.
  • Interleaving of audio and video chunks is a property of the file. The type does not fix a file that puts all the audio at the end.

Frequently asked questions

Which Content-Type should a .avi response use?

video/x-msvideo, which is what the major static servers map. It is not in the current IANA media-type list. video/vnd.avi is the historic RFC 2361 form.

What is the signature?

RIFF at offset 0 and AVI at offset 8.

Will browsers play it?

Almost never for arbitrary codecs. Transcode to video/mp4 or video/webm for a video element.

Is AVI limited to 2 GB?

Classic AVI index fields are. OpenDML extends the format. Either way the type is video/x-msvideo.