This library contains helper functions to read image frames into Matlab from an AVI file using DirectShow on Windows. It hence,
a) does not suffer from the 2Gb file size limit of the VFW based Matlab aviread
b) handles most codecs installed on the system
c) has functions quite similar to aviread
*** Depending on your Matlab version, renaming the .mexw32 files to .dll may work.
*** Jose Ignacio Gomez Espinola has kindly shared his code and instructions to compile dxAvi for win64 (64 bit Windows) here,
*** If you wish to get the binaries directly and save a whole lot of hassle with building this library, please Google dxAvi, dxAvi_64 to obtain the pre-compiled files.
-- testDxAvi.m is a simple example.
The library usage is as follows,
[avi_hdl, avi_inf] = dxAviOpen(avi_filename);
pixmap = dxAviReadMex(avi_hdl, frame_num);
img = reshape(pixmap,[avi_inf.Height,avi_inf.Width,3]);
** If your avi file fails to open: in ffdshow configuration (ffdshow is available in Klite pack) set the decoder for the corresponding video format to "libavcodec".
*** dxAvi needs BaseClasses directory from "Direct X 9.0 SDK 2002" (Google should get you this), code here is based on GrabBitmaps.cpp in DirectShow samples.
*** dxAvi needs zlib.lib from the zlib-1.2.5 or more recent library.
*** It seems that recent versions of Windows no longer ship with the SampleGrabber DirectShow filter that dxAvi relies on to intercept data from the DirectShow video rendering graph. If your system is missing this filter you would need to install 'qedit.dll' also available in the precompiled library mentioned earlier in System32 and SYSWOW64 directories. To register this directshow filter, from windows command line execute:
On 32bit systems use:
On 64bit systems use:
Ashwin Thangali (2023). DirectShow (DirectX) based AVI file reader (https://www.mathworks.com/matlabcentral/fileexchange/9901-directshow-directx-based-avi-file-reader), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!