How to export an ArcMap animation as a QuickTime video file


This sample illustrates how to export an animation to a QuickTime video. The QuickTime player must be installed on your computer, which can be downloaded from www.apple.com/quicktime.

How to use

  1. Open an ArcMap document;
  2. Create one or more animation tracks in ArcMap using the animation toolbar (any type of animation is good);
  3. Copy and paste the following code into the VB editor in ArcMap, and change the export path to your own path;
  4. Make sure that "ESRI Animation Object Library" and "ESRI AnimationUI Object Library" are checked in the References dialog box of the VBA project;
  5. Run the macro "Export_Animation_QT";
  6. Verify that a QuickTime video file is created by playing it in the QuickTime player.
[VBA]
Public Sub Export_Animation_QT()
    'Find the animation extension
    Dim pUID As New UID
    pUID.Value = "esriAnimation.AnimationExtension"
    Dim pAnimExt As IAnimationExtension
    Set pAnimExt = Application.FindExtensionByCLSID(pUID)
    
    'Create an instance of videoexporter
    Dim pVideoExporter As IVideoExporter
    Set pVideoExporter = New AnimationExporterQT
    'Get statusbar from application
    Dim pStatusBar As IStatusBar
    Set pStatusBar = Application.StatusBar
    
    'Set animation exporter properties
    pVideoExporter.ExportFileName = "C:\Temp\VideoExp.mov"
    pVideoExporter.ShowSettingsDialog = False
    pVideoExporter.Codec = "8BPS:Planar RGB"
    pVideoExporter.FrameRate = 30
    pAnimExt.AnimationEnvironment.AnimationDuration = 5
    
    'Export animation
    pVideoExporter.ExportAnimation pAnimExt.AnimationTracks, pAnimExt.AnimationEnvironment, pStatusBar
    
End Sub