MATLAB: Do I receive an error when using the AVIREAD function

aviinfoavireadcodecdecompressordvsdMATLABstreamvideo

When I use the AVIREAD function, I receive the following error:
??? Unable to locate decompressor to decompress video stream

Best Answer

Windows AVI files can be compressed using an infinite number of compression methods, depending on the application where the file originated. In MATLAB, you can only specify which compression method to use when writing the file, but not when reading. When reading, AVIREAD will figure out how to decompress the movie based on how it is compressed. It will use a codec that is installed on your machine; you cannot install codecs in MATLAB.
The compressors/decompressors (codecs) can be installed (as dll's) on Windows machines for media players/editors to use. During playback, the media player looks for the codec. If the player can not find the codec needed to decompress the video, an error occurs. This is what is happening in MATLAB. AVIREAD is making some Windows API calls to try and find the installed codec to decompress the video.
By using the AVIINFO function, you can determine the codec used to compress the file.
All codecs have a four character code (fourcc) to describe them. A list of fourcc's can be found at
You need to have the correct codec installed to view or load the movie. Contact the manufacturer of the codec to obtain the necessary codec files, or go to https://www.moviecodec.com/
Some customers have reported that some applications can open and play their AVI files, but MATLAB cannot because it is unable to locate the decompressor. Most likely the working application has methods to read the AVI even though the codec is not installed. To resolve this issue, use the information in this solution to install the appropriate codec.
This error is commonly encountered when trying to decompress a DVSD codec AVI file. Digital cameras commonly use this codec, and their software can read it without the codec. However, MATLAB requires the operating system to have this codec installed.