Start-up latency is the waiting period experienced by a user after selecting a stream to play. Typically, overall start-up latency is the result of a number of smaller latencies. When a user clicks a link on a Web page, for example, a whole
Feedback
E-mail us with your comments and feedback about this article.
Abstract
Internet sites with short preview clips, such as music and movie clips, can improve the user experience by reducing the amount of time it takes to begin playing the clips in Microsoft Windows Media Player 9 Series. This article describes the most common causes for the delay or start-up latency, and steps you can take to reduce it.
(8 printed pages)
series of events take place automatically, most of which the user is not even aware. Even though most of the events take place in a small fraction of a second, the sheer number of events can add many seconds to the latency period. Although a few seconds of waiting may not be as important as the clarity of an image, latency can, in some circumstances, significantly impair the user experience.
The user may not perceive start-up latency as a problem when connecting to one source for several minutes or hours, such as an Internet radio station. However, many sites offer previews and short clips that run for less than two minutes. When playing a number of very short clips, such as music previews and news clips, start-up latency can prove frustrating. For example, when searching a collection of 20 music clips, a user may tire of waiting ten or more seconds to play each three-second clip. Because the user is unaware of the cause of the delay, they may also assume that something is wrong. Therefore, latency can reflect poorly on the site that is hosting the content, which can result in user complaints, or worse, the loss of customers.
Essentially, you can reduce latency by reducing both the number of events and the amount of time required by each event before the content begins streaming. The following process outlines the events that take place after a Web page link has been clicked:
Metafile is downloaded. Typically, a Web page link points to a Microsoft® Windows Media® metafile with an .asx extension, which in turn points to the Windows Media content. The time it takes to locate the Web server with the metafile, download the file, and then interpret the file can be bypassed by linking directly to the Windows Media content in the Microsoft Windows Media Player. To do this, you can create a Web page that embeds the Windows Media Player ActiveX® control, and then use scripting to assign the direct URL to the Player property. For example, instead of linking to the URL MMS://WMserver/file.wmv through the metafile at http://Webserver/File.asx, simply assign the MMS URL directly to the Player control. Metafiles use one type of redirection. For more information about how redirection increases start-up latency, see the Using Direct Links topic later in this article.
Player starts. When you click a link to a Windows Media file or stream, the Windows Media Player program or ActiveX control (if the Player is embedded in an application or Web page) opens. The time it takes to start the program takes a number of seconds, and requires system resources. If you have many short clips, design your site so that the Player does not have to be closed and opened as the user plays each clip. For example, you can create one Web page that contains an embedded Player, and provides functionality for selecting multiple clips and playing the content.
Player opens metafile. The Player receives the metafile and begins the process of interpreting the metafile script, locating the content, and connecting to a Windows Media server. Again, you can eliminate this step by linking the Player directly to the content.
Windows Media server negotiates. Before the server begins streaming content, a series of messages are exchanged between the server and client in order to establish the optimum bit rate for the current bandwidth. To do this, Windows Media components use intelligent streaming, which consists of a number of processes for analyzing connection quality and bandwidth. You can reduce the time for one of these processes, called packet-pair negotiation, by using HTTP streaming. For more information, see the Reducing the Time for Packet-Pair Negotiation topic later in this article.
Player is configured. Before the Player can receive a data stream, it must receive header information from the server. The header is built into a stream and contains information that is used by the Player for configuration. For example, the header tells the Player the size of the video frame and the type of codec to use. If a client requires a codec that is not installed on the computer, the Player initiates the process of locating and downloading the codec. Reduce start-up latency by making sure all files in a collection are encoded with the same settings, so that the Player does not have to change configuration.
Buffering takes place. The header also includes the size of the encoding buffer, which is the amount of memory that was used by the codec to compress the data in the encoder. This buffer is also required by the Player to decompress the content. When the Player begins receiving a stream, it must store that amount of data in memory before it can begin rendering the stream. It must also store an additional amount of memory in a network buffer, which is used to provide smooth playback in variable network conditions.
Though buffering is an essential part of streaming, it adds significantly to start-up latency. For example, if a stream requires that five seconds of data be buffered, the start-up latency for buffering will be at least five seconds. To reduce latency, you can minimize the size of the buffers, however, keep in mind that reducing buffer times can affect the quality and presentation of the content. A better solution is to use the Fast Start feature available in Microsoft Windows Media 9 Series. For more information, see the Using Fast Start topic later in this article.
The remaining topics describe specific measures you can take to reduce start-up latency.
Windows Media Player must first buffer data before it can start rendering content. Ordinarily, a five-second buffer takes five seconds to fill. However, with the Fast Start feature of Windows Media 9 Series, buffer time can be reduced significantly for clients with broadband connections.
Fast Start works by delivering the first few seconds of data to the client at a bit rate that is much higher than that of the content. For example, a client requesting a 100 kilobits per second (Kbps) stream over a DSL connection might buffer an initial five seconds of content in less than one second. Users will notice that server-side playlists will switch more smoothly and seamlessly between content items. Additionally, the pre-buffering of data makes the Player resistant to playback errors due to lost packets or other network issues.
Fast Start is enabled by default on the server and Player, so no further action may be required. You can check to make sure that Fast Start is optimized by noting the To limit Fast Start bandwidth on a publishing point value on the Properties tab of a publishing point. The value should be set high enough to provide the maximum benefit from Fast Start, at least 50% higher than the bit rate of the content. After entering a value, note the performance of the server and network, and make sure those resources can handle the additional bit rate.
To limit Fast Start bandwidth on a publishing point
Open the Microsoft Windows Media Services snap-in for Microsoft Management Console (MMC), expand the console tree on the left, and then click the publishing point.
In the details pane, click the Properties tab, and then in the Category list, click Limits.
Select the Limit Fast Start bandwidth per player (Kbps) check box, and then type a new bit rate value.
Packet-pair negotiation is a Windows Media feature that is used to determine the bandwidth that is available for streaming when a client first connects to a server. When RTSP or MMS protocols are used with the UDP protocol, nearly one-half second can be added to the start-up latency. In most cases, these protocols should be used. However, when start-up latency is a concern, Windows Media Services can be configured for HTTP streaming to reduce latency, and the clients linked to the server using the HTTP protocol. Latency can be reduced in this way, because less time is required for packet-pair negotiation.
To enable a Windows Media server for HTTP streaming
Open the Windows Media Services snap-in for Microsoft Management Console (MMC), and click the server for which you want to enable HTTP streaming.
In the details pane, click the Properties tab.
In the Category list, click Control protocol.
In the Plug-in list, click WMS HTTP Server Control Protocol.
Click the Enable button.
By default, the Player connects to an HTTP stream over port 80, using a URL, such as http://WMServer/File.wma. However, if both Windows Media Services and Internet Information Services (IIS) are installed on the same computer, both services will attempt to bind to port 80 by default, which causes a port conflict. If you cannot remove IIS from the server, you can resolve the port conflict by either adding IP addresses to your server, or by changing the port that Windows Media Services uses for HTTP streaming, for example port 8080. If you use a port other than 80 for streaming, you must add the port value to the URL that is accessed by the Player, for example, http://WMServer:8080/File.wma.
To further reduce latency, nearly half of a second can be reduced by not using redirects to link a client to content. While redirection provides a viable method for linking the Player to content, the added communication necessary between network components adds to latency.
Microsoft Windows Media Rights Manager versions 7 and 9 provide a robust solution for protecting copyrighted content, but the time required to start streaming a protected file can add over one second to start-up latency. As an alternative, many sites encrypt full-length content, but offer short preview clips that are not encrypted. (Before trying this approach on your site, make sure you have clearance from the copyright owner of the content.) Another workaround is to use Windows Media Rights Manager version 1, which provides fewer security features than versions 7 or 9, but does reduce latency.