How Streaming Video and Audio Work
Browse the article How Streaming Video and Audio Work
Introduction to How Streaming Video and Audio Work
Old and busted: |
New hotness: Entire episodes of television shows streamed directly to your computer. |
In this article, we'll explore what it takes to create this stream of ones and zeros as well as how it differs from the data in a typical download. We'll also take a look at how to make good streaming media files.
The Web site Homemovie.com lets people make streaming videos from their home movies. Learn about this easy way of making home movies in this episode of Technology Evangelist. VaraStream is combining real-time video and audio over the Web to create live seminars with human interaction in a classroom-type environment. See how VaraStream works in this video from World Business review. |
Finding and Playing Streaming Video and Audio
If you have a connection to the Internet and you want to find streaming video and audio files, you shouldn't have to look far. Sound and video have become a common part of sites all over the Web, and the process of using these files is pretty intuitive. You find something you want to watch or hear -- you click it, and it plays. Unless you're watching a live feed or a webcast, you can often pause, back up and move forward through the file, just like you could if you were watching a DVD or listening to a CD.A video for "The Mesopotamians" by They Might Be Giants plays in an embedded Flash player at stereogum.com. |
- QuickTime, from Apple, plays files that end in .mov.
- RealNetworks RealMedia plays .rm files.
- Microsoft Windows Media can play a few streaming file types: Windows Media Audio (.wma), Windows Media Video (.wmv) and Advanced Streaming Format (.asf).
- The Adobe Flash player plays .flv files. It can also play .swf animation files.
The QuickTime, RealMedia and Windows Media players can work as stand-alone players with their own menu bars and controls. They can also work as browser plugins, which are like miniature versions of the full-scale player. In plugin mode, these players can look like an integrated part of a Web page or pop-up window.
Flash video is a little different. It usually requires a Flash applet, which is a program designed to decode and play streaming Flash files. Programmers can write their own Flash applets and customize them to fit the needs of a specific Web page. Flash is becoming a more popular option for playing streaming video. It's what YouTube, Google Video and the New York Times all use to display videos on their sites. The video below, which demonstrates what would happen if you shot your TV, plays in a Flash applet.
These players and applets do what many applications do -- they play files. We'll look at these files and how they travel to your computer in the next section.
Streaming Files
Streaming video and audio files are compact and efficient, but the best ones start out as very large, high-quality files often known as raw files. These are high-quality digital files or analog recordings that have been digitized, and they haven't been compressed or distorted in any way. Although you can watch a streaming file on an ordinary tv, editing the raw file requires lots of storage space and processing power.It might seem strange that a file that ends up nimble and efficient started out large and unwieldy. The reason is that the compression process, required to make an ordinary file into a streaming file, lowers the file's quality. During compression, blurry, low-quality videos or hard-to-hear audio recordings will only get worse.
OK Go's video for the song "Here it Goes Again" plays in a small window on YouTube. |
- Make the picture smaller: Most streaming videos don't fill the whole screen on a computer. Instead, they play in a smaller frame or window. If you stretch many streaming videos to fill your screen, you'll see a drop in quality.
- Reduce the frame rate: A video is really a series of still images. The frame rate is how quickly these images move from one to the next. A lower frame rate means fewer total images and less data needed to recreate them. The reduction in frame rate is why some streaming videos flicker -- the frame rate is slow enough that your eye and brain sense the transitions between pictures.
In YouTube's full-screen mode, the picture is fuzzier and more pixilated. |
The total reduction in quality depends on a number of factors, including the bitrate, or the speed of the transfer from the server to a computer. For example, the bitrate of a television broadcast is about 240,000 kilobits per second (Kbps), but the bitrate of a dial-up Internet connection is a maximum of 56 Kbps. Someone with a reliable broadband connection with lots of bandwidth can watch high-bitrate files, but someone using a dial-up modem needs to watch at a much lower bitrate. The basic idea is to encode a file that's large enough to look or sound good but small enough to work with the available bandwidth. Some codecs let you create files that will stream differently at different transfer rates, accommodating different connection types. This is known as multi-bitrate encoding.
Once a file is edited, compressed and encoded, it's uploaded to a server. We'll look at the server's role in streaming media in the next section.
Making a good streaming video starts with recording, not compression. With a few basic steps, you can significantly reduce the amount of data required to create the images that make up your video:
|
Streaming Servers
If you work in an office that shares files over a network, you might think of a server as a computer that holds lots of data. But when it comes to streaming video and audio, a server is more than just a massive hard drive. It's also the software that delivers data to your computer. Some streaming servers can handle multiple file types, but others work only with specific formats. For example, Apple QuickTime Streaming Server can stream QuickTime files but not Windows Media files.All of this data gets to where it needs to go because of sets of rules known as protocols, which govern the way data travels from one device to another. You've probably heard of one protocol -- hypertext transfer protocol (HTTP) deals with hypertext documents, or Web pages. Every time you surf the Web, you're using HTTP.
Many protocols, such as transmission control protocol (TCP) and file transfer protocol (FTP), break data into packets. These protocols can re-send lost or damaged packets, and they allow randomly ordered packets to be reassembled later. This is convenient for downloading files and surfing the Web -- if Web traffic slows down or some of your packets disappear, you'll still get your file. But these protocols won't work as well for streaming media. With streaming media, data needs to arrive quickly and with all the pieces in the right order.
Too many outgoing streams can overload a server, causing users to see an error message. |
- Real-time transfer protocol (RTP)
- Real-time streaming protocol (RTSP)
- Real-time transport control protocol (RTCP)
If you're thinking of making and distributing streaming video, there are a couple of choices you'll need to make about format:
|
Step-by-step Streaming
Using streaming media files is as easy as browsing the Web, but there's a lot that goes on behind the scenes to make the process possible:- Using your Web browser, you find a site that features streaming video or audio.
- You find the file you want to access, and you click the image, link or embedded player with your mouse.
- The Web server hosting the Web page requests the file from the streaming server.
- The software on the streaming server breaks the file into pieces and sends them to your computer using real-time protocols.
- The browser plugin, standalone player or Flash application on your computer decodes and displays the data as it arrives.
- Your computer discards the data.
- You record a high-quality video or audio file using film or a digital recorder.
- You digitize this data by importing it to your computer and, if necessary, converting it with editing software.
- If you're creating a streaming video, you make the image size smaller and reduce the frame rate.
- A codec on your computer compresses the file and encodes it to the right format.
- You upload the file to a server
- The server streams the file to users' computers.
In spite of these complications, the world of streaming video and audio continues to grow. In the next few years, Internet TV, Internet radio and other streaming applications may become real competitors against traditional media.