Click or drag to resize

Recording Videos

Insight3D can record videos, either as a video file or as individual frames as separate image files.

Recording Videos

The CameraVideoRecording type records WMV videos. An instance of this type can be obtained from the CameraVideoRecording property. To begin recording, call the StartRecording(String, Int32, Int32) method. Each time the scene is rendered, such as through animation or by moving the mouse, a frame is sent to the WMV file.

This method takes the filename to save to, as well as two other parameters: video bit rate and the video frame rate. The video bit rate defines the video's bit rate in kilobits per second, i.e. the number of bits each second of video playback uses. A higher bit rate results in better image quality than a lower bit rate, but the higher bit rate file will be larger than the lower.

The video frame rate is in frames per second and is independent of the frame rate you experience with the application. For example, if the video frame rate is set to 30 and the application is rendering 300 frames per second to the WMV file, the WMV file will still play back at 30 frames per second.

The following example shows how to start and stop recording a WMV file:

C#
CameraVideoRecording recording = Scene.Camera.VideoRecording;
recording.StartRecording(directory, wmvFilename, CameraVideoFormat.WMV, 5000, 30);
// ...
recording.StopRecording();

The following example records a WMV file while animating:

C#
CameraVideoRecording recording = Scene.Camera.VideoRecording;
recording.StartRecording(directory, wmvFilename, CameraVideoFormat.H264, 5000, 30);
AnimationPlayForward();
// ...
AnimationPause();
recording.StopRecording();
Tip Tip

When making videos with high resolution terrain and imagery Globe Overlays, set PreloadTerrainAndImagery to true to ensure the correct resolution terrain and imagery is loaded for each frame in the video.

Recording Frame Stacks

The StartRecording(String, String, CameraSnapshotFileFormat, Int32, Int32) method begins recording a frame stack. With frame stacks, every rendered frame is saved to a separate image file. One would do this to record each raw uncompressed frame for use in a movie editor where the frames can be edited and output in any movie format at whatever compression.

The following code sample demonstrates frame stack recording:

C#
CameraVideoRecording recording = Scene.Camera.VideoRecording;
recording.StartRecording(frameStackDirectory, frameStackPrefix, CameraSnapshotFileFormat.Jpeg, 0, 2);
// ...
recording.StopRecording();

The frames can be saved in several different image formats, indicated by the CameraSnapshotFileFormat parameter. Each filename is made up of a prefix followed by a number defined in the method's input parameters. In the above example, each saved JPG file's name begins with frame_ followed by a 2 digit number beginning with 0. Make sure that the number of frame digits is large enough such that filenames do not repeat and overwrite each other.