Picking a File Format

Your main concern when choosing a file format for either Web audio or Web video is download time — the length of time it takes for a Web site visitor to be able to experience the music or movie. Most people won’t be willing to go make a sandwich to pass the time waiting to hear your favorite song, and even your dearest friends may not be happy about spending all afternoon trying to see the video of your vacation.

Three main factors affect download time: the speed of the network connection, the file size, and whether the file has to completely download in order to start playing. No matter how fast your Web server’s connection is, you have no control over the speed of your visitors’ connections. Thus, the only thing you can really do is modify either the file size or the manner in which the file is displayed.

I deal with file compression in the following section, so now I want to take a look at streaming versus regular files. With a regular file, such as the MP3 format that is so popular for reproducing music, the entire file must be downloaded and then played. With a streaming file, such as Real Audio, the user can hear the first part of the music while the rest of it is still on the way.

In theory, it sounds like a great idea. Sometimes, though, streaming files (whether with video or audio content) can be jerky and aesthetically deficient, especially with slower connections. So you have to decide whether speed of display is more important to you than smoothness ...

Get Building a Web Site For Dummies®, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.