Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

Capturing and Encoding Video

Before you can add on-demand (prerecorded) video to your web page, you must acquire the video and encode it, which involves converting it to the Macromedia Flash video (FLV) format.

This section provides information on how to encode on-demand video, including background information about how Flash video is encoded and about how to get best results when capturing video.

This section assumes that you already have some video in a format other than FLV. Many leading video editing tools allow you to capture video directly from your digital video camera.

To capture and publish live video, use Macromedia Flash Player and Macromedia Flash Media Server (formerly Flash Communication Server).

Encoding and Creating Flash Video (FLV) Files

Flash provides several video-encoding solutions that let you encode your video clips into the FLV format.

Flash Video Import wizard

The Flash Video Import wizard lets you encode video clips into the Flash video (FLV) format when you import them. However, the Video Import wizard has limitations in that you can only encode one video clip at a time, and the process of encoding can be both time- and computing-intensive.

For users who work extensively with video-based content, Flash Professional 8 includes the Flash 8 Video Encoder and the QuickTime Exporter.

Note: Flash Basic 8 only provides video encoding for use with embedded video.

Flash 8 Video Encoder

Flash 8 Video Encoder lets you batch process video clips, allowing you to encode several clips at a time without having to interrupt your workflow. In addition to selecting encoding options for video and audio content, the Flash 8 Video Encoder also lets you embed cue points into video clips you encode, and edit the video using crop-and-trim controls.

For more information, see the online help included with the Flash 8 Video Encoder application.

FLV QuickTime Export plug-in

If you have Macromedia Flash Professional 8 and QuickTime 6.1.1 installed on your computer, you can use the FLV QuickTime Export plug-in to export FLV files from supported video-editing applications. You can then import these FLV files directly into Flash to use in your Flash documents.

The following video-editing applications are supported by the FLV Export plug-in:

  • Adobe After Effects (Windows and Macintosh)
  • Apple Final Cut Pro (Macintosh)
  • Apple QuickTime Pro (Windows and Macintosh)
  • Avid Xpress DV (Windows and Macintosh)

Using the FLV QuickTime Export plug-in to export FLV files from either Flash 8 Video Encoder or video-editing applications significantly streamlines the process of working with FLV files in your Flash documents. With the FLV Export plug-in, you can select encoding options for video and audio content as you export, including frame rate, bit rate, quality, and other options. You can import FLV files directly into Flash without needing to re-encode the video after import.

About the On2 VP6 and Sorenson Spark Video Codecs

By default, Flash Video Encoder exports encoded video using the On2 VP6 video codec for use with Flash Player 8, and the Sorenson Spark codec for use with Flash Player 7. A codec is a compression/decompression algorithm that controls how video files are compressed during encoding, and decompressed during playback. The VP6 video codec is the preferred video codec to use when creating Flash content that uses video. VP6 provides the best combination of video quality while maintaining a small file size.

If your Flash content dynamically loads Flash video (using either progressive download or Flash Media Server), you can use VP6 video without having to republish your SWF for Flash Player 8, as long as users use Flash Player 8 to view your content. By streaming or downloading VP6 video into Flash SWF versions 6 or 7, and playing the content using Flash Player 8, you avoid having to recreate your SWF files for use with Flash Player 8.

Caution: Only Flash Player 8 supports both publish and playback of VP6 video.

Codec Content (SWF) version (publish version) Flash Player version (version required for playback)
Sorenson Spark 6 6, 7, 8
7 7, 8
On2 VP6 6 8
7 8
8 8

Capturing Good Video

In addition to the physical properties of your video there are a variety of factors that affect the efficiency of the encoder and, ultimately, the user experience of the video playback. Two factors play a significant role in the encoding process: source quality and frame motion.

Source Quality

You determine the source quality of your video as soon as you press the recording button on your camera. The following are some basic guidelines for getting great source video quality and maximizing quality in your final compressed video.

Use a tripod to reduce camera movement. If your camera is not steady, most of the image moves, causing a high percentage of pixels in the video to change from frame to frame. A steady camera reduces the number of pixels that change from frame to frame, giving you better quality at higher compression rates (lower data rates).

Use good lighting techniques. A high-end camera resting on a tripod can still produce a low-quality image if there is not enough light. Low-light or light-gain filters produce video noise on the image. This noise is different for each frame of video and makes it difficult for the codec to compress the file at a good quality. You may need to use or exceed your maximum data rate to compensate for video noise.

Use the best camera possible. Low-grade cameras—specifically consumer-based ones that record an analog signal on magnetic tape (VHS, Hi-8, and so on)—produce much video analog noise. Still digital cameras in movie mode also have limited quality and generally produce high-noise video clips. Even if the camera is on a tripod, with excellent light, it will produce noise.

Do the best you can with what you have to work with. High-end digital cameras, digital Betacam camcorders, and 35mm film cameras produce a clean image if the scene is well-lit and they are stabilized by a tripod. Such a scenario produces the best compression ratio and lets you reduce the data rate while maintaining excellent quality. However, you may not have access to professional equipment, a tripod, and excellent lighting conditions. Just remember: the higher the quality of your video source, and the less noise in that source, the lower the data rate required to render a good playback file.

Whenever possible, always encode a file from its uncompressed form. If you convert a precompressed digital video format into the FLV format, the previous encoder can introduce video noise. The first compressor has already performed its encoding algorithm on the video and has already reduced its quality, frame size, and rate. It may have also introduced some of its own digital artifacts or noise. This additional noise affects the FLV encoding process and may require a higher data rate to play back a good-quality file.

Frame Motion

Frame motion is another factor to consider in your encoding formula. It is the percentage of the pixels that change from one frame to another. This change can result from a person or object moving, camera effects, or post-production effects, such as the following:

  • People and objects moving can include someone walking past the lens, tree leaves blowing in the wind, cars driving by, or an extreme close-up of a face.
  • Camera effects such as camera panning, zooming, or hand-holding result in almost 100% pixel change from frame to frame.
  • Postproduction effects such as dissolves, fades, wipes, or complex video effects result in a high percentage of pixel changes from frame to frame.

The greater the motion within your video clip, the more information the encoder has to compress. If your clip is relatively still (such as a talking head video), there isn’t much pixel change from frame to frame. The video compressor uses a method of dropping frames and then encoding a series of fully uncompressed frames. These uncompressed frames, called keyframes, are used to calculate and “rebuild” the missing frames during playback.

Best Practices For Encoding On-Demand Video

When you encode on-demand video, you must balance a variety of factors, including amount of motion depicted, file size, target bandwidth, frame rate, keyframe interval, and the pixel dimensions of the video.

You can specify values for some of those factors when you encode Flash video.

The following are some general guidelines to follow when compressing video to Flash video for delivery over the Internet.

  • A higher target bandwidth (also known as data rate) allows for more motion in the video, larger files, better frame rates, and larger pixel dimensions.
  • The less motion there is in your video, the smaller the file size, which lowers the target bandwidth you can reach.
  • As the target bandwidth decreases, reduce the keyframe rate. A lower keyframe rate (such as one keyframe every six seconds) will result in a softer or blurrier image but reduces the bandwidth demand.
  • 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.
  • Reduce frame size when bandwidth is limited and frame rate and quality are important.
  • If the video source you are encoding comes directly from a video camera, always enable de-interlacing and set the Flash Video Encoder to the upper field. If your video is interlaced, selecting this option increases the performance of the video encoding and playback.

About Bit Rate

Bit rate is the amount of data transferred per second. When you encode Flash video, you specify a bit rate for the encoding. Choose a bit rate appropriate to your audience; for example, if most of your visitors are likely to be using 56kbps modems, don’t provide video encoded at a bit rate of 2Mbps.

About Keyframes

Flash video is encoded as a sequence of keyframes (full-frame uncompressed images taken from the video at regular intervals), each of which is followed by information about how to change the pixels of the keyframe to produce the delta frames between that keyframe and the next. During playback, the decoder recreates the delta frames based on the keyframes.

The keyframe interval is the number of delta frames between keyframes. The greater the interval between keyframes, the harder it is for the decoder to recreate the missing frames. Also, if your keyframe interval is too great, you may not have a large enough data rate to compress and transmit the data bits. Therefore, a high-motion video clip with a large keyframe interval results in the perception of poorer quality.

With Flash video, keyframes are particularly important if your presentation approach provides a seek or scrub feature, which allows a user to advance the stream during playback. (To allow seeking and scrubbing in a video, you must stream the video with Flash Media Server or Flash Video Streaming Service.)

Comments