Accessibility

Table of Contents

Encode, Deliver, Design: Getting a Grip on Flash Video

Step 2: Choose How To Deliver Your Flash Video

So now that you've created your FLV file, the next step is to decide how you want it to play back in Flash. Here are your choices:

  • Progressive download video, which you can do in two ways:

    • Embedding your video in your Flash (FLA) file
    • Storing your FLV files externally
  • Streaming video

Progressive Download

Progressive Flash Video download, which first emerged in Flash Player 6, doesn't make you wait (and wait) for the whole video to download before it starts playing. The video starts its playback as it progressively downloads segments of the video, providing a smoother experience for your users. Many people call this streaming video, but there is a difference, as I will explain later.

There are a couple of ways to use progressively downloaded Flash Video (FLV) on your site. I'll start with the old way, which is importing and embedding the video in your Flash file, and then enlighten you with the new one—playing your FLV files externally.

Embedding Your Video Within the SWF? Think Again!

There's something I have to say, so I might as well get it out of the way right now. Don't embed your video in your Flash file unless it's less than 10 seconds long. Yes, you heard right. While Flash MX touted the coolness of being able to embed video right into the Flash file, I've got news for you—that's not so cool anymore. Here's why.

  • Differing Flash/video frame rates can hurt performance. Embedding works best if your source video and your Flash movie have the same frame rate. If they don't, you need to adjust one of them, and your playback can suffer.
  • Long videos on the Timeline can lose audio/video synch. It's true—if you put a long video on the Timeline, it's likely that you won't be able to keep its audio synched up after about 4000 frames. Also, a single Timeline is limited to 16,000 frames.
  • Stopping the Timeline stops your video. If you embed your video on the Timeline, every time you stop the video, you need to stop the playhead on the Timeline. This is not a very flexible authoring scenario.
  • Download performance can vary. Some developers place embedded video in movie clips to get around the Timeline start/stop issue I mentioned above. However, if you put your video into a movie clip, that movie clip (and the video in it) has to download completely before it will play. This eliminates the progressive download benefit and is a common pitfall for many developers.
  • SWF file publishing time goes up. If you embed your video, you have to republish the video every time you publish the SWF file for posting to your website, leading to problems:

    • It takes a long time to publish a SWF file with video.
    • You can’t alter video content without having to republish the SWF file.
Using External FLVs

In the Developer Center, most of our articles recommend placing your FLV files external to your Flash (FLA) file. This method, new in Flash Player 7, is fast, efficient, flexible, and it doesn't require any additional software. Here are some more reasons:

  • Flash media components are easy-to-use. The media components make it super-easy to create a video controller and playback bar in Flash. Just enter the URL of your external FLV file in the Component Inspector panel, and you're good to go.
  • You avoid all of the issues that come with embedded video. Basically, just take a look at the list of possible embedded video performance and development issues I just described above. Use external FLV files instead, and you can cross those off the list of things you have to worry about.

To play external FLVs, simply upload your FLV files to your website. Then, in Flash MX 2004 Professional, drag a media component onto the Stage, select it, and then define the URL of the FLV file in the Component Inspector panel. That's pretty much it; you now have a controller that will play your video on your site. See "Creating and Playing Flash Video Files Through Progressive Download" for a step-by-step guide to this process.

Streaming

You might be thinking:"That progressive download sure sounded like streaming to me." Well, they are similar—both start playing before the video fully downloads, and a lot of people use the terms interchangeably—but they are not identical.

True streaming video comes from playing your FLV files using Macromedia Flash Communication Server MX. Is the quality higher? Well actually, if you're talking strictly about how the video looks (its colors and sharpness), progressive download and streaming are the same—a 300 Kbps–encoded FLV file is a 300 Kbps–encoded FLV file—no matter how it's delivered.

Well then, so how is streaming different?

  • Streaming video files start playback almost immediately, at any point in the video. While progressive download is a big leap from completely downloading a video file and then playing, streaming takes it one step further. Very little of the video needs to be present in RAM to begin playback. This lets users scrub the video randomly (even frantically) and still, the video plays back almost immediately.
  • Streaming video plays without ever fully downloading to disk. Streaming FLV doesn't save to disk; there is never a file copy on a user's hard drive. This is an advantage to developers who want to make extra sure that no one can replay their video files.
  • Streaming video only requires Flash Player 6. This may not be a big deal to you, however, remember that Flash Communication server came out before Flash Player 7, so you can stream video to users who have only Flash Player 6 installed.
  • You need Flash Communication Server MX to stream video. Yes, you need…wait, that's not exactly true. You need to have access to a version of Flash Communication Server to stream video. Now, you can do that through a hosted solution called Flash Video Streaming Service. Learn more by reading the Developer Center article, "Delivering High-Quality Video with Flash Video Streaming Service."