Accessibility

Flash Communication Server Article

 

Overview of Best Practices for Delivering Flash Video


An Overview of Best Practices for Delivering Flash Video

Macromedia

 

Created:
25 July 2005
User Level:
Intermediate

As a developer, you have several choices about how to distribute Flash Video. Here are some general best-practice techniques that can help you achieve efficient and bug-free server implementations. With Flash Communication Server (FCS), you can distribute your video content smoothly, giving your audience the best possible experience. (Even if you've opted to deliver your Flash Video through progressive download, some of these practices still apply.) In this article, I will take you through a few techniques and industry standards to help you deliver professional video efficiently.

Stream Video for the Best Performance

Trying to decide whether to use streaming or progressive download for delivering your video? This answer to this dilemma is actually quite straightforward. The best way to guarantee best video delivery and to have full control over your video is to stream. Progressive downloading is great for displaying small video for personal/amateur use, because it doesn't require a server, but it offers little extra functionality. Here are a few benefits of streaming over progressive download to customers:

  • Faster video start time
  • Ability to seek anywhere at any time
  • Bulletproof video security
  • Buffer control
  • Real-time exchange of video and data

Note: See Delivering Flash Video: Understanding the Difference Between Progressive Download and Streaming Video for a comparison of these two methods.

Here's a general rule of thumb: If the video is over one minute, it should be streamed. There are two ways to stream video: with Flash Communication Server or with Flash Video Streaming Service (FVSS).

Display Video in the Paused State on the First Frame

In almost all cases, you want people who load your video player page to see the video paused at the first frame. This gives them a preview of what they can expect to see in your video. The fact that the video is paused at the outset also means that the video won't stream if no one is ready to watch it; the viewer has to click the play button. From a behavioral standpoint, this brings the user into the video experience while giving them content control. From a technical standpoint, you save on streaming bandwidth by playing only desired video.

Create an Interactive Video Clip Preview

To create a media-rich experience, provide a five-second preview of the video on mouse over. For examples, see the scroll-over effects view of Ralph Lauren TV; another is the Flash Video Gallery. Read Streaming Through Firewalls and Proxies: From the Client's Perspective for more information on how to show the first frame as quickly as possible.

Auto-Detect Client Connections

Traditionally it has been a practice for online video players to require users to self-select the size of video based on their bandwidth. This creates an interruption in the flow of content, disrupting the smooth point-and-click environment. Flash Communication Server has solved this problem and created a new standard by dynamically checking connection speed without annoyance.

You can easily eliminate this interruption by having the server detect the connection speed that would best fit the user. The server would then stream video at the optimal bit rate for that user's connection. For more details on how to detect connection speeds, see the following articles:

Standardize FLV Naming Conventions

For organization and functional purposes, it is common practice to end your stream name with the encoded rate. For example, after encoding homevideo.avi into a 600 Kbps Flash Video, the resulting file would be named homevideo_600.flv. By combining this standard with FCS, you can automatically stream the correct video file without asking the user. Again, to learn more about dynamically checking the bandwidth of users' connections, check out Delivering Flash Video: Dynamic Bandwidth Detection with Macromedia Flash Communication Server.

Create a Best-Port Solution

Server-side coding with Flash Communication Server lets developers take full control of the order of ports they make available for user connections. Maintaining a constant connection is critical because of the constant communication that FCS needs to maintain between the user and server when distributing video. Sometimes standard ports may not be available or can possibly go down. In this case, you want to be able to provide an alternative port, which Flash Communication Server can make available through HTTP tunneling. Preparing for this is a best practice and, with a little optimization, you can customize the server to provide the fastest and most reliable connection possible.

Although working with proxy servers and firewalls can sometimes be confusing, they are not insurmountable. Read Tunneling Macromedia Flash Communications Through Firewalls and Proxy Servers to learn how to appropriately tunnel around these obstacles.

Trace Applications During Development

Flash Communication Server offers a heads-up display of what applications are being accessed. To gain further access, however, use trace statements to document correctly what is happening to the server. By correctly tracing functions and classes, you can cut down on hours spent figuring out bugs and possible glitches. Creating server-side trace functions also saves on bandwidth, as opposed to putting code inside the SWF file. To learn the FCS way of commenting and other coding standards, check out Best Practices for Writing Flash Communication Server Applications or view the infamous Peldi's Coding Café: Flash Communication Server Best Practices.

Optimize Video Buffering

There are many things to manage when working with streaming video. Setting your buffer correctly is one of them. The advantage of correctly setting your buffer is that you can deliver high-quality video without having to rebuffer every 10 seconds. To accomplish this, you will need to determine the values of three variables: user connection speed, video bit rate, and video length. You can then dynamically calculate your buffer time by building a basic equation into your server. Check out the tutorial Delivering Flash Video: Dynamic Buffering Strategies for Optimal Video Streaming in the Developer Center on how to dynamically detect the appropriate stream.

Measure the Quality of Service with Live Video

Providing live video is different than delivering stored video. To provide an uninterrupted viewing experience with live video, it is a best practice to use quality-of-service measurements to ensure that the feed is streaming smoothly through the network. The "plumbing" in Flash Communication Server automatically drops keyframes if it detects network congestion, but it is still important to match your video's data size (frame rate and dimensions) to your available server-to-client bandwidth. Visit Encoding Best Practices for Live Video to download a live video server application to test out what works best.

Know the User

Broadband continues to grow and is opening new doors for video delivery on the Internet. As of March 2005, 57% of home Internet users in the United States and 77% of those in Canada have broadband (WebSiteOptimization.com). In the US, media companies are commonly delivering web video in two different bandwidths to these broadband companies:

Target Description Download Speed Video Bit Rate
Low broadband Entry-level broadband service, about $20 a month 384 Kbps Around 300 Kbps
High broadband Enhanced broadband service, about $50 a month 1 Mbps Around 500 or 700 Kbps

When delivering internationally or over a company network, the connection speed of your audience may vary from these norms. For example, in Korea, 70% of the general population has a 2 Mbps download rate. If you were catering to that audience, you could stream at over 1 Mbps! For a technical dive into encoding video check out Encoding Best Practices for Prerecorded Flash Video.

Deliver Fresh Video Without Costly Updates

Give the user more content by taking advantage of XML support. With a little programming, create an ordered playlist of video streams you want to display and put it in XML format. Using XML is a common practice for organizing video content and Flash Communication Server dynamically calls out to it to display various video streams. Simply edit the XML-based playlist file to update the data in Flash—with no modification of your ActionScript code. See how easy it is to custom-build an XML application with Flash Communication Server in Creating a Dynamic Playlist for Streaming Flash Video.

Protect Your Content

With Flash Communication Server you can protect video from being hosted on other web servers. While configuring your server, set the VHOST.xml file to give access to the destination domain. This can be simply done with an <allow> tag, which will protect video from unauthorized access. To learn how to correctly secure your content, see the TechNote, Securing Macromedia Flash Communication Server. Also take a look at Taking Control of Connections, which shows you how to control the type of users who are accessing Flash Video content.

Encode Correctly

It is important to distribute video that is both of high quality and caters to your audience's needs. Some applications simplify this process and can create multiple versions of a single video. Be sure to read Encode, Deliver, Design: Getting a Grip on Flash Video and the Capturing and Encoding Video section of the Flash Video Learner's Guide in the Developer Center for an excellent overview. Also, see the Flash Video Partners page to find encoding partners who offer various services such as content delivery, encoding, and hardware. There are many solutions developed for encoding Flash Video by various third parties.

Some Final Recommendations

Whether you're implementing video on demand, streaming video, or video communications, using these guidelines will help you create a successful architecture for your Flash Video application. Flash Communication Server video delivery is becoming more creative and is continuously changing. If you're serious about delivering video content, then stay updated with the Flash Communication Server and Flash Video Developer Centers. Going to conferences like MAX and IBC, where FCS ideas are discussed, presented, and exchanged, is another best practice.

If you don't have a lot of experience with Flash Communication Server and don't have servers to support streaming, check out our Flash Video Streaming Service (FVSS) Partner page. These partners have made the process of configuring video as easy as uploading and linking your page—they even take care of all the legwork. Also check out the Flash Communication Server Partner page, where you can find existing solutions to manage your video delivery. Finally, to learn more about Flash Communication Server and what it can do for you, visit the Flash Communication Server product page and the Flash Communication Server Developer Center.

Good luck with your Flash Video applications. We can't wait to see the next step in video design.

About the author

This content was authored by Macromedia, Inc.