AGI Components with Insight3D Alpha 2008 r8
Recording Videos
Topic Description
Recording Videos Videos can be recorded as .wmv files.
Recording Frame Stacks Frame stacks save each frame of animation in a separate image file.
Anti-aliasing Anti-aliasing can be used to smooth sharp edges.
Motion Blur Motion blur makes objects in motion appear to blur as they move.
Recording Videos

Use the camera's VideoRecording interface to record videos. Set the FileFormat to CameraRecordingFormatWMV and set an OutputDirectory for the .wmv file. Then call StartRecording so each time the scene is rendered a frame is added to the video. This is shown in the following example.

CopyC#
IAgGxCameraVideoRecording recording = scene.Camera.VideoRecording;
recording.FileFormat = AgGxCameraRecordingFormat.CameraRecordingFormatWMV;
recording.OutputDirectory = @"c:\videos";
recording.StartRecording();
// ...
recording.StopRecording();

The .wmv file is written to the output directory with the filename specified by FilePrefix.

A frame is added to the video every time the scene is rendered. This may be in response to mouse movement, an animation cycle, or an explicit redraw. The following example records a video during animation.

CopyC#
IAgGxCameraVideoRecording recording = scene.Camera.VideoRecording;

recording.StartRecording();
win3D.AnimationPlayForward();
// ...
win3D.AnimationPause();
recording.StopRecording();

The frame rate of the video is independent of the rendering speed, e.g. it doesn't matter how fast the scene animates on a particular computer. Instead, the frame rate is defined in by the VideoFrameRate property, in frames per second. One second in the video is composed of VideoFrameRate frames. The default is 30.

The VideoBitRate property defines the video's bitrate in kilobits per second. This number directly translates to how many bits are used by each second of video playback. Changing this allows you to trade-off image quality for file size and vice versa. Lower bitrates offer smaller file size but less image quality while a higher bitrate offers the opposite.

Tip: When making videos with high resolution globe inlay imagery, set PreloadTextures to true to ensure the correct resolution imagery is loaded for each frame in the video.
Recording Frame Stacks

With frame stacks, every frame of animation is saved to a separate image file in the OutputDirectory. The image format is defined by FileFormat, which must be set to something other than CameraRecordingFormatWMV to record a frame stack. Each image has a filename starting with FilePrefix, followed by a number, defined by FrameNumberStart and FrameNumberDigits. The following example shows how to set these properties to record a frame stack.

CopyC#
IAgGxCameraVideoRecording recording = scene.Camera.VideoRecording;

recording.FileFormat = AgGxCameraRecordingFormat.CameraRecordingFormatJPEG;
recording.OutputDirectory = @"c:\framestack";
recording.FilePrefix = "frame_";
recording.FrameNumberDigits = 2;
recording.FrameNumberStart = 0;

recording.StartRecording();
// ...
recording.StopRecording();

This example saves images in the c:\framestack directory. The first frame is named frame_00.jpg, the second is frame_01.jpg, and so on. Make sure to set FrameNumberDigits large enough so filenames do not repeat and overwrite existing ones.

Anti-aliasing
Anti-aliasing is used to smooth sharp edges. The video recording AntiAliasing property works the same as it does for snapshots, as described in the snapshot overview.
Motion Blur

Motion blur blurs successive frames in a recording. To add motion blur to a recording, enable anti-aliasing, and then set the MotionBlur and MotionBlurLength properties, as demonstrated below.

CopyC#
IAgGxCameraVideoRecording recording = scene.Camera.VideoRecording;
recording.AntiAliasing = AgGxCameraRecordingAntiAliasing.CameraRecordingAntiAliasing4x4;
recording.MotionBlur = true;
recording.MotionBlurLength = 0.5;
recording.StartRecording();
// ...
recording.StopRecording();

MotionBlurLength must be in the interval (0.0, 1.0], where 1.0 is the highest blur possible.