How to record avi movies from games
Recording movies can be lots of fun.
There are two ways to record a movie, either you use a hardware based solution to record your movies, like tv-out connected to an external recorder, or you use software.
The benefits of hardware recording is that you can get higher quality, mainly because of the higher frame rate available to you.
Unfortunatly I do not have any fancy hardware, so this howto will explain software recording, and a few tricks that can make it look better.
This is the system I use.
- 733MHz Pentium III, 512Mb SDRAM
- Two harddrives, IBM and Seagate (7200rpm)
- Geforce 256 with 32Mb
As you can see you do not need a state of the art computer to record movies.
Using a secondary harddisk to store the files can help you reduce lag but is not necessary, the avi files are stored uncompressed and consume about 300Mb per minute, so make sure you have alot of available disk space.
Software you will need
Fraps is a program that captures the raw screen data to file.
The reason the files become so large is that there is no time to compress it during run time.
Below is a screenshot of how Fraps looks.
It only records 640x480 so if you use a higher resolution only the upper left portion of the screen will be recorded.
Fraps displays the framerate while not active in a corner of your choice, and REC when recording.

A problem with slower systems like mine is that when you have complex scenes the computer is not be fast enough to record at 10 fps.
You might end up with seven frames stored per second, which will result in a speedup of the animation when they are played back at 10 fps.
Fortunatly for us the framerate can be adjusted in post processing.
The only real problem is when we alternate between simple and complex scenes in one shot, because then the framerate is not constant, and you have to select an average fps.
Fun Matrix effects can also be done this way.
Total Recorder both lets you record audio in the game, and convert mp3 files to wav format, so it can be used in the movies.
Sine you record audio and video separatly you will have to syncronize the two.
If your framerate is very unstable, you might prefer just to use some music instead of the game audio.
A good song sets the theme for your movie and can enhance the experience for the viewer.

Unfortunatly Virtual Dub does not support mp3 files, so you have to save them as wav, select PCM and choose the frequency you want.
If you want to save some extra size on your finnished movie, then save the sound as mono otherwise stereo is nice to have.
Always have the size in the back of your head.
The larger file, the longer it will take to download and thus fewer people will view it.

Virtual Dub is your friend.
It will let you edit your movies and then compress them, so that they can be used on the web.
You can merge clips by using Append AVI segment under the File menu.
The two buttons at the bottom right lets you select an intervall that can be deleted or manipulated.

An important concept that needs to be explained are the keyframes.
Basically a keyframe is a complete image of the screen that is saved.
In between keyframes the movement is stored as the changes in the current image.
A new scene always starts with a keyframe.
Keyframes are inserted when there are alot of changes in the current frame, they are also used to allow the user to quickly jump in the movie, since then the program only has to decode from the closest keyframe and up to the selected frame, instead of from the beginning of the movie.

You can change the Codec settings in Compression under Video, the default settings for DivX are usually good.
If you want to experiment then click on Configure and it will take you to the DivX codec properties, there on the Profiles page, uncheck the box marked "1 - Choose your profile", that will give you more freedome to specify the parameters you want.
Then under the page Bitrate Control set Variable bitrate mode to 1-pass quality-based and move the Quantizer in the 75-95% range.
Same principle here as with jpeg compression, when moving from 99% to 100% you get little gain in quality for alot of increase in filesize, whereas decreasing quality from 75% to 74% will just give you a small reduction in size but will usually look alot worse.
After setting video quality we want to set the compression for our audio.
It defaults to streaming mode, which means that Virtual Dub just writes the data raw to the avi file, you probably want to change it to full processing mode, which is done in the Audio menu. This will let you can convert the audio to the frequency you want and then compress it with MPEG Layer-3 (mp3).

Note that you might have to convert the audio to the right format, for instance if you have 44kHz stereo (cd quality) in the wav file and want to store it at 22kHz in the avi file then you need to use Conversion.
If Conversion is greyed out and Filters is active then uncheck the Use advanced filtering to get access to the conversion tools.

You dont want to save the sound uncompressed, that is bytes wasted that could have been used to improve image qualty.
Stereo 22kHz, 16-bits sound is good.
Ofcourse dont use stereo if there is just one sound channel or if you can do just as well with mono sound.
If you want to make a really small file consider lowering the frequency to 11kHz, that will roughly half the size, switching to mono halves it again.
But normally it is the video that takes up the biggest portion of the file data.
Another important thing is to cut away the uninterresting or unwanted parts of the video.
Here is an scene from the Caul Recall Quest, we are only interrested in the picture of the Virindi. Compare the left and right images.

To do this we use the Filter menu under Video where you can manipulate the scene by adding different filters.
The first thing we do is add a null transform that will let us crop the screen.
Then we apply a resize filter to get the right size. When resizing try to keep the same aspect ratio, i.e. the quotinent width/height should remain the same, otherwise the image will become stretched.

We got a little ahead of ourselves earlier, when we talked about compression formats for audio, but did not mention how to add sound.
Under Audio select WAV audio and pick the file you want.
If the music starts to late or early then you can adjust that under Interleaving.
Another neat trick is to match video and audio length to make them both end at the same time.
Under Video you will find Frame Rate.

A few examples of videos can be found on my Movie page.
Good luck!
Nakamuro Zataki, April 20th 2003
Read the AC Recording Tips!
Back to Movie Index
|