How to Be Your Own Compression Consultant
So. You’ve decided to add video to your website.Now it’s time to configure the streams. You’re either working with your own streaming server, or using an online video platform (OVP) that lets you configure your streams, so now you’re trying to figure out the best resolution, data rate and H.264 encoding parameters for your file or files.
You could call me, spend a few hundred dollars to get the best answer, or you can tackle the job yourself.Even if you end up calling me in the long run, following the procedures here will knock a bunch off my fee since you’ll be doing most of the grunt work.
So, let’s get started, shall we?
1. Identify your target platform or platforms.
We could spend a bunch of time going back and forth about the wonders of Silverlight and HTML5, but for the vast majority of users in 2011, the most relevant target platform on the computer is Flash.
Once you choose Flash, if you use the H.264 codec (and you should), there are multiple server-based alternatives that allow you to distribute a single stream (or streams) to both the Flash Player and iOS devices. For more on these alternatives in a live scenario (they work similarly for on-demand distribution) click here. In addition, the latest version of the Adobe Flash Media Server can do the same thing.
If you decide to support both Flash and iOS devices, you have to identify the specific iOS devices that you want to serve, and configure your streams accordingly. I deal with that issue extensively in Chapter 6 of my book, Video Compression for Flash, Apple Devices and HTML5, but if you’re in a hurry, download the PDF from this article and you'll find this chart a few pages in.
![H.264 Playback H.264 Playback](http://ia.wxzjnt.com/Images/ArticleImages/ArticleImage.11505.jpg)
H.264-related playback capabilities of Apple iOS devices.
The color coding shows that there are three classes of devices. As you would expect, older devices are limited to lower resolution video at a lower data rate and lower H.264 profile. Depending upon your target audience, you need to choose which classes of devices you want to serve and configure your video streams accordingly.
Typically, you don’t have to perform similar configuration triage when creating streams for Flash playback since you’re more constrained by the deliverability of a stream than a computer’s ability to play it back. That is, a 1080p file encoded at 40 Mbps might overwhelm a five-year-old computer running Flash, but you can’t deliver 40 Mbps in real time anyway. Most streaming sites peak at 720p video at maybe 3-4 mbps, which will play fine even on older computers running Flash.
So, you should exit from this step with an objective list like this:
- I want to play on computers and compatible devices running Flash
- I want to play on all generations of iPhones/iPod touch/iPads, but not the oldest iPods that can only play 320x240 H.264 video
2. Single or adaptive streams?
As I write this in 2011, most of my clients are considering adaptive streaming, usually to both Flash and iDevices. Briefly, adaptive streaming technologies create multiple streams at different resolutions and data rates and send the optimal stream to each playback device, with the ability to change streams should conditions like bandwidth or high CPU utilization warrant a change. For more on adaptive streaming, check out my book (chapter 7) or this introductory article.
In most distribution scenarios, the cost of adaptive streaming is minimal and the value is very significant. For example, because you’re producing a low-resolution, low-bitrate stream for viewers on slow connections, you can also produce a high-resolution, high-bitrate stream for viewers with powerful computers on fast connections. If you were producing a single stream only, you’d have to choose a middle-of-the-road stream that wouldn’t please anyone.
![Adaptive Adaptive](http://ia.wxzjnt.com/Images/ArticleImages/ArticleImage.11506.jpg)
An adaptive streaming topology, courtesy Inlet Technologies, now part of Cisco.
Pretty much all of the server-based technologies discussed above for delivering to Flash and iDevices can stream adaptively as well as single streams. So even if you weren't thinking about adaptive streaming before you read this article, it's something you should definitely consider and perhaps factor into your plans.
3. Configure your streams.
If you do choose adaptive streaming, you’ve got some decisions to make, like the number of streams and their configuration. Yeah, there’s a chapter in the book on that as well, but if you’re in a hurry, you can find some of the information here. The really short answer is that entertainment sites tend to use more streams than news, educational or corporate sites. This is particularly so with subscription sites, like Major League Baseball, which used 11 streams last time I looked. In contrast, most news, educational and corporate sites are in the 3-5 range.
In addition, stream count should relate to the resolution of the original source footage. If SD, you probably don’t need more than 3 streams. If HD, and you’re distributing at least one HD stream, you can definitely produce in the 5-7 range.
In terms of resolution, if you’re working with 4:3 SD source, you probably should go 640x480, 480x360 and perhaps 320x240. If working with HD source, and need four streams, I’d say 720p, 848x480, 640x360 and 480x270.
I don’t mean to breeze over this topic; there are some important decisions here. For example, if your website uses different display windows for the video, you should consider configuring a stream or streams for each display size. In addition, many producers of SD content use the same resolution for all streams and simply vary the data rate and frame rate. So read the reference materials, give these issues some thought and move on to the next step.
To help frame the discussion, let's get some numbers down on the page. Here are the streams I recommended for a recent overseas client.
![Recommendations Recommendations](http://ia.wxzjnt.com/Images/ArticleImages/ArticleImage.11507.jpg)
These decisions are a great first step, but we have a long way to go.
Read part two of this story at StreamingLearningCenter.com.
Related Articles
London-based V-Nova has made some impressive claims about Perseus, its compression technology. Streaming Media's preliminary testing shows that it lives up to some of them.
17 Jun 2016
Three-hour-plus video workshop covers encoding for a variety of platforms and devices, and includes best practices.
30 Aug 2011
While the playing field might seem complex, using a common codec actually makes desktop and mobile encoding simpler.
21 Jul 2011