Module ij
Package ij.plugin.filter

# Class AVI_Writer

java.lang.Object
ij.plugin.filter.AVI_Writer

All Implemented Interfaces:
  `PlugInFilter`

public class AVI_Writer extends Object implements PlugInFilter
This plugin implements the File/Save As/AVI command. Supported formats: Uncompressed 8-bit (gray or indexed color), 24-bit (RGB), JPEG and PNG compression of individual frames 16-bit and 32-bit (float) images are converted to 8-bit The plugin is based on the FileAvi class written by William Gandler, part of Matthew J. McAuliffe's MIPAV program, available from http://mipav.cit.nih.gov/. 2008-06-05: Support for jpeg and png-compressed output and composite images by Michael Schmid. 2015-09-28: Writes AVI 2.0 if the file size would be above approx. 0.9 GB The AVI format written looks like this: RIFF AVI RIFF HEADER, AVI CHUNK | LIST hdrl MAIN AVI HEADER | | avih AVI HEADER | | LIST strl STREAM LIST(s) (One per stream) | | | strh STREAM HEADER (Required after above; fourcc type is 'vids' for video stream) | | | strf STREAM FORMAT (for video: BitMapInfo; may also contain palette) | | | strn STREAM NAME | | | indx MAIN 'AVI 2.0' INDEX of 'ix00' indices | LIST movi MOVIE DATA (maximum approx. 0.95 GB) | | 00db or 00dc FRAME (b=uncompressed, c=compressed) | | 00db or 00dc FRAME | | ... | | ix00 AVI 2.0-style index of frames within this 'movi' list RIFF AVIX Only if required by size (this is AVI 2.0 extension) | LIST movi MOVIE DATA (maximum approx. 0.95 GB) | | 00db or 00dc FRAME | | ... | | ix00 AVI 2.0-style index of frames within this 'movi' list RIFF AVIX further chunks, each approx 0.95 GB (AVI 2.0) ...

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`JPEG_COMPRESSION`
`static final int`
`NO_COMPRESSION`
`static final int`
`PNG_COMPRESSION`

### Fields inherited from interface ij.plugin.filter.PlugInFilter

`CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, NO_UNDO_RESET, PARALLELIZE_IMAGES, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING`

## Constructor Summary

Constructors
Constructor
Description
`AVI_Writer()`

## Method Summary

Modifier and Type
Method
Description
`void`
`run(ImageProcessor ip)`
Asks for the compression type and filename; then saves as AVI file
`int`
`setup(String arg, ImagePlus imp)`
This method is called once when the filter is loaded.
`void`
`writeImage(ImagePlus imp, String path, int compression, int jpegQuality)`
Writes an ImagePlus (stack) as AVI file.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NO_COMPRESSION

public static final int NO_COMPRESSION

See Also:
  - Constant Field Values

### JPEG_COMPRESSION

public static final int JPEG_COMPRESSION

See Also:
  - Constant Field Values

### PNG_COMPRESSION

public static final int PNG_COMPRESSION

See Also:
  - Constant Field Values

## Constructor Details

### AVI_Writer

public AVI_Writer()

## Method Details

### setup

public int setup(String arg, ImagePlus imp)
Description copied from interface: `PlugInFilter`
This method is called once when the filter is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt or in the plugins.config file of a jar archive containing the plugin. 'imp' is the currently active image. This method should return a flag word that specifies the filters capabilities.

For Plugin-filters specifying the `PlugInFilter.FINAL_PROCESSING` flag, the setup method will be called again, this time with arg = "final" after all other processing is done.

Specified by:
  `setup` in interface `PlugInFilter`

### run

public void run(ImageProcessor ip)
Asks for the compression type and filename; then saves as AVI file

Specified by:
  `run` in interface `PlugInFilter`

### writeImage

public void writeImage(ImagePlus imp, String path, int compression, int jpegQuality) throws IOException
Writes an ImagePlus (stack) as AVI file.

Throws:
  `IOException`