What is a .AVI file?
AVI refers to Audio Video Interleaving, Microsoft's multimedia container format released with Video for Windows in 1992. Audio Video Interleaving can include one or several synchronized streams, often video and audio but can include compressed and uncompressed video, MJPEG (motion JPEG), DV, DivX, Xvid, MPEG-4 ASP, or similar codecs. Audio Video Interleave names the container, not the compression, but common audio formats such as PCM, MP3, and AC-3 are also sometimes used.
AVI format can still be found today in older models of camcorders and screen capture software programs, security DVR (digital video recorder) footage export files and Windows legacy processes, and downloaded archived DivX/Xvid clips. The major type of AVI is OpenDML AVI (known as AVI 2.0), which still utilizes the AVI extension, and additionally introduces indexes and structures to support huge-size files.
Since Classic AVI files and Open DML AVI files share the same signature 'RIFF' it becomes impossible to differentiate between these formats based just on extension, because both formats begin with RIFF identifier followed by AVI 'Form type', whereas OpenDML AVI relies on chunk 'odml' and Super indexes. Quick method to identify AVI files would be to check if the first four bytes '0-3' have 'RIFF' string and bytes '8-11' has 'AVI ' string as ASCII; many software applications mark that as RIFF (Little-endian) AVI. No significant current file format using ".avi" extension apart from mentioned RIFF formats is known nowadays; all .avi without RIFF identifier have to considered misnamed or hazardous.
How to open a .AVI file
Open a .AVI file on Windows
- 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
- 2 Double-click your .AVI file if you have an app for .avi files on your computer. In case it does not open, move on to step three.
- 3 Right-click your .AVI file -> select .
- 4 Choose VLC media player in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .avi files" and click OK.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Windows
- VLC media player open-source
- Windows Media Player free
- Movies & TV / Media Player for Windows free
- MPC-HC open-source
- Avidemux open-source
- HandBrake open-source
- Adobe Premiere Pro paid
- DaVinci Resolve freemium
Open a .AVI file on macOS
- 1 In the Finder app, locate your .AVI file.
- 2 Just double-click your .AVI file in order to automatically launch the program which is connected with it.
- 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select .
- 4 If it isn't in the list, choose and find the application manually.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for macOS
- VLC media player open-source
- Avidemux open-source
- HandBrake open-source
- Adobe Premiere Pro paid
- DaVinci Resolve freemium
- Kdenlive open-source
- QuickTime Player free
- FFmpeg open-source
Open a .AVI file on Linux
- 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
- 2 Double-click the file.
- 3 Or choose another program by right-clicking the file -> .
- 4 Install VLC media player (if it is not installed on your computer) from the software centre, repository or Flathub.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Linux
- VLC media player open-source
- Avidemux open-source
- HandBrake open-source
- DaVinci Resolve freemium
- Kdenlive open-source
- FFmpeg open-source
Open a .AVI file on Android
- 1 Launch Files or another file management app.
- 2 In Downloads, find the .AVI file and open it by tapping.
- 3 A list of apps capable of opening the file will be shown. Tap VLC media player and press Always to permanently connect the file type with this app.
- 4 No apps able to open this file? Download VLC media player from the Google Play Store.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Android
- VLC media player open-source
- MX Player freemium
Open a .AVI file on iPhone / iPad
- 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
- 2 Tap the .AVI file you want to open.
- 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
- 4 Touch and hold the file to get the context menu -> choose -> select VLC media player from the list of apps.
- 5 If there is no such option, download the app first from the App Store and then tap the document again.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for iPhone / iPad
- VLC media player open-source
- MX Player freemium
- Infuse freemium
Open a .AVI file online
- 1 Move to the online viewer at the top of this page.
- 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.
Still not opening? See common problems and fixes, or view it in your browser.
Programs for Online
- CloudConvert freemium
More details about opening .AVI files
To open such files on a Windows computer, you can first try starting either Windows Media Player or Microsoft Media Player. Both of these applications will work fine with many AVI files if the required DirectShow or Media Foundation codecs were installed on your machine already. However, if the file was extracted using an older DivX or Xvid format, a lightweight video player called MPC-HC could be the preferred Windows option, since it opens all the legacy MPEG-4 ASP format video streams well. If you have a Mac, you might want to test if AVI files open with a pre-installed QuickTime Player as long as it contains supported audio/video codecs. VLC Media Player seems to be the most universal application, that is, you should open your file in VLC in case you want it played no matter whether your operating system includes Windows, Mac OS, Linux, Android, or iOS.
If you have an old computer and the codec is very rare indeed, VLC and MX Player could help in opening the AVI files on Android and iOS. Some other solutions you might prefer if you need more options are FFmpeg (Linux command-line solution), ffplay utility for fast playing, Kdenlive (multimedia project and editing), Premiere Pro (timeline editing), DaVinci Resolve (a more advanced video processing tool), and, lastly, Avidemux or VirtualDub2 for filtering and basic edits. Try first if the AVI is a legitimate one to start with.
Technical details
As AVI is a binary RIFF structure, the first four bytes at offset 0 should be equal to ASCII string RIFF with hex values 52 49 46 46; the bytes at offset 4 through 7 from the start represent the file length as a 32-bit little endian number, and there should be four bytes with ID AVI (hex value 41 56 49 20). It's important to note that AVI file format structure consists of chunks of data, so the common structure starts with header and media-data lists - LISTs (called hdrl and movi), with idx1 chunk located somewhere at file end.
Header chunk called avih carries the main AVI header; in most cases it is a main part containing header structure of file, the other main chunks used by this file consist of stream lists called strl; each list has stream header (strh) and format chunk (strf). movi contains payload information, and there are some index blocks allowing to determine seekable position of chunk offset. This scheme was significantly changed with development of the OpenDML AVI specification 2.0 where additional RIFF structure elements (LIST chunks and their sub-chunks) are used.
Files may use different streams, that use FourCC tags to identify their codecs; for video streams there are such tags like DIB (without any encoding or compression), MJPG or Motion JPEG, DIVX or XVID (MPEG-4 ASP codecs). The audio streams use the similar wave structure with format tags for audio codecs (PCM or MP3). In other words, the lack of AVI specification about codecs means compatibility depends on the stream formats inside the .avi container. In classic RIFF format there are used only 32-bit fields to define file size and many technical features of that era. However, in the OpenDML AVI 2.0 format multiple RIFF structures help to extend its size. Sizes of AVI files greatly vary according to codecs and compression. Uncompressed AVI file could have great size, but it might be possible to create very compact file with the highly-compressible format. Large capture masters take tens or hundreds of GB; however metadata support in this format is pretty poor as compared to MKV or MP4, but RIFF INFO structure could be used to define Title, Artist, Software, Copyright, date or Comments of the file, etc.
How to convert .AVI files
To get widest compatibility for use on Web, mobile phone, TV, video sharing site - convert from AVI format to H.264 in container MP4 and use also AAC instead of other formats for audio. FFmpeg converts AVI format to other formats using same options each time without fail: ffmpeg -i input.avi -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 160k output.mp4
If your AVI file uses codecs supported by MP4, just remux using command line ffmpeg -i input.avi -c copy output.mp4. Remuxing is fast process, which transfers stream to container keeping codec settings, avoiding any processing.
In case if your archiving process demands uncommon codecs or more that one streams of sound and in case of rare AVI files - use MKV container. ffmpeg -i input.avi -c copy output.mkv
Also you can make an edit using MOV in combination with ProRes, which gives you intraframe video with predictable seeking, but this video file size will take up a lot of disk capacity comparing MP4. HandBrake GUI tool helps convert files (either AVI-to-MP4 or AVI-to-MKV conversion), though most cases of converting through this software are with changing format including video codec. Avidemux and VirtualDub2 could be useful when splitting lots of AVI files using only keyframes in conversion process.
Attention: In process of transcoding some metadata (like timecode, indexing, VBR timing of audio channels) and also subtitles and even exact packing may be removed while video and audio may stay as is.
| Convert to | Tool | Command / note |
|---|---|---|
| MP4 (H.264/AAC) | FFmpeg | ffmpeg -i input.avi -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 160k output.mp4 Best general-purpose conversion for browsers, phones, and streaming; re-encodes video and audio. |
| MP4 without re-encoding, when codecs are compatible | FFmpeg | ffmpeg -i input.avi -c copy output.mp4 Fast and lossless, but works only if the AVI streams are legal in MP4, such as many H.264/AAC combinations. |
| Matroska Video (.mkv) | FFmpeg | ffmpeg -i input.avi -c copy output.mkv Useful for preserving old MPEG-4, DivX, Xvid, PCM, or MP3 streams without quality loss in a modern container. |
| WebM (VP9/Opus) | FFmpeg | ffmpeg -i input.avi -c:v libvpx-vp9 -crf 32 -b:v 0 -c:a libopus output.webm Produces a web-friendly open format, but conversion is slow and lossy. |
| MOV | FFmpeg | ffmpeg -i input.avi -c:v prores_ks -profile:v 3 -c:a pcm_s16le output.mov Editing/interchange option for Apple and professional workflows; files are much larger. |
| Animated GIF | FFmpeg | ffmpeg -i input.avi -vf "fps=12,scale=640:-1:flags=lanczos" -loop 0 output.gif For short silent clips only; GIF discards audio and has limited color efficiency. |
Common problems and fixes
"Cannot render the file" or black screen implies that AVI container was read but the proper codec is not present. Play video in VLC and use MediaInfo/ffprobe to find out what streams it contains, namely the fourcc, what codec for audio, and the framerate. "Windows Media Player cannot play the file" In Windows system this message means an unsupported video codec, an unsupported audio codec, corrupted index or a broken/incomplete download of that file. The file has extension .avi, however, its data does not look like RIFF starting with 52 49 46 46, most likely this file was named incorrectly, truncated or just HTML page with video icons.
Seeking failure (seeking far ahead or back), wrong duration, or drifting of video-audio synchrony mean that there is something broken with index. To repair this, use remux with ffmpeg -i input.avi -c copy fixed.avi or create index with VirtualDub2/Avidemux (see more below). Very big legacy AVI can crash at 2/4 GB in ancient programs because those can work only with AVIs which do not follow Open DML standard (see above for details). Some .avi files encoded by certain software with variable bit rate mp3 have sync problems and warning in ancient editing software. Re-encode this files with audio codec PCM/aac or just open them with ffmpeg based program. Green or purple frame, inverted video, strange picture aspect ratio means old vfw codec, interlacing video, wrong field order and pixel aspec metadata problem. In OS X system QuickTime player rejects avi-files with DivX, Xvid or AC3 audio, therefore VLC or conversion to MP4 is common.
Security considerations
AVI files do not have macros in Office format, nor any other code for scripts that are executable but rather consist of a RIFF container that requires parsing by the media players and libraries of codecs. The security community has focused on this issue for many years now, as malformed structures, such as AVI header, RIFF chunk header, index OpenDML entries, and compressed video bitstream, have caused crashes of and security holes within players as well as packs of codecs. Avoid outdated installer files which claim to include the required “codecs” on websites. Information about the camera and the capturing software and author may be found through metadata, together with the date, copyrights of the content and comments. File managers may create thumbnails automatically from the AVI files, so it’s imperative to keep Windows and macOS media frameworks up-to-date with all security patches available.
History and versions
The AVI format made its appearance in 1992 with the Video for Windows project as a result of which Windows-based PCs became able to synchronize and view digital videos and audio tracks in a one file-container.
In other words, AVI is developed based on RIFF - container chunk-format developed by Microsoft and IBM that is also used to develop the Wave Format files; thus, AVI-file starts from 'RIFF' identifier 52 49 46 46, at zero offset.
During the 1990s AVI was actively promoted as the interchange and capture format for Windows as part of Video for Windows technologies and, then, as part of DirectShow. OpenDML AVI 2.0 has appeared in 1996 as part of the Open Digital Media effort as its goal was expanding capabilities of traditional AVI format in terms of size and index for long time usage. In the later years the most wide use was done for AVI-files as the carrier of compressed movie together with MP3 audio thanks to DivX and Xvid codecs. AVI format had never become standard ISO-containers like MP4 was; rather it gained its definition via specification by Microsoft and usage in the majority of software.
Related formats
AVI alternatives and related containers include:
- ".mp4" serves as a substitute for AVI for browsers, handheld and streaming systems and H.264, H.265, AAC, subtitles, and metadata.
- ".mkv" offers more flexible open container with support for different codecs and additional subtitles, chapters and audios tracks, yet it may suffer from unreliable support by Apple products or older televisions.
- ".mov": it is an apple QuickTime container, commonly used in post-production with additional time data compared to old AVI format.
- ".wmv" and its alternative variant ".asf" are Microsoft containers from era of streaming media, compatible with streaming Microsoft codecs rather than generic old AVI.
- ".dv" and similar ".mts"/".m2ts" formats are frequently used in work with camcorders - though AVI supports DV video formats it is better to stick with native formats (or containers as in case of AVCHD).
- ".webm" usually gives better compatibility with Web for delivering video with VP8, VP9 and AV1 codecs as opposed to AVI.
- ".mpg" and its variation ".mpeg" is used for playback of MPEG-1/MPEG-2 video including DVD or VCD era media.
Stick with AVI only if it comes to playback or archiving of existing legacy media in it.
No comments yet. Be the first to share your experience with this file type.