Wednesday, March 31, 2010

Streaming your video


Doing stuff on the Internet usually means downloading files. For example, when you visit a Web page, files containing all the text and pictures on that Web page are first downloaded to your computer, and then your Web-browser program opens them. Likewise, if someone e-mails you a picture or a document with yucky work stuff, your e-mail program actually downloads a file before you open it.
Downloading files takes time, especially if they’re big video files. You sit there and you wait. And wait. And wait. Finally the movie file is done downloading and starts to play, but by then you’ve left the room for a cup of coffee again. But software designers are crafty folk, and they’ve devised methods of getting around the problem of waiting a long time for downloads. They’ve come up with two basic solutions:
  • Streaming media: Rather than downloading a file to your hard drive, streaming files can be played as the data streams through your modem. It works kind of like a radio, where “data” streams through in the form of radio waves, and that data is immediately played through the radio’s speakers as it is received. With streaming audio or video, no file is ever saved on your hard drive. To truly stream your movies to other people, your movie files need to be on a special streaming server on the Web. There is a remote possibility that your Internet service provider offers a streaming media server, but most service providers do not.
  • Progressive download: Newer video-player programs can “fake” streaming pretty effectively. Rather than receiving a movie signal broadcast over the Internet like a radio wave, viewers simply click a link to open the movie as if they were downloading the file. In fact, they are downloading the file — but as soon as enough of the file has been received, the player program can start to play. The program doesn’t need to wait for the whole file to download before it starts. Current versions of QuickTime, RealPlayer, and Windows Media Player all support progressive download. The really cool thing about progressive download is that you don’t need any special kind of server to host the files. Just upload the video file to any server that has enough room to fit it in.
I’m actually being kind of picky about terminology here. Many people now refer to progressive download video files as “streaming video,” and because they basically function the same way, why not? The good news is that you don’t need to do anything special to stream (or progressively download, or whatever you want to call it) your movies to your audience. Just output your movie in QuickTime, RealVideo, or Windows Media Video format, and let the player programs do the rest.

Choosing a Video Format for Internet


Many different video formats are available for the movies you edit on your computer. Each format uses a different codec. (I explain codecs in greater detail in Chapter 13, but a codec, short for compressor/decompressor, is a software tool used for making multimedia files smaller.) Common video file formats include MPEG and AVI, but these two formats are usually not suitable for movies you plan to share online because they have big file sizes. Three other popular formats, however, are perfectly suited to the online world:
  • QuickTime (.QT): Many Windows users and virtually all Macintosh users have the QuickTime Player program from Apple. QuickTime is the only export format available with iMovie. Pinnacle Studio cannot export QuickTime movies, but some more advanced Windows programs like Adobe Premiere can.
  • RealMedia (.RM): This is the format used by the popular RealPlayer, available for Windows and Macintosh systems, among others. Pinnacle Studio can export RealMedia-format video.
  • Windows Movie Video: This format requires Windows Media Player. Almost all Windows users and some Macintosh users already have it. Both Pinnacle Studio and Windows Movie Maker can export Windows Media Video.
Each of these three video formats has strengths and weaknesses. Ultimately the format you choose will probably depend mainly on the editing software you’re using — for example, if you’re using iMovie on a Mac, QuickTime is your only option.

Setting MPEG settings


I like the MPEG format because it is easy to use and — most importantly —widely supported among Mac and PC users. MPEG is actually a family of multimedia file standards. There are currently four MPEG standards:
  • MPEG-1: This is the oldest version of the standard. A drawback of MPEG-1 is that it has a maximum picture size of 352 by 240 pixels.
  • MPEG-2: This standard offers much higher video quality and full-size video. In fact, MPEG-2 is the format used by DVD movies, so if you burn your movies onto DVD, this is the format you’ll use. MPEG-2 files require special MPEG-2 player software, such as a DVD player program.
  • MPEG-3: Usually abbreviated MP3, this file format only contains audio and is a popular file format for music files today.
  • MPEG-4: This newer standard is a cross of MPEG video and Apple QuickTime to produce video with very, very small file sizes. Support for this format is still limited. Studio’s MPEG settings dialog box is a lot simpler than the AVI settings. Review the following settings as you get ready to export your movie in MPEG format:
  • Presets: Studio provides a selection of presets based on how the file will be used. For example, if you plan to record the movie on a VCD, choose the VideoCD preset from the Presets menu.
If possible, I recommend that you stick with one of the presets, but if you absolutely must fiddle with the rest of the MPEG settings, choose Custom from the Presets menu. If you use one of the presets, you can simply click OK to close the Setup Options dialog box. Additional settings can only be adjusted if you choose Custom.
  • Include video: You’ll want to leave this option checked unless you only want to generate an audio file.
  • Filter video: If you’re working with a smaller frame size, check this option to smooth the appearance of the video image.
  • Draft mode: Check this option if you just want to quickly produce a low-quality file for previewing purposes.
  • Compression: Choose MPEG1 or MPEG2. Again, MPEG-2 can provide higher quality, but it requires special player software. MPEG-2 is used on movie DVDs.
  • Width and height: Select a frame size for your video image here. Smaller frame sizes mean smaller files.
  • Data rate: Most of the time you can leave these sliders alone, but you can use them to fine-tune the quality and file size.
The slider on the left controls video data rate, and the slider on the right controls audio data rate. The Make MPEG File tab of the Setup Options dialog box also includes a couple of audio settings. Audio options are
  • Include audio: Uncheck this option if you only want to output video.
  • Sample rate: 44.1 kHz is CD quality, but most digital camcorders can record at 48 kHz. The higher the sample rate, the higher the audio quality (and file size).
  • Data Rate: Use this slider to fine-tune the quality of the audio. Slide it left to reduce quality and file size, or slide it right to increase quality and file size. As you adjust the slider, you see the number in the Kbits/sec box change. Generally I recommend leaving the Data Rate slider alone unless you really need to squeeze a couple more kilobytes of file size out of your movie file.