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
Apple ProRes
Apple ProRes is a codec designed to preserve as much visual quality as possible. It generates extremely large video files. Videos created with Apple ProRes codec are not meant to be distributed as a final video, but instead loaded into video editing software like Adobe Premiere.
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: Apple ProRes, or a stack of frames (PNG, BMP, TGA, for example).
Frame Stacks
Frame stacks are a bit more unwieldy than ProRes videos, 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. Frame stacks also consume more overall disk space than the equivalent ProRes video. Frame stacks are useful when your video editing software doesn't support ProRes encoded videos.
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 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: H.264 or Windows Media (WMV). Both of these choices store your movie in a single, playable file. WMV is an older format suitable for Windows devices. H.264 is a more modern format that works on nearly all devices. H.264 is the recommended codec.
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 website 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.