Accessibility

Table of Contents

Encoding Best Practices for Prerecorded Flash Video

Video Encoder Matrixes (for Prerecorded Video)

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.

Encoder Matrix for Video Sources of Higher Quality

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."

Table 1. High-Quality Source Footage
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.

Considerations When Encoding

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:

  • As the target bandwidth (data rate) decreases, reduce the keyframe rate. A lower keyframe rate (for example one keyframe every six seconds) will result in a softer or blurrier image but reduces the bandwidth demand. However, as your required bandwidth decreases, lowering your keyframe rate, for example, from 30  (one keyframe per second at 29.97 fps) to 60 (two keyframes per second at 29.97 fps) will make your video play back more smoothly.
  • As motion increases, you must increase the keyframe rate, the frame rate, and the data rate. High-motion clips require more information to flow to the player. They are not good for low-bandwidth delivery because they require additional uncompressed keyframes to be encoded in the file.
  • Dial-up connections consume almost all of the available bandwidth. For this study, I set a value of 29 Kbps as a minimum data rate, which allowed 11 to 16 Kbps for an audio stream to be added (considering that usable bandwidth is 40 to 45 Kbps).
  • Frame rates are calculated at half-rate, quarter-rate, and third-rate as recommended in the "Technical Overview of Video Standards" section of the Flash Video Learner's Guide. For this study, I used source files encoded at 29.97 fps. Half-rate is 14.985 fps, quarter-rate is 9.99 fps, and third-rate is 7.493 fps.
  • Reduce frame size when bandwidth is limited and frame rate and quality are important. Frame size was reduced in multiples of 16 and converted into the square pixel used in computer screens. A 1:1 conversion of 720 x 486 D1 aspect ratio is 640 x 480 pixels. This study used a half size of 320 x 240 pixels and a one-third size of 192 x 144 pixels.
  • Always enable de-interlacing and set the Flash Video encoder to the upper field. If the video source you are encoding comes straight from a video camera, always enable this feature. If your video is interlaced, selecting this option increases the performance of the video encoding and playback.
  • 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.

Frame Rate, Size, Keyframes, and Data Rate

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).

Flash Video Exporter version 1.2 pointing out the key settings that affect the encoder

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.