To develop computer vision applications which require video processing , the most important step is to read video frame by frame. OpenCV is great C++ API for such applications. OpenCV function cvQueryFrame can grab and return a frame from camera or file but it doesn’t support all video formats. DirectShow API is another option to perform frame capture but it is too complex for simple applications. Microsoft provides another relatively simple simple API for reading videos named AVIFile API. It contains set of powerful functions to read, create and edit AVI files. It is part of a larger API called VFW (Video for Windows). The VfW AVI support should use the same DirectShow facility with dynamically configurable filter/codec support in Windows. It means that if you get an avi file with unsupported encoding, installing the corresponding codec to Windows should make the application written with AVIFile API work immediately without any code change. Recently I developed a computer vision application to remove noise from low quality/resolution night videos using AVIFile API. I was unable to read H.264 videos in my application untill I installed H.264 codec using ffdshow.
There is very good C# Wrapper available for AVIFile functions on codeproject.
Information on AVI File Formats is available here.
The only drawback of AVIFile API is that the code is not portable and works only on windows in contrast to OpenCV which works on Linux as well.
Adnan Elahi Noon is a lecturer and member of COMVIS (Computer Vision Research Group) at COMSATS Lahore. He holds a masters degree in embedded digital systems from University of Sussex, United Kingdom.