Choosing the Right Format, Codec, and Bitrate
When making movies from STK, choosing the right output format makes the difference between success and failure. Generally there are two main types of animations that come out of STK
- Raw Footage. If you have access to video editing software, you typically use STK to save out raw footage, a collection of video clips meant to be edited.
- Finished movie. If you do not plan to use video editing software, then animation you get from STK is likely to be the finished movie, and will need to be in a suitable form for distribution and playback.
Creating "Raw Footage" in STK
If the animations you create in STK are destined to be loaded into video editing software (Adobe Premiere, for example), then you will want to preserve the maximum image quality possible, and the ability to actually play back the footage outside of your editing suite is unimportant. To meet these requirements, you have two choices: uncompressed AVI, or a stack of frames (PNG, BMP, TGA, for example).
Uncompressed AVI
To make an uncompressed AVI, just pick AVI as the output format for SoftVTR, and when the codec dialog shows up, select Full Frames (Uncompressed).
This format is convenient because it fits in a single file, but there are some dangers here:
- Uncompressed AVIs can be large. There is a 2 gigabyte size limit, and unfortunately if the size of your AVI runs over this limit, the whole AVI file will become corrupt.
- Uncompressed AVIs do not play back smoothly on anybody's computer. These AVIs are only good for moving footage from STK to the editing suite.
- You must turn off SoftVTR when done recording. The AVI file is not complete, and not readable, until SoftVTR is turned off. You do not have to worry about this if you are using Clip Manager as it will turn it on and off for you.
Frame Stacks
Frame stacks are a bit more unwieldy than AVIs, because each frame of animation is saved to a separate file as a single image in a format such as PNG, BMP, TIF, or TGA. It is recommended that you create a separate directory for each frame stack, to keep things tidy.
The advantage here is that frame stacks are more robust than AVIs: they do not have the 2 GB limit, and if a few frames are corrupted you do not lose the entire animation.
The downside is that free tools like Windows Movie Maker don't always include support for importing frame stacks. You need a more high-end solution, such as Adobe Premiere, to be able to use them.
Creating a Finished Movie
You can create a finished movie from your video editing software, or directly from within STK.
Creating a Finished Movie from Your Video Editing Suite
Your video editing software may be able to save out your movie in a variety of different formats, such as AVI, MPG, Windows Media (WMV), and Quicktime. Any of these formats can be used for distributing your movie. MPG (version 1) typically provides the most compatibility. WMV requires a more modern machine for playback, but offers improved performance from a smaller file size. AGI currently uses WMV version 9 for high-definition videos.
If using AVI or WMV, you will need to select a codec. If using WMV or MPG, you will need to select a bitrate.
Creating a Finished Movie from within STK
If you are making the finished product directly from STK, you will need it to be in a format that is easy to distribute and will play back well on your audience's computers.
There are two choices for this in STK: AVI or Windows Media (WMV). Both of these choices will store your movie in a single, playable file. AVI is an older format suitable for older operating systems. WMV is a more modern format that works on newer operating systems. The next step is to choose a codec.
Choosing a Codec
The word codec is a shortening of the words compressor/decompressor. The term exists because neither WMV nor AVI files are required to be a particular compression format (unlike MPG, which uses MPG compression). Instead, WMV and AVI are both wrapper formats, for all kinds of video compression. When you create a WMV or AVI file, you must select a codec that will be used to compress your video and store it in the file.
Almost all versions of Microsoft Windows come pre-installed with certain popular codecs. One of the most popular codecs known to work well with STK is "Windows Media Video 9" for WMV files. This is the default choice in STK.
The next step is to select a bitrate.
Choosing a Bitrate
A bitrate is exactly what it says it is: The rate at which bits are consumed by video playback. Adjusting this rate will manage the trade-off between movie quality and file size.
Video compression is a strikingly flexible and fine-tuneable form of data compression. You can actually allocate a quantity of data, like a quota, that the video is authorized to use for each second of playback. The encoding software can then compress the data as much or as little as needed, in order to fill this quota.
The bitrate is commonly expressed in kbps, meaning kilobits per second, or sometimes as mbps, meaning megabits per second. The number you enter here directly translates to how many bits are used by each second of video playback. Using this value, you can precisely control the file size of your finished movie (trading image quality for file size as needed, and thus controlling image quality).
A concrete example may provide some clarity here. Let's say you have a 1.5-minute video, and you want to post it on a Web site as a 10 megabyte download. What bitrate should you use?
(10 megs * 1024 kb/mb * 8 bits/byte) / (1.5 mins * 60 sec/min) = ? kbps
In this case, the bitrate is 10 megs per 1.5 minutes, but you need to convert that to kbps. There are 1024 kilobytes in a megabyte. There are 8 bits in a byte. So your target file size is (10 * 1024 * 8) or 81920 total kilobits for the full 1.5 minutes. There are 60 seconds per minute, so (1.5 * 60) means 90 seconds total playback time.
Thus, in this example, there are 81920 kilobits in 90 seconds: 81920 divided by 90 is about 910 kbps (kilobits per second).
So, you could punch in 910 into the bitrate selector when exporting your 1.5-minute movie, and you will get a file that is about 10 megs in size.
You can expect this file size regardless of format (MPG1, MPG4, WMV) and regardless of the actual resolution of the video. There will be some slight differences due to overhead and such, but mostly the resulting file sizes will be at or around 10 megs each.
Since the size is now fixed, your control over the image quality is now dependent on the resolution of the video. A small, Web-sized bitrate like 910 kbps is probably only good for smaller animations, such as 320 x 240.
Of course, you could ask for a high-definition 1280 x 720 video to fit in a tiny 910 kbps bitrate, and yes, your encoder will somehow cram all 90 seconds of HD into the 10 meg file for you, but you may not be happy with the results. It takes more bitrate than that to handle the higher resolutions, and your image quality will suffer tremendously if you set the bitrate too low.
Setting the bitrate higher cleans up the image quality, but at a price. Not only does the movie file size get larger, but also it requires a more powerful computer to handle smooth playback of higher bitrate videos.
For example, for high-definition 1280 x 720 videos, use 5000 kbps as the top bitrate. This does require about a 2.5 GHz or better machine for smooth playback, but the image quality is excellent.
The format you choose influences how effectively the bitrate is used. MPG1 is the most compatible, most widely available format, but being the oldest it is the least efficient. 5000 kbps of MPG1 is about right for standard definition playback, but doe not work as well for high-definition playback. Using 5000 kbps of WMV9 at the same resolution will produce a much nicer result. The newer compression formats make better use of the available bits.