22 February 2011
You should have a basic knowledge of the Flash Professional user interface and a basic knowledge of working with FLA files. Certain features, such as H.264 codec support, are available only in Flash Player 9.0.115 and later.
Beginning
Before you can add on-demand (prerecorded) web video to your web page, you must acquire the video and encode it, which involves converting it to a format compatible with Adobe Flash Player (FLV or MPEG-4).
This section of the Video Learning Guide for Flash provides information on how to encode on-demand video, including background information about how web video is encoded and how to get best results when capturing video. We assume that you already have some video in a format other than FLV or a compatible version of MPEG-4. Many leading video editing tools allow you to capture video directly from your digital video camera. For some tips on capturing video, see the later section, "Capturing good video."
Robert Reinhardt's bitrate calculator helps you determine the optimal bitrate at which to encode your videos. See the FLV bitrate calculator links at the top of this page.
Note: To capture and publish live video, use Flash Player and Adobe Flash Media Server. For more information, see the Flash Media Server Developer Center. For higher-quality live video, you can also use Flash Media Live Encoder.)
Flash Professional CS5 provides several video-encoding solutions that let you encode your video clips into the FLV or F4V format.
The Video Import Wizard lets you encode video clips into the 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 CS5 includes Adobe Media Encoder and the QuickTime Exporter.
The Adobe Media 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, Adobe Media 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 for the Adobe Media Encoder application as well as the article, Using Adobe Media Encoder CS5.
Note: Both the Video Import Wizard and the Adobe Media Encoder allow you to export encoding and cue point settings to XML files for reuse across other video production efforts.
A codec is an encoding/decoding algorithm that controls how video files are compressed during encoding, and decompressed during playback. H.264 is recommended for high-definition (HD) video. By default, Adobe Media Encoder exports encoded video using the On2 VP6 video codec for use with Flash Player 8 or later. Adobe Premiere Pro and After Effects (along with a multitude of third-party encoders) allow you to export encoded video using the H.264 video codec for use with Flash Player 9 or later.
If your content dynamically loads web video (using either progressive download or the Flash Media Server for streaming), you can use VP6 video without having to republish your SWF for Flash Player 9, as long as users use Flash Player 8 or later to view your content. By streaming or downloading VP6 video into SWF versions 6 or 7, and viewing the content using Flash Player 8 or later, you avoid having to recreate your SWF files for use with Flash Player 9. See Table 3 for more details.
Note: Although you can publish your SWF to be compatible with earlier versions of Flash Player, only Flash Player 8 or later supports playback of VP6 video.
Table 3. Publish and playback differences among video codecs
| Codec | Content (SWF) version (publish version) | Flash Player version (required for playback) |
|---|---|---|
Sorenson Spark |
6 and later | 6 and later |
On2 VP6 |
6 and later | 8 and later |
| H.264 | 9 and later | 9 and later |
Note: Adobe CS5 products no longer support encoding FLV files using the Sorenson Spark codec. FLV files previously encoded with the Spark codec can be viewed in Flash Player and imported into Flash Professional, but the codec cannot be encoded from Adobe products.
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.
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.
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:
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 key frames, are used to calculate and "rebuild" the missing frames during playback.
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 video for playback in Flash Player. A few of these settings are discussed in general terms in this section; for technical details on some of the other settings, see the NTSC and PAL video standards section of the Video Learning Guide for Flash.
The following are some general guidelines to follow when compressing video to FLV or F4V format for web delivery:
Bit rate is the amount of data transferred per second. When you encode your 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 56 kbps modems, don't provide video encoded at a bit rate of 2 Mbps. For further assistance, check out the web video bitrate calculator.
FLV video is encoded as a sequence of key frames (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 key frame to produce the delta frames between that key frame and the next. During playback, the decoder recreates the delta frames based on the key frames.
The key frame interval is the number of delta frames between key frames. The greater the interval between key frames, the harder it is for the decoder to recreate the missing frames. Also, if your key frame 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 key frame interval results in the perception of poorer quality.
With FLV video, key frames are particularly important if your presentation approach provides a seek or scrub feature, which allows a user to advance the stream during playback.
Note: To allow accurate seeking and scrubbing in a video, you must stream the video with Flash Media Server or Flash Video Streaming Service. To allow seeking to specific locations within a progressive video, you must embed navigation cue points for those locations (timecodes) during encoding. Embedding navigation cue points forces the encoder to place a whole keyframe at the specified timecode, which is the necessary ingredient for accurate seeking.
For more on encoding, see Understanding the video encoding ecosystem for Flash. For information about support for MPEG-4 files using the H.264 video codec, see Supported technologies: H.264.
To capture and publish live video, use Adobe Flash Media Server. For more information, see the Flash Media Server Developer Center. For higher-quality live video, you can also use Flash Media Live Encoder.
Also be sure to check out other sections in the Video Learning Guide for Flash.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License