In my last article on “Archiving & Streaming Your Event” (July/August 2007 issue) we briefly talked about video formats for streaming. In this article, we’re going to get down to business and actually discuss the different video formats, bit rates, encoding programs and compression methods.
After reading this article as well as some of the resources I recommend at the end, you will have learned a lot about these formats and how to successfully use them to deploy great looking media content on your website. We’ll deal with the entire process, from selecting the right video format and encoding tools, to calculating the right bitrates and compression ratios. The process can be daunting, especially if you are new to encoding. The entire workflow can be very technical; parameters such as frame rates, key frames, CBR vs. VBR (to name a few) can be a little intimidating. This article will help you understand and select from the most popular video formats and also learn some tips and tricks for compressing and delivering video to the web.
Selecting the right video format for your audience
When choosing the best video format for the web, there are so many choices: Windows Media, Flash, QuickTime and Real Media. The underlying question, from a media content provider’s point of view, is not so much the quality of the format, but the universal accessibility of your intended route. Audience’s experience matters more than anything else.
HERE ARE SOME OF THE MOST COMMON MEDIA PLAYERS AND FORMATS:
• Flash (e.g., Adobe Media Player)^
• Windows Media Player
• QuickTime Player
• VLC Player (www.videolan.org)
• Microsoft Silverlight^
^Technically Flash and Silverlight are plugins
• .fla/.flv/.swf (Flash video)
• .wmv (Windows Media Video)
• .mpg/.mpeg (MPEG version 1/2)
• .mp4 (MPEG version 4)
• .mov (QuickTime)
• .asf (Advanced Streaming Format)
• .rm (Real Media)
• .avi (Audio Video Interleaved)
Many video file formats can be used with a variety of codecs, so choosing a format and choosing a codec are often separate steps. For Web delivery, many combinations of player, codec and format are possible. Which ones you choose depend on your content and your audience. Currently in the video/web marketplace, there are only four major competitors seeking your content: Flash, Windows Media, QuickTime and Real Media
This is the modern format of choice because it’s the most universal. Flash reaches the greatest proportion of computer users with its distribution. Flash brings unmatched ease of use, and the player technology is essentially invisible to the user. Flash has a digital rights management (DRM) component within Flash Media Server 3, and now gives users the ability to download videos to their desktops with the Adobe Media Player (http://labs.adobe.com).
Windows Media offers a mainstream solution for streaming at all bandwidths. The Windows Media 9 codec plays on WM player 7 or later. The latest Windows Media (version 11) has the excellent VC-1 codec at HD (16:9) quality. Compatibility has improved greatly since the major announcement of “Silverlight” which is now available to all users on alternative operating systems or browsers. Windows Media supports full DRM capability through Windows Media DRM services.
Real Video requires software from Real Networks to run in Mac or PC browsers. Real Video can be a fair choice for streaming at all bitrates.
QuickTime is a container format, which means you can use several different codecs for compressing the video (e.g., H.264, DV/DVCPro, etc.). QuickTime is a solid solution for streaming at all bitrates. The QuickTime player has wide, but not universal distribution. H.264 is the native format for video on the iPod and Apple TV. QuickTime supports DRM through Apple’s iTunes Music Store.
Encoding Tools and Compression Methods
There are a wide variety of tools for encoding video (see sidebar on page 32). Each encoding tool’s codec implementation is slightly different. Encoding performance and image quality varies among tools, frame rates and types of content. You should always encode from the highest-quality video source such as an uncompressed (.DV, .MOV, .MPEG2 at 6-10 Mbs, or .AVI file). Do not use compressed video because it contains visual artifacts. Encoding from a compressed video will produce a poor quality output. If your source is analog videotape, use original masters and encode to a high-quality digital format first. Then transcode to the video formats you’ll deliver on the Web. Grass Valley ProCoder 3 is the encoding tool of choice for me and will be the tool we’ll focus on for these examples. These encoding principles are common to all encoding situations.
Preprocessing/Filter Video Settings
These settings apply to all video and are codec-independent.
Deinterlacing: The process of converting interlaced video, like common analog television signals, into a non-interlaced form. Deinterlacing extracts a clean digital-friendly progressive video from the interlaced source.
Color Correction: Vivid color and good contrast can help the codec produce good results at lower bitrates.
Cropping and Resizing: When cropping or resizing video, it is good practice to select dimensions that are divisible by 16 (use 8 or 4 for small images). Common encoded video sizes are 320×240, 400×300, 240×180, and 120×190. Other aspect ratios for importing digital video sources are (720×480 or 486 – 4:3 Standard TV), (1.85:1 or 2.4:1 – 16:9 High-Def TV).
Encoding: These settings set parameters for the encoding process itself. Some of the available options will vary from codec to encoder tool, but the general principles apply.
Constant vs. Variable Bitrate Encoding (CBR vs. VBR):
CBR is useful for streaming multimedia content on limited capacity channels since it is the maximum bit rate that matters, not the average, so CBR would be used to take advantage of all of the capacity. CBR encoding maintains a fixed bitrate over the duration of the video. CBR encoding is fast, generally done in one pass, and sometimes in two-pass encoding tools.
VBR alternates the amount of output data per time segment. VBR allows a higher bitrate to be allocated to the more complex segments of media files while less space is allocated to less complex segments. The average of these rates is calculated to produce an average bitrate for the file that will represent its overall quality. In most encoding tools, two-pass VBR trots through the video twice. The first time it runs through the video, it analyzes the changes in motion and so on. In the second pass, it does the actual compression.
Video codecs capture a complete image of one frame “a key frame” and then encode subsequent frames by calculating the differences between them. The more scene changes that appear in the video, the more keyframes you’ll need to get good results. Keyframe intervals of 5 – 8 seconds are typical. Accept the default values.
The number of still images that make up one second of video; .30fps is full motion video for NTSC, .25fps for PAL. When a video is encoded to a frame rate of less than fifteen frames per second, it becomes noticeably jumpy, but it is good for low-bitrate encoding. Targeted frame rates are 7.5, 10, 15 and 30 are acceptable.
The measurement of the number of data bits per second in a file. Eight bits form one byte. Video files are normally measured in thousands of bits, or kilobits per second (kbps). The higher the bitrate, the larger the resulting file for a specified amount of time. User’s Internet Bandwidth determines their experience. If the user’s bandwidth is higher than the video’s bitrate, they’ll get quick-loading, smooth-running video. If the bitrate is higher than the available bandwidth, the user will be waiting for the video to buffer or download before they can start to view it.
Choosing Encoding Parameters
Three separate dimensions of video quality all compete for bits from the total bitrate – accurately reproducing fine detail in a video image, frame rate and frame size. Reducing one of these will let you increase another, while increasing any one decrease the others. Here is a guideline for encoding decisions using Quicktime/H.264, Windows Media, Real Media and Flash. Testing different options with your own media content is essential.
Downloading vs. Streaming
Know the Differences Before Encoding Your Video
Streaming and downloading are distinct methods of Internet delivery, each with its own benefits and limitations. No matter if you’re delivering Windows Media, Real Media, QuickTime or Flash, the user cannot tell whether the video they’re watching is downloading or streaming.
Delivering your video file using a web server is “HTTP download” or “Progressive download”. You place a video or audio file on your Web server, then put a link to the file on your web page and it begins to download to the user’s computers. The entire video file is delivered, so the video arrives with the same quality at which it was encoded. The “progressive download” feature in most media players allows them to begin playing the file as soon as enough data has been downloaded. Of course, you can’t fast-forward to the end of the file until it has completely downloaded from the web server. In this case, the user will receive the file only as fast as their connection will support. If the bitrate of the video significantly exceeds the available bandwidth, the user will have to wait for enough video to download before they can play it. Once the file is completely downloaded, it is cached into the temporary folder of the user’s computer, so they can play it again if they want to without having to download it again.
Alternatively, when a media file is streamed via a media streaming server, a measured stream of data is delivered to users as the video plays. There are two sides to this conversation – one to transfer the video and one for control messages between the player and the server. They continue to exchange these control messages with the player, and streaming servers such as Windows Media Server and Adobe Flash Media Server can adjust to changing network conditions as the video plays, improving the viewing experience. You can skip ahead in a video, or begin playback at a point somewhere in the middle. It also lets you monitor exactly what people are watching, and for how long they are watching it. The video file is not stored on the user’s computer.
In conclusion, on which video format for the web is the best format to use? Audiences experience matters more than anything else; conduct an experiment on a few encoding tools, formats and calculated bitrates for your intended audience and playback the file locally to see and hear which of the formats you like the best.Test those formats via a web server or streaming server with the appropriate web player and let a few colleagues take a look at the video and give some feedback on their web experience.