This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Mathematica Import/Export Format

AVI (.avi)

Registered MIME type: video/avi
Microsoft AVI format.
Multimedia container format.
Commonly used for archiving and exchanging video content.
Stores audio and video content in a format suitable for synchronous playback.
AVI is an acronym for Audio Video Interleave.
Binary format.
Supports a variety of audio and video codecs as well as uncompressed video frames.
Introduced in 1992 by Microsoft.
  • Export generates uncompressed RGB frames, using a color resolution of 8 bits per channel.
  • Import["file.avi"] imports an AVI file and returns by default a list of frame indices.
  • Export["file.avi", list] exports a list of graphics or a list of arbitrary expressions, taking each element to be an animation frame.
  • Export["file.avi", {expr1, expr2, ...}] exports a list of arbitrary expressions to AVI.
  • When exporting a list {expr1,expr2,...}, the animation is composed from frames corresponding to rasterized images of the expri.
  • The exported AVI video will play at the same speed and will have the same size as the Manipulate object.
  • Import["file.avi", elem] imports the specified element from an AVI file.
  • Import["file.avi", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.avi", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "AVI"] or Import["file", {"AVI", elem, ...}].
  • Export["file.avi", expr, elem] creates an AVI file by treating expr as specifying element elem.
  • Export["file.avi", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file.avi", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.avi", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Animation"animated AVI represented as an animation object
"Data"array of raw bitmap data for each frame
"GraphicsList"frames of an animated AVI as a list of graphics
  • Accessing individual frames:
"Frames"list of integers used to reference individual frames
"Frames",nthe n^(th) frame
  • Import by default uses the "Frames" element for the AVI format.
  • Metainformation elements available for Import:
"BitDepth"bits used to represent each color channel in the file
"ColorSpace"color encoding used in the file
"Duration"animation length in seconds
"FrameCount"number of frames in the file
"FrameRate"number of frames to be displayed per second
"ImageSize"raster dimensions
"VideoEncoding"video codec used in the file
  • Import["file.avi", "VideoEncoding"] gives one of the following codecs: "YUV", "H261", "H263", "JPEG", "Uncompressed", "Cinepak", "MotionJPEG".
  • General options:
BackgroundWhitecolor of area padded around the exported animation
ImageSizeAutomaticpixel dimensions of the animated object
  • With the setting ImageSize -> Automatic, Export will create frames whose pixel dimensions are multiples of 4 as required by common AVI player applications.
"FrameRate"15number of frames to be displayed per second