Recording Motion Video

The digital video device supports real-time recording of motion video into AVI files. The supported compression algorithms for recording video are Ultimotion, Indeo 2.1, and Indeo 3.1. The default settings for real-time recording are 160 x 120 resolution, 15 frames per second, and Ultimotion compression type.

Recording into new and existing files is supported. The following example illustrates recording live video. As recording takes place, the digital audio and video data is stored in the temporary file created for the video device element. After the recording operation is complete, the device element is played back so it can be viewed before it is saved as a permanent file on disk.

To save the data as a video file, you can specify an existing file name or a new file name with the save command. If you indicate an existing file name, the data in the disk file is completely replaced by the data in the temporary file. You can also indicate that the file being saved is a video file; however, it is not necessary because this is the default.

In the example, monitoring is set on, so that the incoming video signal can be viewed in the default video window before it is recorded. Monitoring of live video can also be done without recording.

open digitalvideo alias myvideo wait
set myvideo time format frames wait
set myvideo monitor on wait
record myvideo to 99 wait
play myvideo wait
save myvideo newvid.avi video wait
close myvideo

Applications can specify that only video or only audio is to be recorded. In the following example, audio recording is turned off, so that only video will be recorded.

Specifying the cue input command causes the default window to become visible, so it is not necessary to set the monitoring function on. The cue command ensures the device is initialized and ready to record, preventing the possibility of losing any initial video when recording begins. As in the previous example, the device element is played back before it is saved as a file on disk.

open digitalvideo alias myvideo wait
set myvideo record audio off wait
set myvideo time format hms wait
cue myvideo input wait
record myvideo to 00:02:00 wait
play myvideo wait
save myvideo newvid.avi wait
close myvideo


[Back: Playing Animation Files]
[Next: Image Support]