AVI Reader

Authors: Michael Schmid, Daniel Marsh and Jesper Søndergaard Pedersen
Source: AVI_Reader.java
Installation: Download AVI_Reader.class to the plugins/Input-Output folder and restart ImageJ. This plugin patches the plugin built into ImageJ 1.41b, supporting large AVI files through basic support for the OpenDML extensions.
Description: This plugin opens uncompressed 8-bit and 24-bit AVI movies as a stack. The latest version, patched by Jesper Søndergaard Pedersern, adds support for large (>2GB) files containing the AVIX extended tags allowed in the OpenDML extension. By reading indexes to frames rather than scanning through the file to find them, virtual stacks are loaded in a fraction of the time of the original plugin.

PC users can use the free VirtualDub program to uncompress AVI files. Macintosh users can use QuickTime Pro to convert QuickTime movies into uncompressed AVI movies. Note that AVI files with audio tracks may fail to open. Install the HandleExtraFileTypes plugin and you will be able to open AVI movies with a ".avi" extension using File/Open or by using drag and drop.

Another way to open an AVI movie in ImageJ is to use VirtualDub (Windows only) to convert it to an image sequence and then open the sequence using ImageJ's File/Import/Image Sequence command. To create a sequence in VirtualDub, use the File/Save image sequence command, set "Minimum number of digits in name" to 3 or more, and check "Windows BMP" as the "Output format".

On Windows, the Video Capture Tool macro can capture and display video using the VirtualDub program.

  • Only a few formats are supported:
    • Uncompressed 8 bit with palette (LUT)
    • Uncompressed 8 & 16 bit grayscale
    • Uncompressed 24 & 32 bit RGB (alpha channel ignored)
    • Uncompressed 32 bit AYUV (alpha channel ignored)
    • Various YUV 4:2:2 compressed formats
    • PNG or JPEG-encoded individual frames. Note that most MJPG (motion-JPEG) formats are not read correctly.
  • Does not read AVI formats with more than one frame per chunk
  • Palette changes during the video not supported
  • Out-of-sequence frames (sequence given by index) not supported
  • Different frame sizes in one file (rcFrame) not supported
  • Conversion of (A)YUV formats to grayscale is non-standard:
      All 255 levels are kept as in the input (i.e. the full dynamic range of data from a frame grabber is preserved). For standard behavior, use "Brightness&Contrast", Press "Set", enter "Min." 16, "Max." 235, and press "Apply".
History: 2002/07/11: First version
2002/07/16: Opens 8-bit movies faster
2002/10/02: Bug fixes
2004/07/18: Better "this is not an AVI" error message
2005/01/24: Open AVI files using File/Open or drag and drop
2005/02/14: Uses file name as window title instead of "stack"
2005/10/20: Opens 32-bit (ARGB) AVIs
2007/10/19: Fixed bug that could cause "Map size(0)>=1" error; fixed progress bar
  • Support for several other formats added, especially some YUV (also named YCbCr) formats
  • Uneven chunk sizes fixed
  • Negative biHeight fixed
  • Audio or second video stream don't cause a problem
  • Can read part of a file (specify start & end frame numbers)
  • Can convert YUV and RGB to grayscale (does not convert 8-bit with palette)
  • Can flip vertically
  • Can create a virtual stack
  • Added slice label: time of the frame in the movie
  • Added a public method 'getStack' that does not create an image window
  • More compact code, especially for reading the header (rewritten)
  • In the code, bitmapinfo items have their canonical names 2008-06-08:
  • Support for PNG and JPEG/MJPG encoded files added
  • Retrieves animation speed from image frame rate
  • Exception handling without multiple error messages 2008/07/07:
  • Adds support for 16-bit grayscale AVIs created by MIL (Matrox Imaging Library), thanks to a patch by Reinhard Mayr
  • 2009/03/29: Added support for large (>2GB) AVI containing AVIX chunks
  • Reads frame indexes using the indx and idx1 chunks speeding up loading of virtual stacks
  • See Also: AVI Writer plugin
    Video Capture Tool macro
    LOCI Bio-Formats plugin for reading and writing image file formats

    |Plugins | Home |