Prioritizing video properties is key to producing high-quality Internet video. My team and I conducted a study to develop the following recommendations for encoding Flash Video. For this study, I used the Flash Video (FLV) Exporter and Sorenson Squeeze. I adjusted the compression settings of the FLV exporter to balance the data rate with the frame rate and size. The following sections provide settings recommendations for various combinations of video quality and user bandwidth.
Note: Many of the terms used in this section are described in the "Capturing and Encoding Video" section of the Flash Video Learner's Guide. For more information on the methods and source clips used in this study, see the Optimal Encoder Settings Study section of this article.
Table 1 lists my recommended encoder settings for video from higher quality sources with good lighting. Further down are some points to consider when setting up your encoding scheme. I've included an example of video for each setting.
Note to Flash Video Kit users: This table takes the place of the Interactive Settings Calculator mentioned in the "Flash Video Primer."
| Target Connection Speed | Video Bitrate | Width | Height | FPS | Keyframe Interval |
Audio Bitrate |
|---|---|---|---|---|---|---|
| High Motion | High motion; lots of zooms, fades and people moving around | |||||
| 1.5 Mbps | 750 Kbps | 320 | 240 | 29.97 | 60 | 96 Kbps |
| 768 kbps | 575 Kbps | 320 | 240 | 29.97 | 60 | 64 Kbps |
| 384 Kbps | 329 Kbps | 320 | 240 | 14.98 | 30 | 32 Kbps |
| 56k Dial Up | 40 Kbps | 192 | 144 | 9.99 | 20 | 8 Kbps |
| Low Motion | Low motion; general talking heads | |||||
| 1.5 Mbps | 650 Kbps | 320 | 240 | 29.97 | 60 | 96 Kbps |
| 768 kbps | 230 Kbps | 320 | 240 | 14.98 | 30 | 64 Kbps |
| 384 Kbps | 153 Kbps | 320 | 240 | 9.99 | 20 | 32 Kbps |
| 56k Dial Up | 40 Kbps | 192 | 144 | 9.99 | 20 | 8 Kbps |
Note: Keyframes are set to 1 KF every 2 seconds.
Below are some general rules of thumb to follow when compressing video to Flash Video for delivery over the Internet. These general rules will help you manipulate the previous matrices to produce higher quality Flash Video:
Extra video noise in lower quality video requires additional data rate. Compare the settings of high motion for 1 MB below with the high-quality settings above. In the lower quality settings, the frame rates do not go above half of the rate of the source clip.
As you read the following discussion, consider the relationships among frame rate, size, keyframes, and data rate and how they all are affected by the quality and motion level of the six video clips (see Figure 1).
Figure 1. Flash Video Exporter version 1.2 pointing out the key settings that affect the encoder
Data rate (quality) is related directly to frame rate and frame size:
((320 x 240 x 30fps)/1000) DIV 2.5 = 922 Kbps
The above formula is derived from the standard formula for calculating data rate:
frame height x frame width x frame rate (fps) = total bits/sec.
I divided by 1000 to convert bps to Kbps, and I've divided that result by 2.5 because the Sorenson Spark codec has a 2.5:1 compression ratio as you apply it.
Reducing the frame rate by half requires half the data rate:
((320 x 240 x 15fps)/1000) DIV 2.5 = 460 Kbps
Reducing the frame size by half produces a much more dramatic effect on the bandwidth requirements. In the following scenario, notice that by reducing the frame size by half and keeping the frame rate at 30 reduces the data rate demand to one quarter of the original:
((160 x 120 x 30fps)/1000) DIV 2.5 = 230 Kbps
Keyframes are directly related to the frame rate. The higher the frame rate, the more uncompressed keyframes are required. Keyframes are calculated on a per-second basis. The Flash Video encoder requires a value describing the number of frames between each keyframe. You can enter any value you like into the encoder; however, calculating keyframes on a per-second formula produces optimal results. The Flash Video Exporter suggests a keyframe every four frames. You can see this in the Flash Video Exporter by changing the frame rate and then selecting Auto for the keyframes. To calculate more or fewer keyframes, use the following formula:
keyframe interval (sec.) x frame rate (fps) = keyframe value 1s x 12fps = 1 keyframe every 12 frames 2s x 15fps = 1 keyframe every 30 frames 4s x 15fps = 1 keyframe every 60 frames 5s x 30fps = 1 keyframe every 150 frames
Adjusting the keyframe interval does not affect the data rate value directly but does affect the physical size (on your hard drive) of the compressed video file. Alternatively, the data rate value does affect the image quality of the keyframes: The more keyframes you have, the more bits per second are consumed. The recommended rate is one keyframe every four seconds; if you increase this rate to one keyframe every two seconds, the quality of the keyframes will be reduced and, ultimately, the quality of your video will be affected. Increase your data rate to compensate for keyframes above one every four seconds.