Why am I unable to read my AVI file in 64-bit MATLAB on a 64-bit version of Windows XP, Windows Vista or Windows 7?

17 views (last 30 days)
I created an AVI file using with a specific codec (for example, Cinepak codec) compression in 32-bit MATLAB. When I try to read it using AVIREAD in 64-bit MATLAB on the same computer, I receive the following error message:
??? Error using ==> readavi
Unable to locate decompressor to decompress video stream
I also receive a similar error when using ADDFRAME while adding frames to AVI files with this codec in 64-bit MATLAB. However, I am able to play this file using Windows Media Player on the same computer.
Also, when I try to use MMREADER on the file with XVID codec on 64 bit MATLAB, I get the following error:
??? Initialization failed. (No combination of intermediate filters could be found to make the
connection.)
Error in ==> mmreader.mmreader>mmreader.init at 364
obj.MMReaderImpl = audiovideo.mmreader(fullName);
Error in ==> mmreader.mmreader>mmreader.mmreader at 133
obj.init(fileName);
MMREADER works fine with this file on the 32 bit MATLAB and plays on the Windows Media Player on the same computer.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Jan 2010
There are 32-bit codec libraries and 64-bit codec libraries. The 32-bit libraries are used by 32-bit applications, like MATLAB in 32-bit mode, and the 64-bit libraries are used by 64-bit applications, like the 64-bit MATLAB the user seems to be running. A video file created in each version can be played on any other system (using Windows Media Player on another computer, for example) so long as the player has access to corresponding 32-bit or 64-bit codecs on their system.
This error message occurs when the required codec to read the given AVI file is not installed in the computer. For example, the Cinepak codec iccvid.dll is only available as a 32-bit distribution. Hence, only 32-bit MATLAB and other 32-bit applications can play or create AVI files with Cinepak compression.
In this case, the user is not able to find the appropriate codec with the compression code because the 64-bit operating system may have a 32-bit codec while the 64-bit MATLAB application tries to locate a 64-bit codec library.
To work around this, here are two options.
1. Use 32-bit MATLAB instead of 64-bit. This will be able to find the codecs listed under %SYSTEMROOT%\system32 and generally meet user expectations in terms of ease-of-operability in creating compressed AVI files.
The workaround is to create the AVI file with a codec whose 64-bit version is available and installed on the computer, so that it can played using 64-bit MATLAB.
The disadvantage with this approach, of course, has to do with the limitations of using any 32-bit application, and having to install a separate version of MATLAB.
2. First create an uncompressed AVI file using 64-bit MATLAB, as is. Then, use an open source third-party tool like VirtualDub programatically or interactively to compress the AVI file. VirtualDub's strong suite is codec development and has access to a number of implementations of popular codecs, like MPEG-4:
<http://www.virtualdub.org/>
In general, if similar error messages are obtained when using any codec, the following checks are recommended.
1. Check if the appropriate codec is installed on the computer i.e. if the driver (.DLL files) corresponding to the codec is available on the machine.
It should be noted that, in a Windows 64-bit XP machine, a list of the installed 32-bit codecs can be found in:
%SYSTEMROOT%\syswow64
while a list of 64-bit CODECs can be found in:
%SYSTEMROOT%\system32
  • To emphasize, even though the "system32" suffix seems to imply 32-bit, this is where Windows stores 64-bit binaries as indicated by the link below:
<http://www.microsoft.com/windowsxp/using/64bit/russel_x64faq.mspx>
[Excerpt]:
Q. What is the SysWOW64 directory?
A. The \Windows\SysWOW64 directory is where 32-bit system files are installed. 64-bit system files are in the \Windows\system32 directory for compatibility reasons.
In 64-bit Windows machines, a list of the installed 64-bit CODECs are also listed out in the Windows System Tools utility:
(Start button=> Programs=> Accessories => System tools =>System Information => Components => Multimedia => Video Codecs)
2. Test if the other media players that can play the file are 32-bit or 64-bit versions. For Windows Media Player, this can be tested from the location of the executable file wmplayer.exe.
For Windows Media Player 11, the file wmplayer.exe for 32 and 64-bit versions are located in the folders %ProgramFiles (x86)%/Windows Media Player and %ProgramFiles%/Windows Media Player respectively. If you have both the distributions installed, you can specifically launch the file wmplayer.exe from each of the locations specified above to test this.
See the Related Solution listed below for reading or creating AVI files with Indeo5 codec or using the default compression mode in 64-bit MATLAB in Windows machines.

More Answers (0)

Categories

Find more on Install Products in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!