A Directshow based AVI read interface for Matlab

Download

New: dxAvi_x64: dxAvi compiled for win64 (64 bit Windows) by Jose Ignacio Gomez Espinola.

New: NetAvi: win32 video server based AVI read interface for most Matlab platforms

This library contains helper functions to read image frames into Matlab from an AVI file using DirectShow on windows. For the Linux  version, check out mplayerMex.
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 (DV, DIVX, XVid, 3iVX, MPEG4 \u2026)
c) has functions quite similar to aviread

-- Depending on your 32-bit Matlab version, renaming the .mexw32 files to .dll may work.

-- Jose Ignacio Gomez Espinola has succesfully compiled dxAvi for win64, his compiled dxAvi_x64 library is available here.

-- 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]);
dxAviCloseMex(avi_hdl);
*** If your avi file fails to open: in ffdshow configuration (ffdshow is available in K-lite codec pack) set the decoder for your video format to "libavcodec".

*** 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:
 C:\WINDOWS\system32\regsvr32.exe System32\qedit.dll 
On 64bit systems use:
 C:\WINDOWS\system32\regsvr32.exe SYSWOW64\qedit.dll 

*** BaseClasses directory is from Direct X 9.0 SDK 2002 (Google should also get you this)
Code here is based on GrabBitmaps.cpp in DirectShow samples.

tvashwin | @ | cs | bu | edu

View My Stats