AVI (.avi)

  • Import and Export support the AVI standard.
  • Export generates uncompressed RGB frames, using a color resolution of 8 bits per channel.

BackgroundBackground

    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.

Import and ExportImport and Export

  • Import["file.avi"] imports an AVI file and returns a list of frame indices.
  • Export["file.avi",list] exports a list of graphics, images, or arbitrary expressions, taking each element to be an animation frame.
  • Export can convert Manipulate, Animate, and ListAnimate expressions to the AVI format.
  • Export["file.avi",{expr1,expr2,}] exports a list of arbitrary expressions to AVI.
  • When exporting a list , the animation is composed from frames corresponding to rasterized images of the .
  • Export["file.avi",Manipulate[]] exports an animated demonstration of a Manipulate object to an AVI file.
  • The exported AVI video will play at the same speed and will have the same size as the Manipulate object.
  • Export["file.avi",ListAnimate[]] exports a ListAnimate object as an AVI video.
  • 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 as specifying the corresponding .
  • 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.
  • ImportString and ExportString support the AVI format.

ElementsElements

  • General Import elements:
  • "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"animation object
    "Data"array of raw bitmap data for each frame
    "Frames"list of integer indices representing the sequence of still pictures in the file
    "Frames",nthe n^(th) frame
    "GraphicsList"frames represented as a list of graphics objects
    "ImageList"frames represented as a list of images
    "ImageList",nthe n^(th) frame as an image
    "ImageList",{n1,n2,}multiple frames
  • Import by default uses the element.
  • Meta-information 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
  • gives a list of video codecs available on your computer system.
  • Commonly available codecs include , ,, "JPEG", , , and .

OptionsOptions

  • 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.
  • Advanced Export option:
  • "FrameRate"15number of frames to be displayed per second

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Export a sequence of images to AVI:

In[1]:=
Click for copyable input
Out[1]=

Import metadata:

In[1]:=
Click for copyable input
Out[1]=

This gives a list of integer indices which can be used to reference individual frames:

In[1]:=
Click for copyable input
Out[1]=

Import frames 5 and 6:

In[1]:=
Click for copyable input
Out[1]=

Import the entire AVI file as an animation object:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2003
(5.0)
| Updated in 2010
(8.0)