Accessibility

Dialog Box

Encoding Flash Video


Table of Contents

Preflight your video

Before you create the FLV file, you need to have a plan of action. You simply can’t encode a full-screen video and expect your users to marvel at your technological prowess. You will only marvel at how fast people leave the page.

The first major consideration is user bandwidth. It is still a fact of Internet life that there is a definite bandwidth split. If you live in a large urban area, you most likely have access to a high-speed Internet line either through a cable modem or DSL service. If you are in a rural area, the odds are very good you have dial-up service. If you expect the bulk of your users to be urban-based, a video with the physical dimensions of 320 × 240 will work. That same video will clog a dial-up line. For dial-up, a video 120 × 90 is about as large as you can go.

If you are unsure of what physical dimensions to use, follow these rough guidelines:

  • Playback from a hard drive or CD: 640 × 480
  • High-speed Internet: 320 × 240, or 240 × 180
  • Dial-up: 120 × 90

Note: It’s pretty common for VGA-sized files—640 × 480—to work well at respectable bitrates, but you really have to get nitpicky with settings. Talking head videos or those with very limited motion survive this conversion the best.

Note: This article concerns itself only with the creation of FLV files for playback in the Flash Player. We do not discuss the recent addition of H.264 video to the player lineup of supported formats. To get a complete overview of this subject, check out David Hassoun's article, Exploring Flash Player support for high-definition H.264 video and AAC audio.

The next step in the preflight process is to actually watch the video. Open the video in QuickTime or Windows Media Player, sit back, and watch it. In fact, watch it twice. The first time through the video lets you get the enjoyment factor out of your system. The second time, pay careful attention to the action in the video, the image quality, the colors, and the audio. All of these factors have a profound effect on the final compression you do in the Flash 8 Video Encoder.

Now that you have a good idea of what is going on in the video, note the video’s length, dimensions, frame rate, and the audio and video codecs used to create the video. To find these settings in Windows Media Player, choose File > Properties (Figure 1); to find these settings in QuickTime, choose Window > Show Movie Info (Figure 2).

windows media player

Figure 1: Windows Media Player gives you a lot of valuable information you’ll use when creating the FLV file.

 

quicktime

Figure 2: In QuickTime, choose Window > Show Movie Info to see the video’s properties.

The dimensions and frame rate of the video are the most important pieces of information. If you plan to make the FLV larger than the original video, you are setting yourself up for a nasty quality issue. Resizing a video to a larger size has exactly the same effect as resizing an Adobe Photoshop® image. The only thing that gets bigger is the pixels, resulting in serious degradation of image quality. Also consider the aspect ratio. Standard video has a 4:3 aspect ratio, changing a video’s ratio introduces distortions.

The following story illustrates this last point: A couple of months back, a user approached one of us and accused us of spreading false information. His videos, as he put it, simply weren’t working. In fact, they were distorted, even though he was using a 4:3 aspect ratio. The dimensions of the video we looked at were 200 × 177. If you want your video to play perfectly every time, use the dimensions discussed earlier.

Next, you need to consider frame rate. Broadcast video and many home video cameras record and play back the video at the NTSC standard rate of 29.97 frames per second (fps), commonly referred to as 30 fps. The other broadcast standard, PAL, which is common in Europe, has a frame rate of 25 fps. Neither frame rate is appropriate for Flash video. A frame rate of 30 or 25 fps often overwhelms Flash Player. If the video is recorded at 29.97 or 30 fps, use a frame rate of 15 fps when creating the FLV. If the video was recorded using the PAL standard, a frame rate of 12 fps will work. Use your judgment—if your video has lots of fast motion and transitions, it may require a faster frame rate. In these cases, you’ll need to look elsewhere for optimization—by either adjusting the physical dimensions of the video file smaller, or lowering the bit rate.

If you are using video that is, say, 640 × 480 or larger, a frame rate reduction will actually make playback smoother. One of the authors does a lot of video tutorials. These tutorials are QuickTime screen recordings with audio and they inevitably wind up as an FLV that is 800 by 600. In this case the author tries to keep movement in the video—mouse movement, pans, and zooms—to a minimum and outputs the FLV at a frame rate of 10 frames per second.

Finally, most video codecs are lossy—including the DV format itself, and popular online codecs such as MPEG 4, H.264, and AVI. This means information is lost when you compress the video to make the file size smaller. When you create the FLV file, you further compress an already compressed video! It has exactly the same effect as applying JPEG compression to a JPEG image in Photoshop or Fireworks®. The end result is a video that looks a bit fuzzy. Those crystal-clear videos you see on a number of sites were most likely shot professionally and then digitized using a lossless codec before they were encoded in the Flash CS3 Video Encoder. For Mac OS, the popular lossless codecs are Apple’s QuickTime Animation and Video codecs, and for Windows, the uncompressed AVI format. Use these codecs when you’re editing or compositing your footage before encoding to FLV, so that you can encode a high-quality, flattened final version into FLV and avoid multiple encoding passes that can quickly degrade quality. Your primary concern is the file size of the resulting FLV, not the video file.

If you work with a third-party company who supplies your video, request they apply a lossless codec. If you use Adobe After Effects®, Adobe Premiere® Pro, or even Final Cut Pro to create or clean up the video, the best advice we can give you is this: Create a QuickTime movie using the Video or the Animation codec or, if the video incorporates an alpha channel, use the Animation codec with the Color Depth set to Millions +. When it comes to video, experience shows us the QuickTime format creates far superior results to the WMV and AVI formats.

Avoid the temptation to export the video directly to the FLV format from a video editing application. Another common problem with exporting digital video (DV) footage output directly from an editing application is that interlacing—the splitting of each video frame into two independent sets of fields (alternating rows of pixels)—wreaks havoc on encoding and results in bloated file sizes. Always render a deinterlaced (progressive) version of your video before encoding to FLV. By doing so, you remove the ghosting effects interlacing can cause when played back on computer screens, handheld devices, and phones (which generally only display video as progressive frames anyway).

The final preflight decision is to target a Flash Player version. Though Flash Player 8 and now Flash Player 9 are receiving faster adoption than normal, it is a fact of life that Flash Player 6 and Flash Player 7 have wider penetration. Also consider that many users will view your work from within a corporate setting. Corporate IT departments, as a general practice, are slow to adopt Flash Player 8 or Flash Player 9. Most IT departments have stringent corporate rules regarding the installation of any software—including browser plug-ins—on company-owned computers. If your audience will be primarily in corporate settings, you should target Flash Player 6 or Flash Player 7.

Which Flash Player you target will have a profound impact on both the project design of and the codec you can use. If you target Flash Player 8 or Flash Player 9 you can:

  • Use the On2 VP6 codec
  • Encode and deploy a video with an alpha channel
  • Use the FLVPlayback component and skins in Flash Professional CS3
  • Use the FLVPlayback custom UI components in Flash Professional CS3
  • Add the FLVPlaybackCaptioning component.

If you target Flash Player 6 or Flash Player 7, you can:

  • Use the Sorenson Spark codec
  • Use the Media components for Flash Player 6 and 7