MATLAB: Do I get “Error using ==> aviinfo (errorWithFileClose)” when trying to import a file using AVIREAD with MATLAB 6.0 or 6.1

aviinfoavireadimportMATLAB

Why do I get the following error when trying to import a file using AVIREAD with MATLAB 6.0 (R12) or MATLAB 6.1 (R12.1)?
??? Error using ==> aviinfo (errorWithFileClose)
No video stream found.
Error in ==> D:\MATLAB6p1\toolbox\matlab\iofun\aviinfo.m
On line 191 ==> errorWithFileClose('No video stream found.',fid);
Error in ==> D:\MATLAB6p1\toolbox\matlab\iofun\aviread.m
On line 46 ==> info = aviinfo(filename,'Robust');
This file can be imported without a problem in other applications.

Best Answer

This problem has been fixed in MATLAB 6.5 (R13).
If you are using MATLAB 6.1 (R12.1) or an earlier version, see the information below.
This problem seems to have to do with the formatting of the particular AVI file. One solution is to import it into a third party .avi editing application and then export it again. If the formatting that was causing the problem is changed, then the file will be able to be imported into MATLAB.