What Is AVI Format?
AVI stands for Audio Video Interleave. It’s a video file format developed by Microsoft in 1992 to store video and audio data in a single file. AVI files can be played back synchronously with audio and video. AVI files are native to all Microsoft Windows operating systems and can be opened using Windows Media Player.
AVI files are based on the Resource Interchange File Format (RIFF), a container format used to store multimedia data. They can store video and audio data encoded in various codecs, including DivX and XviD. AVI files often use the format extensions that Matrox OpenDML introduced in 1996. Microsoft supports these files, which are sometimes (unofficially) known as AVI 20.
AVI files are larger in size and may require compression to smaller file formats. In comparison, MP4 files are smaller in size and work with almost all media players, but have inferior video output quality. MP4 is the better file type for most use cases.
This is part of a series of articles about video format.
In this article:
- AVI RIFF File Structure
- What Is DV AVI?
- AVI File Format: Pros and Cons
- AVI vs MP4
- How Do You Convert AVI to MP4 Or WebM Format With Cloudinary?
How to Play an AVI File in Windows
To open an AVI file on Windows, you can:
- Double-click the video file.
- Right-click the file and select Windows Media Player from the “Open With” drop-down menu.
Windows Media Player provides basic functionality for AVI files, including playback control (pause, resume, stop), volume control, and a simple user interface to manage your media files.
Some AVI players for Windows include PlayerFab Ultra HD Player, DVDFab Player 5, VLC Player, KM Player, GOM Media Player, and RealPlayer. These players add more advanced functionality such as subtitle support, advanced playback controls, video and audio equalizers, multiple viewing modes, and the ability to handle a wide range of media file types.
How to Play an AVI File on MacOS
Here’s how you can play AVI files on macOS:
Using VLC Media Player:
- Download and install VLC Media Player from the official website.
- Open VLC Media Player.
- Drag and drop the AVI file into the application, or use the “Open File” option.
AVI RIFF File Structure
The AVI format is a Resource Interchange File Format (RIFF) specification for applications that record, play, and edit video and audio sequences. AVI files generally contain multiple data streams with various types of data. AVI sequences usually include a video stream and an audio stream. There is also a simple AVI sequence variation that only uses video data, without not an audio stream.
A four-character code (FOURCC) is an unsigned 32-bit integer made using four American Standard Code for Information Interchange (ASCII) characters. A FOURCC may include spaces as characters, so a code with three letters and a space is valid. The AVI format identifies details such as the type of stream, data chunk, and index entry using FOURCCs.
The structure of the AVI file format builds on the RIFF format used for documents. RIFF files consist of a header and (optionally) lists and data chunks.
RIFF headers typically have the form:
'RIFF' fileSize fileType (data)
In this context, RIFF refers to a FOURCC, the file size refers to a 4-byte value specifying the size of the file’s data, and the file type refers to another FOURCC identifying the type of file. The file size value includes the size of the file type FOURCC and the data following, but not the initial RIFF FOURCC or the size of the file size component. The data includes the lists and data chunks contained in the file in no particular order.
Chunks should use this form:
ckID ckSize ckData
The ckID component is a FOURCC identifying the data included in a chunk, while the ckSize component is a 4-byte value specifying the size of the chunk data. The chunk data (ckData) may contain zero bytes or more data. The data should always be padded to the closest WORD boundary. The chunk size component defines the size of the chunk’s valid data, not including the padding or the ID and size components.
AVI lists follow this form:
'LIST' listSize listType listData
LIST is a FOURCC, while the 4-byte list size component specifies the list’s size. The list type component is another FOURCC, and the list data component includes lists or chunks in no particular order. The list size value includes list type and data size but not the LIST FOURCC or the list size component.
It is possible to include optional elements in the RIFF chunks by placing them in brackets.
Cloudinary allows you to easily transform your videos on the fly to any required format, style and dimension, and apply effects and other visual enhancements. Supported formats include WMV, WebM, OGV, MXF, MPEG, MP4, among others.
What Codecs are Used with AVI Files?
The AVI format is codec-independent, meaning that it can use various codecs for compressing and decompressing video and audio data. A codec is software that compresses data to enable faster transmission and decompresses received data.
Some popular codecs used with AVI files include DivX, XviD, and MJPEG. DivX and XviD are both codecs that compress video data, allowing for smaller file sizes without a significant loss in quality. MJPEG, on the other hand, is a motion-JPEG codec, which is commonly used in video capture and editing applications.
It’s important to note that the same codec used to encode an AVI file must also be used to decode it. This means that if you want to play back an AVI file, you’ll need to have the right codec installed on the device. If you don’t, you may encounter errors or be unable to play the file.
What Is DV AVI?
A DV AVI file is an AVI with compressed video content that complies with the Digital Video (DV) standard. The two types of DV AVI files are:
- Type 1—an AVI file that keeps the multiplexed video and audio data stored together in the file’s video portion.
- Type 2—an AVI file that stores the audio data in a separate audio stream.
Ironically, the first type is the newer file type, but Microsoft chose to designate it as Type 1, while the older VfW-compatible version became Type 2. People often confuse these two file types because of the counterintuitive designations. From the late 1990s to the early 2000s, most professional-grade DV software and non-linear video editing programs only supported the Type 1 DV AVI format.
AVI File Format: Pros and Cons
Here are notable pros of the AVI file format:
- The AVI file format produces videos with high-quality audio fidelity.
- You can use AVI files to create playable discs and DVDs that store initial audio or video information.
- The AVI format includes compression capabilities ideal for promotions, advertising, and short films.
- Since Windows developed the AVI file format, it is playable on most Microsoft and non-Microsoft operating systems.
- There is no need to use specific hardware or software to run AVI files. This characteristic ensures many users can open videos distributed as AVI.
- AVI maintains high-quality master files, ensuring you can use these files to create various types of files.
Here are notable cons of the AVI file format:
- The original AVI specification does not allow encoding aspect ratio information. However, AVI 2.0 provides a standardized method for encoding this data.
- The different approaches to adding timecode to AVI files affect the format’s usability.
- Once you encode a video file in AVI, you cannot compress it with techniques requiring future frames data beyond the encoded B-frame.
- Using AVI files with variable bitrates (VBR) like MP3 audio is problematic at sample rates below 32 kHz.
- You need to hardcode subtitles into the video stream or distribute it in a separate file because the AVI files may not be able to accommodate attachments like subtitles and fonts.
AVI vs MP4
MP4 (MPEG-4 Part 14) is another format used to store video, audio, subtitles and images in one file. While AVI files are large and may require compression, MP4 files are smaller in size and work with almost all media players, but have inferior video output quality. MP4 is the better file type for most use cases.
Let’s explore the differences between AVI and MP4 in more detail.
Quality
When comparing AVI to MP4 in terms of quality, you should consider that both formats are video wrappers. AVI is associated with the DivX codec, while MP4 uses the MPEG-4 AVC/H.264 codec. Another difference is that AVI can store an alpha channel, meaning the format can provide a higher-quality output file, while MP4 cannot. MP4, unlike AVI, can use different compression codecs, ensuring higher performance efficiency with comparable quality.
In the bottom line, there is no noticeable difference between AVI video and MP4 video. However, AVI provides slightly higher video quality than MP4.
Related content: Read our guide to video codecs
Storage efficiency
The AVI video format compresses data less efficiently than other video formats such as MP4, MPEG, and MOV. The result is a huge file size of 2-3 GB per minute of video on average. This is a problem for users with limited storage space. However, AVI files can be compressed by converting them to other formats such as MOV, FLV or MP4. MP4 is a lossy format that has strong compression capabilities and uses much less storage space than AVI.
Compatibility
MP4 has another key advantage over AVI—it is compatible with most devices, while AVI might require specialized players to run.
In the bottom line, for almost all use cases, you will find that MP4 is a superior format to AVI. If visual quality is the only consideration, you might prefer AVI over MP4.
Related content: Read about another modern video format in our guide to WebM Format
How Do You Convert AVI to MP4 Or WebM Format With Cloudinary?
The AVI format is generally inferior to formats like MP4 and WebM. Cloudinary can help you automatically convert AVI files to modern video formats for faster loading, and an enhanced user experience.
Cloudinary performs the task in the cloud through automation in three steps:
- Convert AVI to MP4s or WebM through dynamic URLs.
- Resize, crop, and transform the videos generated in step 1.
- Optimize the transformed videos through a fast content delivery network (CDN).
The conversion capability is available in all Cloudinary plans, including the free tier. Do check it out.